Update gitea checks and group permissions
This commit is contained in:
parent
e78fa63e58
commit
57bac39365
1 changed files with 19 additions and 16 deletions
|
@ -12,11 +12,18 @@ readConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
if [[ -d "$giteaDir" ]]; then
|
GITEA_CONFIG=${GITEA_CONFIG:-/etc/gitea/app.ini}
|
||||||
echo "Cleaning out old Gitea backups..."
|
if [[ ! -r "$GITEA_CONFIG" ]]; then
|
||||||
rm -f "$giteaDir"/* || return 1
|
echo "ERROR: Cannot read gitea app.ini in $GITEA_CONFIG"
|
||||||
else
|
return 4
|
||||||
mkdir -p "$giteaDir" | return 1
|
fi
|
||||||
|
|
||||||
|
GITEA_USER=${GITEA_USER:-git}
|
||||||
|
GITEA_GROUP=${GITEA_GROUP:-git}
|
||||||
|
GITEA_HOME=${GITEA_HOME:-$(getent passwd ${GITEA_USER} | cut -f6 -d:)}
|
||||||
|
if [[ ! -d "$GITEA_HOME" ]]; then
|
||||||
|
echo "ERROR: Cannot find Gitea home directory"
|
||||||
|
return 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$GITEA_BIN" ]]; then
|
if [[ -n "$GITEA_BIN" ]]; then
|
||||||
|
@ -40,17 +47,13 @@ check() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GITEA_CONFIG=${GITEA_CONFIG:-/etc/gitea/app.ini}
|
if [[ -d "$giteaDir" ]]; then
|
||||||
if [[ ! -r "$GITEA_CONFIG" ]]; then
|
echo "Cleaning out old Gitea backups..."
|
||||||
echo "ERROR: Cannot read gitea app.ini in $GITEA_CONFIG"
|
rm -f "$giteaDir"/* || return 1
|
||||||
return 4
|
else
|
||||||
fi
|
mkdir -p "$giteaDir" | return 1
|
||||||
|
chgrp "$GITEA_GROUP" "$giteaDir"
|
||||||
GITEA_USER=${GITEA_USER:-git}
|
chmod g+wx "$giteaDir"
|
||||||
GITEA_HOME=${GITEA_HOME:-$(getent passwd ${GITEA_USER} | cut -f6 -d:)}
|
|
||||||
if [[ ! -d "$GITEA_HOME" ]]; then
|
|
||||||
echo "ERROR: Cannot find Gitea home directory"
|
|
||||||
return 5
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue