diff --git a/mealie/CHANGELOG.md b/mealie/CHANGELOG.md index 12db479b7..e6a42a84e 100644 --- a/mealie/CHANGELOG.md +++ b/mealie/CHANGELOG.md @@ -114,7 +114,7 @@ ## 1.0.1 (03-01-2023) -- Migrates data to cp -r /data/\* /config/addons_config/mealie_data/ to enable usage of new addons +- Migrates data to cp -r /data/\* /config/ to enable usage of new addons - WARNING : update to supervisor 2022.11 before installing - Optional passing of env variables by adding them in a config.yml file (see readme) - Breaking change : amd64 updated to mealie 1.0 diff --git a/mealie/Dockerfile b/mealie/Dockerfile index 52fc10e08..25c88fec1 100644 --- a/mealie/Dockerfile +++ b/mealie/Dockerfile @@ -29,7 +29,7 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \ # Correct data path # hadolint ignore=DL4006 -RUN grep -rl "/app/data" /app | xargs sed -i 's|/app/data|/config/addons_config/mealie_data|g' && \ +RUN grep -rl "/app/data" /app | xargs sed -i 's|/app/data|/config|g' && \ sed -i "s|change_user$|# change_user|g" /app/run.sh ################## diff --git a/mealie/README.md b/mealie/README.md index f73c421a9..0309f3205 100644 --- a/mealie/README.md +++ b/mealie/README.md @@ -51,7 +51,7 @@ Options can be configured through two ways : ``` - Config.yaml - Additional options can be configured using the config.yaml file found in /config/addons_config/mealie/config.yaml + Additional options can be configured using the config.yaml file found in /homeassistant/addons_config/xxx-mealie/config.yaml The complete list of options can be seen here : https://nightly.mealie.io/documentation/getting-started/installation/backend-config/ diff --git a/mealie/config.json b/mealie/config.json index 1fff94f92..26c3bbb1e 100644 --- a/mealie/config.json +++ b/mealie/config.json @@ -65,7 +65,7 @@ "/dev/nvme2" ], "environment": { - "DATA_DIR": "/config/addons_config/mealie_data", + "DATA_DIR": "/config", "DB_ENGINE": "sqlite", "MAX_WORKERS": "1", "WEB_CONCURRENCY": "2", @@ -74,14 +74,15 @@ }, "image": "ghcr.io/alexbelgium/mealie-{arch}", "map": [ - "config:rw", + "addon_config:rw", + "homeassistant_config:rw", "share:rw", "ssl:rw" ], "name": "Mealie", "options": { "ALLOW_SIGNUP": true, - "DATA_DIR": "/config/addons_config/mealie_data", + "DATA_DIR": "/config", "PGID": 1000, "PUID": 1000, "certfile": "fullchain.pem", diff --git a/mealie/rootfs/run.txt b/mealie/rootfs/run.txt index c4ac726f7..5caa86881 100644 --- a/mealie/rootfs/run.txt +++ b/mealie/rootfs/run.txt @@ -31,11 +31,27 @@ for k in $(bashio::jq "/data/options.json" 'keys | .[]'); do export "$k"="$(bashio::config "$k")" done +#################### +# MIGRATE DATA DIR # +#################### + +if [ -d /homeassistant/addons_config/mealie_data ] && [ ! -f /homeassistant/addons_config/mealie_data/migrated ]; then + bashio::log.warning "Migrating data" + cp -rnf /homeassistant/addons_config/mealie_data/* /config/ || true + touch /homeassistant/addons_config/mealie_data/migrated +fi + +if [ -f /homeassistant/addons_config/mealie/config.yaml ] && [ ! -f /homeassistant/addons_config/mealie/migrated ]; then + bashio::log.warning "Migrating config.yaml" + cp -nf /homeassistant/addons_config/mealie/config.yaml /config/ || true + touch /homeassistant/addons_config/mealie/migrated +fi + ############### # CONFIG YAML # ############### -CONFIGSOURCE="/config/addons_config/mealie/config.yaml" +CONFIGSOURCE="/config/config.yaml" if [ -f "$CONFIGSOURCE" ]; then bashio::log.info "config.yaml found in $CONFIGSOURCE, exporting variables" @@ -70,10 +86,10 @@ while IFS= read -r line; do echo "secret detected" secret=${line#*secret } # Check if single match - secretnum=$(sed -n "/$secret:/=" /config/secrets.yaml) + secretnum=$(sed -n "/$secret:/=" /homeassistant/secrets.yaml) [[ $(echo $secretnum) == *' '* ]] && bashio::exit.nok "There are multiple matches for your password name. Please check your secrets.yaml file" # Get text - secret=$(sed -n "/$secret:/p" /config/secrets.yaml) + secret=$(sed -n "/$secret:/p" /homeassistant/secrets.yaml) secret=${secret#*: } line="${line%%=*}='$secret'" fi