From 7e03425bc2c55b3f3da51eec04e27125f9aac2e5 Mon Sep 17 00:00:00 2001 From: Mac Chaffee Date: Wed, 10 Sep 2025 18:20:05 -0400 Subject: [PATCH] fix: move config out of data dir --- compose.yml | 3 ++- entrypoint.sh | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/compose.yml b/compose.yml index 79986f0..095f041 100644 --- a/compose.yml +++ b/compose.yml @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index aa1fa07..3d55c00 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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