Adjust photoprism migration marker

This commit is contained in:
Alexandre
2026-01-09 09:47:05 +01:00
parent 2dd05df4c9
commit 31417d0297
5 changed files with 30 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ fi
bashio::log.info "Preparing scripts"
echo "... creating structure"
CONFIG_DIR="$(dirname "$(bashio::config "CONFIG_LOCATION")")"
mkdir -p "$CONFIG_DIR"
mkdir -p \
/data/photoprism/originals \
/data/photoprism/import \
@@ -23,6 +25,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"
for line in BACKUP_PATH IMPORT_PATH ORIGINALS_PATH STORAGE_PATH; do
mkdir -p "$line"
chmod -R 777 "$line"

View File

@@ -0,0 +1,16 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
slug=photoprism
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
echo "Migrated to internal config folder accessible at /addon_configs/xxx-$slug" \
> "/homeassistant/addons_config/$slug/.migrate"
fi
if [ -d /config/addons_config ]; then
rm -rf /config/addons_config
fi