summaryrefslogtreecommitdiffstats
path: root/docker/etc
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@users.noreply.github.com>2018-05-16 11:58:44 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2018-05-16 23:58:44 +0800
commitecfc401eaa707914d487574134fcd9e3bbeac60d (patch)
treee656b7cdd9b2dfe2402582d30b01d72f0df6853f /docker/etc
parent4ceb92f311f8c27790378ff2b9d9820308ce5451 (diff)
downloadgitea-ecfc401eaa707914d487574134fcd9e3bbeac60d.tar.gz
gitea-ecfc401eaa707914d487574134fcd9e3bbeac60d.zip
Allow Gitea to run as different USER in Docker (#3961)
* If using a different $USER then rename git user * Chown based on $USER env * Target only one part of passwd * su-exec based on $USER not a hardcoded value
Diffstat (limited to 'docker/etc')
-rwxr-xr-xdocker/etc/s6/gitea/run2
-rwxr-xr-xdocker/etc/s6/gitea/setup2
2 files changed, 2 insertions, 2 deletions
diff --git a/docker/etc/s6/gitea/run b/docker/etc/s6/gitea/run
index 1fddb93708..da5fd6b535 100755
--- a/docker/etc/s6/gitea/run
+++ b/docker/etc/s6/gitea/run
@@ -2,5 +2,5 @@
[[ -f ./setup ]] && source ./setup
pushd /app/gitea > /dev/null
- exec su-exec git /app/gitea/gitea web
+ exec su-exec $USER /app/gitea/gitea web
popd
diff --git a/docker/etc/s6/gitea/setup b/docker/etc/s6/gitea/setup
index 8e6441c5c2..6ca9b82123 100755
--- a/docker/etc/s6/gitea/setup
+++ b/docker/etc/s6/gitea/setup
@@ -39,5 +39,5 @@ if [ ! -f /data/gitea/conf/app.ini ]; then
envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini
fi
-chown -R git:git /data/gitea /app/gitea /data/git
+chown -R ${USER}:git /data/gitea /app/gitea /data/git
chmod 0755 /data/gitea /app/gitea /data/git