alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.51k stars 214 forks source link

🐛 [Mealie] Moving config files seems to be incorrect #1607

Open gschmidl opened 1 day ago

gschmidl commented 1 day ago

Description

I upgraded to the latest v2.0-beta4 via v2.0-beta2 and now it looks like almost all the Mealie files are directly in /config:

image

They're also in addon_configs as the changelog states, but I don't know how they got to /config. Can I delete them?

Reproduction steps

I guess "upgrade Mealie and see if it happens"? Sorry, I have nothing here.

Addon Logs

/etc/cont-init.d/00-banner.sh: executing

-----------------------------------------------------------
 Add-on: Mealie
 Mealie is a self hosted recipe manager and meal planner built in Vue
-----------------------------------------------------------
 Add-on version: v2.0-beta4
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (aarch64 / yellow)
 Home Assistant Core: 2024.10.2
 Home Assistant Supervisor: 2024.10.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 1000
User GID : 1000
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
ALLOW_SIGNUP='false'
BASE_URL='https://xxx:9090/'
DATA_DIR='/config'
PGID='1000'
PUID='1000'
certfile='fullchain.pem'
keyfile='privkey.pem'
ssl='true'
Timezone set from Etc/UTC to Europe/Vienna
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f_mealie/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables

... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f_mealie/mealie.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/31-nginx.sh: executing
[13:33:36] INFO: Exporting variables
ALLOW_SIGNUP=false
BASE_URL=https://xxx:9090/
DATA_DIR=/config
PGID=1000
PUID=1000
certfile=fullchain.pem
keyfile=privkey.pem
ssl=true
[13:33:38] INFO: config.yaml found in /config/config.yaml, exporting variables
Permissions adapted
[13:33:38] INFO: Starting nginx
[13:33:38] INFO: Starting app
INFO     2024-10-15T13:34:13 - Started server process [7]
INFO     2024-10-15T13:34:13 - Waiting for application startup.
INFO     2024-10-15T13:34:13 - start: database initialization
INFO     2024-10-15T13:34:13 - Database connection established.
INFO     2024-10-15T13:34:13 - Context impl SQLiteImpl.
INFO     2024-10-15T13:34:13 - Will assume non-transactional DDL.
INFO     2024-10-15T13:34:14 - Checking for migration data fixes
INFO     2024-10-15T13:34:15 - end: database initialization
INFO     2024-10-15T13:34:15 - -----SYSTEM STARTUP-----
INFO     2024-10-15T13:34:15 - ------APP SETTINGS------
INFO     2024-10-15T13:34:15 - {
    "TESTING": false,
    "PRODUCTION": true,
    "LOG_CONFIG_OVERRIDE": null,
    "LOG_LEVEL": "info",
    "theme": {
        "light_primary": "#E58325",
        "light_accent": "#007A99",
        "light_secondary": "#973542",
        "light_success": "#43A047",
        "light_info": "#1976D2",
        "light_warning": "#FF6D00",
        "light_error": "#EF5350",
        "dark_primary": "#E58325",
        "dark_accent": "#007A99",
        "dark_secondary": "#973542",
        "dark_success": "#43A047",
        "dark_info": "#1976D2",
        "dark_warning": "#FF6D00",
        "dark_error": "#EF5350"
    },
    "BASE_URL": "https://xxx:9090",
    "STATIC_FILES": "/spa/static",
    "IS_DEMO": false,
    "HOST_IP": "*",
    "API_HOST": "0.0.0.0",
    "API_PORT": 9000,
    "API_DOCS": true,
    "TOKEN_TIME": 48,
    "GIT_COMMIT_HASH": "cba381cb67cd55693ce16a76a14f7f1fe221dbda",
    "ALLOW_SIGNUP": false,
    "DAILY_SCHEDULE_TIME": "23:45",
    "SECURITY_MAX_LOGIN_ATTEMPTS": 5,
    "SECURITY_USER_LOCKOUT_TIME": 24,
    "DB_ENGINE": "sqlite",
    "DEFAULT_GROUP": "Home",
    "DEFAULT_HOUSEHOLD": "Family",
    "SMTP_HOST": null,
    "SMTP_PORT": "587",
    "SMTP_FROM_NAME": "Mealie",
    "SMTP_FROM_EMAIL": null,
    "SMTP_AUTH_STRATEGY": "TLS",
    "LDAP_AUTH_ENABLED": false,
    "LDAP_SERVER_URL": null,
    "LDAP_TLS_INSECURE": false,
    "LDAP_TLS_CACERTFILE": null,
    "LDAP_ENABLE_STARTTLS": false,
    "LDAP_BASE_DN": null,
    "LDAP_QUERY_BIND": null,
    "LDAP_USER_FILTER": null,
    "LDAP_ADMIN_FILTER": null,
    "LDAP_ID_ATTRIBUTE": "uid",
    "LDAP_MAIL_ATTRIBUTE": "mail",
    "LDAP_NAME_ATTRIBUTE": "name",
    "OIDC_AUTH_ENABLED": false,
    "OIDC_CLIENT_ID": null,
    "OIDC_CONFIGURATION_URL": null,
    "OIDC_SIGNUP_ENABLED": true,
    "OIDC_USER_GROUP": null,
    "OIDC_ADMIN_GROUP": null,
    "OIDC_AUTO_REDIRECT": false,
    "OIDC_PROVIDER_NAME": "OAuth",
    "OIDC_REMEMBER_ME": false,
    "OIDC_USER_CLAIM": "email",
    "OIDC_GROUPS_CLAIM": "groups",
    "OIDC_TLS_CACERTFILE": null,
    "OPENAI_BASE_URL": null,
    "OPENAI_MODEL": "gpt-4o",
    "OPENAI_CUSTOM_HEADERS": {},
    "OPENAI_CUSTOM_PARAMS": {},
    "OPENAI_ENABLE_IMAGE_SERVICES": true,
    "OPENAI_WORKERS": 2,
    "OPENAI_SEND_DATABASE_DATA": true,
    "OPENAI_REQUEST_TIMEOUT": 60,
    "WORKER_PER_CORE": 1,
    "UVICORN_WORKERS": 1
}
INFO     2024-10-15T13:34:15 - Daily tasks scheduled for 2024-10-15 21:45:00+00:00
INFO     2024-10-15T13:34:15 - Application startup complete.
INFO     2024-10-15T13:34:15 - Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)

Architecture

armv7

OS

HAos

alexbelgium commented 1 day ago

Hi,

They use the new HA logic that allows for config files to be backuped with addon.

Previous logic :

New logic :

Migration is done automatically, and previous files are still accessible at their previous place but a text file "migrated" was added to show that they were migrated and won't be used again. The DATA_DIR variable is changed from the default of "/config/addons_config/mealie_data" to "/config". If it was manually changed from the default, it should be changed manually also.

alexbelgium commented 1 day ago

Normally, those erroneous "/addons_config" folders in /config should have been deleted, but I implemented a safeguard here : https://github.com/alexbelgium/hassio-addons/blob/f7217b17fd00d9a7cb2760902f57a94aa638908d/mealie/rootfs/run.txt#L53-L55

Guess I will remove the safeguard for people who don't use sqlite

gschmidl commented 23 hours ago

Yeah, I saw this, but something copied it to /config directly, as seen in the screenshot. Possibly the first beta of 2.0, since trying to export a backup from Mealie using that version, I got a complete copy of the /config directory.

edit to add: nor did I see a "migrated" text file.