summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorKyle D <kdumontnu@gmail.com>2021-02-23 14:21:44 -0500
committerGitHub <noreply@github.com>2021-02-23 20:21:44 +0100
commit61f347e3499ef55c57b87e09e92fa44ec127b451 (patch)
treea8e0e1b374a48fb873c63f2a71495a7945b38a98 /docker
parent428d0edcb08bfb8824780ff91abf93d5932cf9d9 (diff)
downloadgitea-61f347e3499ef55c57b87e09e92fa44ec127b451.tar.gz
gitea-61f347e3499ef55c57b87e09e92fa44ec127b451.zip
Add environment-to-ini to docker image (#14762)
* Add environment-to-app.ini routine * Call environment-to-ini in docker setup scripts * Automatically convert section vars to lower case to match documentation * Remove git patch instructions * Add env variable documentation to Install Docker
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/root/etc/s6/gitea/setup3
-rwxr-xr-xdocker/rootless/usr/local/bin/docker-setup.sh3
2 files changed, 6 insertions, 0 deletions
diff --git a/docker/root/etc/s6/gitea/setup b/docker/root/etc/s6/gitea/setup
index 4449420b99..38187b29e0 100755
--- a/docker/root/etc/s6/gitea/setup
+++ b/docker/root/etc/s6/gitea/setup
@@ -48,6 +48,9 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
chown ${USER}:git ${GITEA_CUSTOM}/conf/app.ini
fi
+# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME
+environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini
+
# only chown if current owner is not already the gitea ${USER}. No recursive check to save time
if ! [[ $(ls -ld /data/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/gitea; fi
if ! [[ $(ls -ld /app/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /app/gitea; fi
diff --git a/docker/rootless/usr/local/bin/docker-setup.sh b/docker/rootless/usr/local/bin/docker-setup.sh
index 9764ff3c59..ef86d01c9f 100755
--- a/docker/rootless/usr/local/bin/docker-setup.sh
+++ b/docker/rootless/usr/local/bin/docker-setup.sh
@@ -46,3 +46,6 @@ if [ ! -f ${GITEA_APP_INI} ]; then
SECRET_KEY=${SECRET_KEY:-""} \
envsubst < /etc/templates/app.ini > ${GITEA_APP_INI}
fi
+
+# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME
+environment-to-ini --config ${GITEA_APP_INI}