summaryrefslogtreecommitdiff
path: root/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'entrypoint.sh')
-rw-r--r--entrypoint.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index 2a43a24..5375491 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -10,7 +10,9 @@ export CGITRC_ROOT_TITLE="${CGITRC_ROOT_TILE:-"Git repository browser"}"
export CGITRC_SCAN_PATH="${CGITRC_SCAN_PATH:-"/srv/git"}"
export CGITRC_SNAPSHOTS="${CGITRC_SNAPSHOTS:-"tar.gz"}"
export HOSTNAME="${HOSTNAME:-"$(hostname -f)"}"
+export HTTPD_GROUP="${HTTPD_GROUP:-"1000"}"
export HTTPD_LISTEN_PORT="${HTTPD_LISTEN_PORT:-"80"}"
+export HTTPD_USER="${HTTPD_USER:-"1000"}"
# Output debugging info
env | grep '^CGITRC_' | sort
@@ -25,5 +27,9 @@ envsubst \
< "/etc/cgitrc.template" \
> "/etc/cgitrc"
+# Create group and user
+addgroup -g "$HTTPD_GROUP" cgit
+adduser -G cgit -h "$CGITRC_SCAN_PATH" -u "$HTTPD_USER" cgit
+
# Run apache2
exec /usr/sbin/httpd -D FOREGROUND