mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-03 23:07:23 +08:00
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:
parent
c5e3c1cdb7
commit
b4be4cf14b
@ -76,7 +76,7 @@ install -o git -g git -m0600 /dev/null /home/git/.ssh/authorized_keys
|
|||||||
<para>
|
<para>
|
||||||
For any developer who should have access to the repository
|
For any developer who should have access to the repository
|
||||||
add his/her public ssh key to <filename>/home/git/.ssh/authorized_keys</filename>.
|
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
|
connection to git for port forwarding to other machines
|
||||||
the git server might reach.
|
the git server might reach.
|
||||||
</para>
|
</para>
|
||||||
@ -116,6 +116,14 @@ cat <user-ssh-key> >> /home/git/.ssh/authorized_keys</userinput></sc
|
|||||||
<systemitem class="username">root</systemitem> user):
|
<systemitem class="username">root</systemitem> user):
|
||||||
</para>
|
</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 &&
|
<screen role="root"><userinput>install -o git -g git -m755 -d /srv/git/project1.git &&
|
||||||
cd /srv/git/project1.git &&
|
cd /srv/git/project1.git &&
|
||||||
git init --bare &&
|
git init --bare &&
|
||||||
@ -126,6 +134,13 @@ chown -R git:git .</userinput></screen>
|
|||||||
<sect3>
|
<sect3>
|
||||||
<title>3. Populate the repository from a client system</title>
|
<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>
|
<para>
|
||||||
Now that the repository is created, it can be used by the
|
Now that the repository is created, it can be used by the
|
||||||
developers to put some files into it. Once the ssh key of
|
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:
|
to the repository as the initial content:
|
||||||
</para>
|
</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
|
<screen role="nodump"><userinput>mkdir myproject
|
||||||
cd myproject
|
cd myproject
|
||||||
git init --initial-branch=trunk
|
git init --initial-branch=trunk
|
||||||
@ -198,7 +220,8 @@ git push</userinput></screen>
|
|||||||
Access is restricted by the public keys added to git's
|
Access is restricted by the public keys added to git's
|
||||||
<filename>authorized_keys</filename> file and there is no
|
<filename>authorized_keys</filename> file and there is no
|
||||||
option for the public to export/clone the repository. To
|
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>
|
</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
@ -209,7 +232,7 @@ git push</userinput></screen>
|
|||||||
<para>
|
<para>
|
||||||
The setup described above makes a repository available for
|
The setup described above makes a repository available for
|
||||||
authenticated users (via providing the ssh public key file).
|
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
|
repository to unauthenticated users - of course without write
|
||||||
access.
|
access.
|
||||||
</para>
|
</para>
|
||||||
@ -252,7 +275,7 @@ git push</userinput></screen>
|
|||||||
<screen role="root" revision="systemd"><userinput>make install-git-daemon</userinput></screen>
|
<screen role="root" revision="systemd"><userinput>make install-git-daemon</userinput></screen>
|
||||||
|
|
||||||
<para>
|
<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>
|
repository, a file named <filename>git-daemon-export-ok</filename>
|
||||||
is required in each repository directory on the server. The
|
is required in each repository directory on the server. The
|
||||||
file needs no content, just its existance enables, its absence
|
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>
|
<screen role="root"><userinput>touch /srv/git/project1.git/git-daemon-export-ok</userinput></screen>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Also review the configuration file
|
Finally, review the configuration file
|
||||||
<filename revision="sysv">/etc/sysconfig/git-daemon</filename>
|
<filename revision="sysv">/etc/sysconfig/git-daemon</filename>
|
||||||
<filename revision="systemd">/etc/default/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>
|
</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
Loading…
Reference in New Issue
Block a user