From 31417d0297ff46ec19d3e77b4dab24beead90d68 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 9 Jan 2026 09:47:05 +0100 Subject: [PATCH 1/4] Adjust photoprism migration marker --- photoprism/CHANGELOG.md | 2 ++ photoprism/README.md | 8 ++++---- photoprism/config.yaml | 7 ++++--- photoprism/rootfs/etc/cont-init.d/00-folders.sh | 4 ++++ photoprism/rootfs/etc/cont-init.d/01-migrate.sh | 16 ++++++++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 photoprism/rootfs/etc/cont-init.d/01-migrate.sh diff --git a/photoprism/CHANGELOG.md b/photoprism/CHANGELOG.md index f018a491b..2d19b1b95 100644 --- a/photoprism/CHANGELOG.md +++ b/photoprism/CHANGELOG.md @@ -1,3 +1,5 @@ +## ubuntu-2025-11-30-3 (2026-01-10) +- ⚠ MAJOR CHANGE : switch to the new config logic from homeassistant. Your configuration files will have migrated from /config/addons_config/photoprism to a folder only accessible from my Filebrowser addon called /addon_configs/xxx-photoprism. This avoids the addon to mess with your homeassistant configuration folder, and allows to backup the options. Migration of data should be automatic, but update any custom paths or permissions to avoid breakage. Please be sure to update all your links however ! For more information, see here : https://developers.home-assistant.io/blog/2023/11/06/public-addon-config/ ## ubuntu-2025-11-30 (2025-11-30) - Update to latest version from photoprism/photoprism diff --git a/photoprism/README.md b/photoprism/README.md index 2fa574677..a47e89ccc 100644 --- a/photoprism/README.md +++ b/photoprism/README.md @@ -85,6 +85,8 @@ Configurations can be done through the app webUI, except for the following optio | `cifspassword` | str | | SMB password for network shares | | `cifsdomain` | str | | SMB domain for network shares | +⚠ **Migration notice**: Configuration files now live under `/addon_configs/xxx-photoprism/photoprism/`. The add-on will attempt to migrate files from the old `/config/addons_config/photoprism/` location automatically, but any hard-coded paths, scripts, or backups pointing at the old location will need to be updated. Make a backup before upgrading in case custom paths or permissions cause the migration to fail. + ### Example Configuration ```yaml @@ -106,12 +108,12 @@ cifsdomain: "workgroup" ### Advanced Configuration -Additional options can be configured in `/config/addons_config/photoprism/config.yaml`. +Additional options can be configured in `/addon_configs/xxx-photoprism/photoprism/config.yaml`. Complete list: https://github.com/photoprism/photoprism/blob/develop/docker-compose.yml ### External Database Setup -For external database, add to `addons_config/photoprism/config.yaml`: +For external database, add to `/addon_configs/xxx-photoprism/photoprism/config.yaml`: ```yaml PHOTOPRISM_DATABASE_DRIVER: "mysql" @@ -146,5 +148,3 @@ You can access it via portainer addon or executing `docker exec -it "/homeassistant/addons_config/$slug/.migrate" +fi + +if [ -d /config/addons_config ]; then + rm -rf /config/addons_config +fi From 2d44ee234aa8a10ca1f05d6f3e7ca46a25f6cf9d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 9 Jan 2026 10:01:06 +0100 Subject: [PATCH 2/4] Update photoprism config migration --- photoprism/README.md | 1 - .../rootfs/etc/cont-init.d/00-folders.sh | 7 +++--- .../rootfs/etc/cont-init.d/01-migrate.sh | 23 +++++++++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/photoprism/README.md b/photoprism/README.md index a47e89ccc..d28d3d1f1 100644 --- a/photoprism/README.md +++ b/photoprism/README.md @@ -76,7 +76,6 @@ Configurations can be done through the app webUI, except for the following optio | `IMPORT_PATH` | str | `/share/photoprism/import` | Import files path | | `BACKUP_PATH` | str | `/share/photoprism/backup` | Backup storage path | | `UPLOAD_NSFW` | bool | `true` | Allow uploads that may be offensive | -| `CONFIG_LOCATION` | str | | Location of additional config.yaml | | `graphic_drivers` | list | | Graphics driver (mesa) | | `ingress_disabled` | bool | | Disable ingress for direct IP:port access | | `localdisks` | str | | Local drives to mount (e.g., `sda1,sdb1,MYNAS`) | diff --git a/photoprism/rootfs/etc/cont-init.d/00-folders.sh b/photoprism/rootfs/etc/cont-init.d/00-folders.sh index e81c5d7fc..01a5374cc 100755 --- a/photoprism/rootfs/etc/cont-init.d/00-folders.sh +++ b/photoprism/rootfs/etc/cont-init.d/00-folders.sh @@ -12,8 +12,7 @@ fi bashio::log.info "Preparing scripts" echo "... creating structure" -CONFIG_DIR="$(dirname "$(bashio::config "CONFIG_LOCATION")")" -mkdir -p "$CONFIG_DIR" +mkdir -p /config/photoprism mkdir -p \ /data/photoprism/originals \ /data/photoprism/import \ @@ -25,8 +24,8 @@ echo "... setting permissions" chmod -R 777 /data/photoprism chown -Rf photoprism:photoprism /data/photoprism chmod -Rf a+rwx /data/photoprism -chmod -R 777 "$CONFIG_DIR" -chown -Rf photoprism:photoprism "$CONFIG_DIR" +chmod -R 777 /config/photoprism +chown -Rf photoprism:photoprism /config/photoprism for line in BACKUP_PATH IMPORT_PATH ORIGINALS_PATH STORAGE_PATH; do mkdir -p "$line" chmod -R 777 "$line" diff --git a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh index 49e0d75f3..170ed4261 100644 --- a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh +++ b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh @@ -3,12 +3,27 @@ set -e slug=photoprism +new_config_location="/config/photoprism/config.yaml" +new_config_dir="$(dirname "$new_config_location")" +mkdir -p "$new_config_dir" -if [ -d "/homeassistant/addons_config/$slug" ]; then - echo "Migrating /homeassistant/addons_config/$slug to /addon_configs/xxx-$slug" - cp -rnf /homeassistant/addons_config/"$slug"/. /config/ || true +if bashio::config.has_value "CONFIG_LOCATION"; then + old_config_location="$(bashio::config "CONFIG_LOCATION")" +else + old_config_location="/config/addons_config/photoprism/config.yaml" +fi +old_config_dir="$(dirname "$old_config_location")" + +if [ "$old_config_dir" != "$new_config_dir" ] && [ -d "$old_config_dir" ]; then + echo "Migrating $old_config_dir to /addon_configs/xxx-$slug" + cp -rnf "$old_config_dir"/. "$new_config_dir"/ || true echo "Migrated to internal config folder accessible at /addon_configs/xxx-$slug" \ - > "/homeassistant/addons_config/$slug/.migrate" + > "$old_config_dir/.migrate" +fi + +if [ "$old_config_location" != "$new_config_location" ]; then + bashio::log.info "Updating CONFIG_LOCATION to $new_config_location" + bashio::addon.option "CONFIG_LOCATION" "$new_config_location" fi if [ -d /config/addons_config ]; then From 6e2b5029f055fae74e5446016ed35adaa146b598 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 9 Jan 2026 10:01:14 +0100 Subject: [PATCH 3/4] Fix photoprism config migration path --- photoprism/README.md | 6 +++--- photoprism/config.yaml | 2 +- photoprism/rootfs/etc/cont-init.d/00-folders.sh | 6 +++--- photoprism/rootfs/etc/cont-init.d/01-migrate.sh | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/photoprism/README.md b/photoprism/README.md index d28d3d1f1..0161ccd79 100644 --- a/photoprism/README.md +++ b/photoprism/README.md @@ -84,7 +84,7 @@ Configurations can be done through the app webUI, except for the following optio | `cifspassword` | str | | SMB password for network shares | | `cifsdomain` | str | | SMB domain for network shares | -⚠ **Migration notice**: Configuration files now live under `/addon_configs/xxx-photoprism/photoprism/`. The add-on will attempt to migrate files from the old `/config/addons_config/photoprism/` location automatically, but any hard-coded paths, scripts, or backups pointing at the old location will need to be updated. Make a backup before upgrading in case custom paths or permissions cause the migration to fail. +⚠ **Migration notice**: Configuration files now live under `/addon_configs/xxx-photoprism/`. The add-on will attempt to migrate files from the old `/config/addons_config/photoprism/` location automatically, but any hard-coded paths, scripts, or backups pointing at the old location will need to be updated. Make a backup before upgrading in case custom paths or permissions cause the migration to fail. ### Example Configuration @@ -107,12 +107,12 @@ cifsdomain: "workgroup" ### Advanced Configuration -Additional options can be configured in `/addon_configs/xxx-photoprism/photoprism/config.yaml`. +Additional options can be configured in `/addon_configs/xxx-photoprism/config.yaml`. Complete list: https://github.com/photoprism/photoprism/blob/develop/docker-compose.yml ### External Database Setup -For external database, add to `/addon_configs/xxx-photoprism/photoprism/config.yaml`: +For external database, add to `/addon_configs/xxx-photoprism/config.yaml`: ```yaml PHOTOPRISM_DATABASE_DRIVER: "mysql" diff --git a/photoprism/config.yaml b/photoprism/config.yaml index eadb83343..90313fad1 100644 --- a/photoprism/config.yaml +++ b/photoprism/config.yaml @@ -86,7 +86,7 @@ name: Photoprism options: env_vars: [] BACKUP_PATH: /share/photoprism/backup - CONFIG_LOCATION: /config/photoprism/config.yaml + CONFIG_LOCATION: /config DB_TYPE: sqlite IMPORT_PATH: /share/photoprism/import ORIGINALS_PATH: /share/photoprism/originals diff --git a/photoprism/rootfs/etc/cont-init.d/00-folders.sh b/photoprism/rootfs/etc/cont-init.d/00-folders.sh index 01a5374cc..a5e8b933b 100755 --- a/photoprism/rootfs/etc/cont-init.d/00-folders.sh +++ b/photoprism/rootfs/etc/cont-init.d/00-folders.sh @@ -12,7 +12,7 @@ fi bashio::log.info "Preparing scripts" echo "... creating structure" -mkdir -p /config/photoprism +mkdir -p /config mkdir -p \ /data/photoprism/originals \ /data/photoprism/import \ @@ -24,8 +24,8 @@ echo "... setting permissions" chmod -R 777 /data/photoprism chown -Rf photoprism:photoprism /data/photoprism chmod -Rf a+rwx /data/photoprism -chmod -R 777 /config/photoprism -chown -Rf photoprism:photoprism /config/photoprism +chmod -R 777 /config +chown -Rf photoprism:photoprism /config for line in BACKUP_PATH IMPORT_PATH ORIGINALS_PATH STORAGE_PATH; do mkdir -p "$line" chmod -R 777 "$line" diff --git a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh index 170ed4261..7f3191aee 100644 --- a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh +++ b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh @@ -3,8 +3,8 @@ set -e slug=photoprism -new_config_location="/config/photoprism/config.yaml" -new_config_dir="$(dirname "$new_config_location")" +new_config_location="/config" +new_config_dir="$new_config_location" mkdir -p "$new_config_dir" if bashio::config.has_value "CONFIG_LOCATION"; then From 96cd5e2816ee3af4ff5a700332a4e86674a14fff Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 9 Jan 2026 10:03:51 +0100 Subject: [PATCH 4/4] Update migration script to check CONFIG_LOCATION --- photoprism/rootfs/etc/cont-init.d/01-migrate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh index 7f3191aee..cf1986448 100644 --- a/photoprism/rootfs/etc/cont-init.d/01-migrate.sh +++ b/photoprism/rootfs/etc/cont-init.d/01-migrate.sh @@ -7,7 +7,7 @@ new_config_location="/config" new_config_dir="$new_config_location" mkdir -p "$new_config_dir" -if bashio::config.has_value "CONFIG_LOCATION"; then +if bashio::config.has_value "CONFIG_LOCATION" && [[ "$(bashio::config "CONFIG_LOCATION")" != "/config" ]]; then old_config_location="$(bashio::config "CONFIG_LOCATION")" else old_config_location="/config/addons_config/photoprism/config.yaml"