Preserve SECRET_KEY across restarts

fixes #2
This commit is contained in:
Girish Ramakrishnan 2017-09-01 15:17:39 -07:00
parent 83ca72d103
commit 24d40b7912

View file

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