Compare commits

...

6 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
ed59a7140d fix: guard addon config symlink creation 2026-06-03 06:19:02 +00:00
copilot-swe-agent[bot]
a158621de9 refactor: simplify addon config symlink setup 2026-06-03 06:18:23 +00:00
copilot-swe-agent[bot]
c95c53eb63 fix: harden addon config migration 2026-06-03 06:17:39 +00:00
copilot-swe-agent[bot]
d9b525b464 fix: address filebrowser quantum review feedback 2026-06-03 06:17:00 +00:00
copilot-swe-agent[bot]
b48899b5bf Fix FileBrowser Quantum database migration path to use correct addon_configs directory
The migration code was checking `/homeassistant/addons_config/filebrowser_quantum/`
but the actual HA addon config path is `/homeassistant/addon_configs/db21ed7f_filebrowser_quantum/`.

Changes:
- Add migration check for the correct addon_configs path with slug prefix
- Handle the standard `addon_configs` directory for symlink operations
- Keep legacy `addons_config` path support for backward compatibility

Fixes: Configuration doesn't survive over restarts
2026-06-03 05:19:00 +00:00
copilot-swe-agent[bot]
830c6cebec Initial plan 2026-06-03 05:13:10 +00:00

View File

@@ -7,11 +7,23 @@ set -e
####################
if [ -f /homeassistant/addons_config/filebrowser_quantum/filebrowser_quantum.db ]; then
echo "Moving database to new location /config"
echo "Moving database from legacy addons_config location to /config"
cp -rnf /homeassistant/addons_config/filebrowser_quantum/* /config/
rm -r /homeassistant/addons_config/filebrowser_quantum
fi
if [ ! -f /config/filebrowser_quantum.db ] && [ -d /addon_configs ]; then
shopt -s nullglob
for addon_config_dir in /addon_configs/*_filebrowser_quantum; do
if [ -f "$addon_config_dir/filebrowser_quantum.db" ]; then
echo "Moving database from addon_configs location to /config"
cp -rnf "$addon_config_dir"/. /config/
break
fi
done
shopt -u nullglob
fi
######################
# Link addon folders #
######################
@@ -21,21 +33,30 @@ find /config -maxdepth 1 -type l -delete
if [ -d /homeassistant/addons_config ]; then
find /homeassistant/addons_config -maxdepth 1 -type l -delete
fi
# Remove erroneous folders
if [ -d /homeassistant ]; then
if [ -d /config/addons_config ]; then
rm -r /config/addons_config
fi
if [ -d /config/addon_configs ]; then
rm -r /config/addon_configs
fi
if [ -d /config/addons_autoscripts ]; then
rm -r /config/addons_autoscripts
fi
fi
# Create symlinks with legacy folders
addon_configs_symlink_dir=""
if [ -d /homeassistant/addons_config ]; then
ln -s /homeassistant/addons_config /config
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} /config/addons_config/ \;
addon_configs_symlink_dir="/config/addons_config"
elif [ -d /addon_configs ]; then
mkdir -p /config/addon_configs
addon_configs_symlink_dir="/config/addon_configs"
fi
if [ -n "$addon_configs_symlink_dir" ] && [ -d /addon_configs ]; then
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} "$addon_configs_symlink_dir"/ \;
fi
if [ -d /homeassistant/addons_autoscripts ]; then
ln -s /homeassistant/addons_autoscripts /config