Author: thomas Date: Sun Jan 10 08:15:58 2021 New Revision: 24099 Log: Add note about using the daemon; fix $HOME of git user
Modified: trunk/BOOK/general.ent trunk/BOOK/general/prog/gitserver.xml trunk/bootscripts/ChangeLog trunk/bootscripts/blfs/init.d/git-daemon Modified: trunk/BOOK/general.ent ============================================================================== --- trunk/BOOK/general.ent Sun Jan 10 03:05:01 2021 (r24098) +++ trunk/BOOK/general.ent Sun Jan 10 08:15:58 2021 (r24099) @@ -83,7 +83,7 @@ <!ENTITY lfs-vim-version "7.4"> <!-- End LFS versions --> -<!ENTITY blfs-bootscripts-version "20210105"> +<!ENTITY blfs-bootscripts-version "20210110"> <!ENTITY systemd-units-version "20210105"> Modified: trunk/BOOK/general/prog/gitserver.xml ============================================================================== --- trunk/BOOK/general/prog/gitserver.xml Sun Jan 10 03:05:01 2021 (r24098) +++ trunk/BOOK/general/prog/gitserver.xml Sun Jan 10 08:15:58 2021 (r24099) @@ -70,8 +70,7 @@ </para> <screen role="root"><userinput>install -o git -g git -dm0700 /home/git/.ssh && -install -o git -g git -m0600 /dev/null /home/git/.ssh/authorized_keys -</userinput></screen> +install -o git -g git -m0600 /dev/null /home/git/.ssh/authorized_keys</userinput></screen> <para> For any developer who should have access to the repository @@ -292,8 +291,8 @@ different location, you'll need to tell the boot script where the repository is to be found. This can be achieved by creating a configuration file named <filename>/etc/sysconfig/git-daemon</filename>. - This configuration file will be imported if it exists. It can - look like:</para> + This configuration file will be imported if it exists, meaning it is + optional. The file can look like:</para> <screen revision="sysv"> # Begin /etc/sysconfig/git-daemon @@ -353,6 +352,20 @@ </listitem> </itemizedlist> </para> + + <para> + After starting the daemon, unauthenticated users can clone exported + repositories by using + </para> +<screen role="nodump"><userinput>git clone git://gitserver/project1.git</userinput></screen> + + <para> + As the basedir is <filename class="directory">/srv/git</filename> by + default (or set to a custom value in the config), <application>git</application> + interprets the incoming path (/project1.git) relative to that base + directory so that the repository in <filename class="directory">/srv/git/project1.git</filename> + is served. + </para> </sect3> Modified: trunk/bootscripts/ChangeLog ============================================================================== --- trunk/bootscripts/ChangeLog Sun Jan 10 03:05:01 2021 (r24098) +++ trunk/bootscripts/ChangeLog Sun Jan 10 08:15:58 2021 (r24099) @@ -1,3 +1,6 @@ +2021-01-10 Thomas Trepl <tho...@linuxfromscratch.org> + * Add set $HOME in bootscript, add description of + how to use the git:// protocol for unauth clones. 2021-01-05 Thomas Trepl <tho...@linuxfromscratch.org> * Add git-daemon bootscript Modified: trunk/bootscripts/blfs/init.d/git-daemon ============================================================================== --- trunk/bootscripts/blfs/init.d/git-daemon Sun Jan 10 03:05:01 2021 (r24098) +++ trunk/bootscripts/blfs/init.d/git-daemon Sun Jan 10 08:15:58 2021 (r24099) @@ -27,22 +27,27 @@ . /lib/lsb/init-functions -GIT_BIN="/usr/bin/git" GIT_DAEMON_OPTS="" -DFT_REPO_DIR="/srv/git/" -PID_FILE="/run/git-daemon.pid" +GIT_BASE_DIR="/srv/git/" +DFT_REPO_DIR="$GIT_BASE_DIR" if [ -f "/etc/sysconfig/git-daemon" ]; then . /etc/sysconfig/git-daemon fi +PID_FILE="/run/git-daemon.pid" +GIT_BIN="/usr/bin/git" +GIT_USR="git" +GIT_GRP="git" +GIT_HOME=$(eval echo ~$GIT_USR) case "${1}" in start) log_info_msg "Starting git-daemon ... " + export HOME=$GIT_HOME $GIT_BIN daemon \ --detach --pid-file=$PID_FILE \ - --user=git --group=git \ + --user=$GIT_USR --group=$GIT_GRP \ --reuseaddr \ - --base-path=$DFT_REPO_DIR \ + --base-path=$GIT_BASE_DIR \ $GIT_DAEMON_OPTS \ $DFT_REPO_DIR evaluate_retval -- http://lists.linuxfromscratch.org/listinfo/blfs-book FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page