More tweaks to git server page

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24092 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Bruce Dubbs 2021-01-08 18:46:05 +00:00
parent c5e3c1cdb7
commit b4be4cf14b

View File

@ -76,7 +76,7 @@ install -o git -g git -m0600 /dev/null /home/git/.ssh/authorized_keys
<para>
For any developer who should have access to the repository
add his/her public ssh key to <filename>/home/git/.ssh/authorized_keys</filename>.
First, prepend some options to prevent users to use the
First, prepend some options to prevent users from using the
connection to git for port forwarding to other machines
the git server might reach.
</para>
@ -116,6 +116,14 @@ cat &lt;user-ssh-key&gt; &gt;&gt; /home/git/.ssh/authorized_keys</userinput></sc
<systemitem class="username">root</systemitem> user):
</para>
<note>
<para>
In all the instructions below, we use <emphasis>project1</emphasis>
as an example repository name. You should name your repository
as a short descriptive name for your specific project.
</para>
</note>
<screen role="root"><userinput>install -o git -g git -m755 -d /srv/git/project1.git &amp;&amp;
cd /srv/git/project1.git &amp;&amp;
git init --bare &amp;&amp;
@ -126,6 +134,13 @@ chown -R git:git .</userinput></screen>
<sect3>
<title>3. Populate the repository from a client system</title>
<note>
<para>
All the instructions in this section and the next should
be done on a user system, not the server system.
</para>
</note>
<para>
Now that the repository is created, it can be used by the
developers to put some files into it. Once the ssh key of
@ -150,6 +165,13 @@ EOF</userinput></screen>
to the repository as the initial content:
</para>
<note>
<para>
The <emphasis>gitserver</emphasis> term used below
should be the host name (or ip address) of the git server.
</para>
</note>
<screen role="nodump"><userinput>mkdir myproject
cd myproject
git init --initial-branch=trunk
@ -198,7 +220,8 @@ git push</userinput></screen>
Access is restricted by the public keys added to git's
<filename>authorized_keys</filename> file and there is no
option for the public to export/clone the repository. To
enable this, continue with step 4 to setup the git server.
enable this, continue with step 4 to set up the git server
for public read-only access.
</para>
</sect3>
@ -209,7 +232,7 @@ git push</userinput></screen>
<para>
The setup described above makes a repository available for
authenticated users (via providing the ssh public key file).
There is also a quite simple way to publish the
There is also a simple way to publish the
repository to unauthenticated users - of course without write
access.
</para>
@ -252,7 +275,7 @@ git push</userinput></screen>
<screen role="root" revision="systemd"><userinput>make install-git-daemon</userinput></screen>
<para>
In order to make <application>git</application> exporting a
In order to allow <application>git</application> to export a
repository, a file named <filename>git-daemon-export-ok</filename>
is required in each repository directory on the server. The
file needs no content, just its existance enables, its absence
@ -262,10 +285,10 @@ git push</userinput></screen>
<screen role="root"><userinput>touch /srv/git/project1.git/git-daemon-export-ok</userinput></screen>
<para>
Also review the configuration file
Finally, review the configuration file
<filename revision="sysv">/etc/sysconfig/git-daemon</filename>
<filename revision="systemd">/etc/default/git-daemon</filename>
for valid repository paths.
for valid repository paths and change them as appropriate.
</para>
</sect3>