Return to repo list

remgit-scripts

A collection of scripts for use with a simple remote git service.
Return to HMagellan.com

commit c2c2a071046291f19db9b52cc9c80e097ce3a25b
parent 1d7b87274c6542af8bdb4dcbead3656f9dd4c3d5
Author: Erik Letson <hmagellan@tutamail.com>
Date:   Sat,  4 Jul 2020 09:19:08 -0500

chown fix

Diffstat:
Mgitnew.sh | 13+++++++------
Mupstagit.sh | 4++++
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gitnew.sh b/gitnew.sh @@ -6,19 +6,20 @@ # TODO: basic verification (names, etc.) # Configure to your git site's web root & the directory that contains repos therein -SITEPATH="/var/www/default" -REPODIR="git" +SITE_PATH="/var/www/default" +REPO_DIR="git" +GIT_USER="git" if [[ -z $@ ]] then echo "No arguments passed. Please pass one or more names for new repos." else for i in $@ ; do - mkdir $SITEPATH/$REPODIR/$i - cd $SITEPATH/$REPODIR/$i + mkdir $SITE_PATH/$REPO_DIR/$i + cd $SITE_PATH/$REPO_DIR/$i git init --bare touch git-daemon-ok - cd $SITEPATH/$REPODIR - chown -R git:git $i + cd $SITE_PATH/$REPO_DIR + chown -R $GIT_USER:$GIT_USER $i done fi diff --git a/upstagit.sh b/upstagit.sh @@ -14,6 +14,7 @@ ICON_WIDTH="32" ICON_HEIGHT="32" STAGIT_COM="/usr/local/bin/stagit" STAGIT_INDEX_COM="$STAGIT_COM-index" +WEB_USER="root" #Who should own the webroot and the files therein? # Update web frontend for each repo for i in $(ls $REPO_PATH); do @@ -51,3 +52,6 @@ for j in $(ls $REPO_PATH); do sed -i "s,width\=\"32\" height\=\"32\",width\=\"$ICON_WIDTH\" height=\=\"$ICON_HEIGHT\",g" "$k" done done + +# Set correct ownership rights +chown -R $WEB_USER:$WEB_USER $WEB_PATH