From 24d40b7912319f9fad59047b7b65e7f701fb134b Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 1 Sep 2017 15:17:39 -0700 Subject: [PATCH] Preserve SECRET_KEY across restarts fixes #2 --- start.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/start.sh b/start.sh index 0780b11..cb88aca 100755 --- a/start.sh +++ b/start.sh @@ -62,6 +62,11 @@ if ! [ -f /app/data/app.ini ]; then cp /home/git/app.ini.template /app/data/app.ini fi +if [ "$(crudini --get /app/data/app.ini security SECRET_KEY)" == "##SECRET_KEY" ]; then + echo "Generating new SECRET_KEY" + crudini --set "/app/data/app.ini" security SECRET_KEY $(pwgen -1 -s) +fi + # merge user config file crudini --merge "/run/gitea/app.ini" < "/app/data/app.ini"