Allow migration

This commit is contained in:
Alexandre
2025-02-15 10:34:30 +01:00
parent b13d7f4a74
commit 5a2c1a27a6
4 changed files with 28 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
- SECURITY FIX : avoid hardcoding the postgres root password and change it if was already applied
- Ensure host is reachable before starting
- Autocorrect homeassistant.local to local ip
- Align configuration with /addon_configs
## 1.126.1 (15-02-2025)
- Update to latest version from imagegenius/docker-immich (changelog : https://github.com/imagegenius/docker-immich/releases)

View File

@@ -31,7 +31,7 @@ USER root
# Global LSIO modifications
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_lsio.sh" "/ha_lsio.sh"
ARG CONFIGLOCATION="/config/addons_config/immich"
ARG CONFIGLOCATION="/config"
RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh
# Install REDIS

View File

@@ -85,10 +85,10 @@
"image": "ghcr.io/alexbelgium/immich-{arch}",
"init": false,
"map": [
"media:rw",
"config:rw",
"addons:rw",
"addon_config:rw",
"backup:rw",
"homeassistant_config:rw",
"media:rw",
"share:rw",
"ssl:rw"
],
@@ -141,6 +141,6 @@
"slug": "immich",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "1.126.1-3",
"version": "1.126.1-4",
"webui": "http://[HOST]:[PORT:8080]"
}

View File

@@ -0,0 +1,22 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
MIGRATED=""
PREVIOUS_FOLDER="immich"
# Move main folder
if [ -f /homeassistant/addons_config/"$PREVIOUS_FOLDER"/config.yaml ]; then
bashio::log.warning "----------------------------------------"
bashio::log.warning "Migrating configuration to the new addon"
bashio::log.warning "----------------------------------------"
cp -rnp /homeassistant/addons_config/"$PREVIOUS_FOLDER"/ /config/
mv /homeassistant/addons_config/"$PREVIOUS_FOLDER" "$PREVIOUS_FOLDER"_migrated
if [ -d /config/addons_config ]; then rm -r /config/addons_config; fi
echo "Files moved to /addon_configs/$HOSTNAME"
fi
# Move autoscript
if [ -f /homeassistant/addons_autoscrips/immich.sh ]; then
cp -rnf /homeassistant/addons_autoscrips/"$PREVIOUS_FOLDER".sh /config/ &>/dev/null || true
bashio::log.yellow "... moved "$PREVIOUS_FOLDER".sh from /config/addons_autoscripts to /addon_configs/$HOSTNAME"
fi