1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
techknowlogick
2018-05-16 11:58:44 -04:00
committed by Lunny Xiao
parent 4ceb92f311
commit ecfc401eaa
3 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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