Use CONFIG_LOCATION only for migration

This commit is contained in:
Alexandre
2026-01-09 10:11:18 +01:00
parent 2dd05df4c9
commit 6bbb3de5fe
32 changed files with 227 additions and 81 deletions

View File

@@ -1,2 +1,4 @@
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
## 2.2.2-1 (09-01-2026)
- ⚠ MAJOR CHANGE : switch to the new config logic from homeassistant. Your configuration files will have migrated from /config/addons_config/kometa to a folder only accessible from my Filebrowser addon called /addon_configs/xxx-kometa. Please make a backup before updating.

View File

@@ -28,7 +28,7 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_SERVICES_GRACETIME=0
ENV HOME=/config/addons_config/kometa
ENV HOME=/config
# Image specific modifications
RUN \
@@ -38,7 +38,7 @@ RUN \
# Global LSIO modifications
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_lsio.sh" "/ha_lsio.sh"
ARG CONFIGLOCATION="/config/addons_config/kometa"
ARG CONFIGLOCATION="/config"
RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh
##################

View File

@@ -67,7 +67,7 @@ Options can be configured through two ways :
PUID: 1000 #for UserID - see below for explanation
PGID: 1000 #for GroupID - see below for explanation
TZ: Europe/London #Specify a timezone to use EG Europe/London.
KOMETA_CONFIG: /config/addons_config/kometa/config/config.yml #Specify a custom config file to use.
KOMETA_CONFIG: /addon_configs/xxx-kometa/config.yml #Specify a custom config file to use.
KOMETA_TIME: 03:00 #Comma-separated list of times to update each day. Format: HH:MM.
KOMETA_RUN: False #Set to True to run without the scheduler.
KOMETA_TEST: False #Set to True to run in debug mode with only collections that have test: true.
@@ -90,4 +90,3 @@ Create an issue on github
![illustration](https://dausruddin.com/wp-content/uploads/2020/05/plex-meta-manager-v3-1024x515.png)

View File

@@ -69,13 +69,14 @@ devices:
image: ghcr.io/alexbelgium/kometa-{arch}
init: false
map:
- config:rw
- addon_config:rw
- homeassistant_config:rw
- share:rw
- media:rw
name: Kometa
options:
env_vars: []
KOMETA_CONFIG: /config/addons_config/kometa/config.yml
KOMETA_CONFIG: /config/config.yml
PGID: 0
PUID: 0
privileged:
@@ -96,4 +97,4 @@ schema:
slug: kometa
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/kometa
version: 2.2.2
version: 2.2.2-1

View File

@@ -0,0 +1,21 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
slug=kometa
legacy_path="/homeassistant/addons_config/$slug"
target_path="/config"
mkdir -p "$target_path"
if bashio::config.has_value 'CONFIG_LOCATION' && [ "$(bashio::config 'CONFIG_LOCATION')" != "/config" ]; then
legacy_path="$(bashio::config 'CONFIG_LOCATION')"
fi
if [ -d "$legacy_path" ]; then
if [ ! -f "$legacy_path/.migrated" ] || [ -z "$(ls -A "$target_path" 2>/dev/null)" ]; then
echo "Migrating $legacy_path to $target_path"
cp -rnf "$legacy_path"/. "$target_path"/ || true
touch "$legacy_path/.migrated"
fi
fi