diff --git a/.env.sample b/.env.sample index 2d5556b..5d125fc 100644 --- a/.env.sample +++ b/.env.sample @@ -23,8 +23,11 @@ MAX_BLOGS="10" # Set to true if using keycloak DISABLE_PASSWORD_AUTH=false -#This is here so later lines can extend it; you likely don't wanna edit +# This is here so later lines can extend it; you likely don't wanna edit COMPOSE_FILE="compose.yml" +# You also likely don't wanna edit these paths +ASSETS_PATH=/usr/share/writefreely +DATA_PATH=/data ## Domain aliases #EXTRA_DOMAINS=', `www.writefreely.example.com`' diff --git a/compose.yml b/compose.yml index 38c2cbc..86b9d7f 100644 --- a/compose.yml +++ b/compose.yml @@ -19,13 +19,13 @@ services: configs: - source: config_ini # Can't put the config file in /data or else the volume mounts conflict - target: /usr/share/writefreely/config.ini + target: ${ASSETS_PATH}/config.ini - source: writefreely_entrypoint target: /abra-entrypoint.sh mode: 0555 entrypoint: /abra-entrypoint.sh volumes: - - "local-data:/data" + - "local-data:${DATA_PATH}" networks: - internal - proxy diff --git a/config.ini.tmpl b/config.ini.tmpl index 2f42b4b..d47a724 100644 --- a/config.ini.tmpl +++ b/config.ini.tmpl @@ -5,10 +5,10 @@ bind = 0.0.0.0 tls_cert_path = tls_key_path = autocert = false -templates_parent_dir = -static_parent_dir = -pages_parent_dir = -keys_parent_dir = +templates_parent_dir = {{ env "ASSETS_PATH" }} +static_parent_dir = {{ env "ASSETS_PATH" }} +pages_parent_dir = {{ env "ASSETS_PATH" }} +keys_parent_dir = {{ env "DATA_PATH" }} hash_seed = gopher_port = 0 diff --git a/entrypoint.sh b/entrypoint.sh index 3d55c00..4451351 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,8 @@ #!/bin/sh set -e # Must match config mout point in compose.yml -CONFIG=/usr/share/writefreely/config.ini -SENTINEL=/data/abra_first_time_setup +CONFIG="$ASSETS_PATH/config.ini" +SENTINEL="$DATA_PATH/abra_first_time_setup" if [ ! -f $SENTINEL ]; then echo "Running first-time setup"