fix: move config out of data dir

This commit is contained in:
Mac Chaffee
2025-09-10 18:20:05 -04:00
parent 8e51569ee4
commit 7e03425bc2
2 changed files with 12 additions and 7 deletions

View File

@ -18,7 +18,8 @@ services:
- SITE_THEME
configs:
- source: config_ini
target: /data/config.ini
# Can't put the config file in /data or else the volume mounts conflict
target: /usr/share/writefreely/config.ini
- source: writefreely_entrypoint
target: /abra-entrypoint.sh
mode: 0555

View File

@ -1,11 +1,15 @@
#!/bin/sh
set -e
# Must match config mout point in compose.yml
CONFIG=/usr/share/writefreely/config.ini
SENTINEL=/data/abra_first_time_setup
if [ ! -f /data/abra_first_time_setup ]; then
if [ ! -f $SENTINEL ]; then
echo "Running first-time setup"
/go/cmd/writefreely/writefreely --gen-keys
/go/cmd/writefreely/writefreely db init
touch /data/abra_first_time_setup
/usr/bin/writefreely -c $CONFIG --gen-keys
/usr/bin/writefreely -c $CONFIG db init
touch $SENTINEL
fi
/go/cmd/writefreely/writefreely db migrate
exec /go/cmd/writefreely/writefreely
/usr/bin/writefreely -c $CONFIG db migrate
exec /usr/bin/writefreely -c $CONFIG