|
@@ -49,6 +49,14 @@ if [[ ! -f /app/data/.setup_done ]]; then
|
|
|
touch /app/data/.setup_done
|
|
|
fi
|
|
|
|
|
|
+# load session secret
|
|
|
+if [[ -f /app/data/secret ]]; then
|
|
|
+ secret=$(cat /app/data/secret)
|
|
|
+else
|
|
|
+ secret=$(uuid)
|
|
|
+ echo "${secret}" > /app/data/secret
|
|
|
+fi
|
|
|
+
|
|
|
# Re-create config.json
|
|
|
sed -e "s,##APP_ORIGIN,${APP_ORIGIN}," \
|
|
|
-e "s/##MONGODB_HOST/${MONGODB_HOST}/" \
|
|
@@ -56,7 +64,7 @@ sed -e "s,##APP_ORIGIN,${APP_ORIGIN}," \
|
|
|
-e "s/##MONGODB_USERNAME/${MONGODB_USERNAME}/" \
|
|
|
-e "s/##MONGODB_PASSWORD/${MONGODB_PASSWORD}/" \
|
|
|
-e "s/##MONGODB_DATABASE/${MONGODB_DATABASE}/" \
|
|
|
- -e "s/##SECRET/$(uuid)/" \
|
|
|
+ -e "s/##SECRET/${secret}/" \
|
|
|
/app/code/config.json.template > /run/nodebb/config.json
|
|
|
|
|
|
for plugin in $(./nodebb plugins | grep 'nodebb-' | cut -f3 -d' '); do
|