Compare commits

..

3 Commits

Author SHA1 Message Date
alexbelgium
657553996f fix(baikal): don't abort startup on fresh installs without baikal.yaml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:47:59 +02:00
alexbelgium
c5eeea20be docs(baikal): recommend a backup before the automatic upgrade
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:40:19 +02:00
alexbelgium
7c22f0764f fix(baikal): run the database upgrade at startup so DAV clients don't loop on redirects (#3148)
Baikal 0.13.0 redirects every request to its upgrade wizard until the
configured version matches the shipped one; DAV clients follow that
relative redirect into a loop. Trigger the wizard locally once nginx is up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:39:04 +02:00
3 changed files with 21 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
## 0.13.0.1 (24-10-2026)
- Fix DAV clients failing with "Too many redirects" after the update to 0.13.0 (#3148) : the add-on now runs the Baikal database upgrade itself at startup, instead of waiting for it to be confirmed in the web admin. As upstream recommends for 0.13.0, keep a backup of the add-on before updating
## 0.13.0 (2026-10-24)
- Update to latest version from sabre-io/Baikal (changelog : https://github.com/sabre-io/Baikal/releases)
- Migrate legacy add-on configuration map names to current app configuration terminology.

View File

@@ -84,5 +84,5 @@ schema:
slug: baikal
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "0.13.0"
version: "0.13.0.1"
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"

View File

@@ -20,6 +20,23 @@ done
# Fix permissions
chown -R nginx:nginx /data
# After a version update Baikal redirects every request to its upgrade wizard
# until the database is upgraded, and DAV clients loop on that redirect (#3148).
# Run the wizard once nginx answers, as confirming it in the web admin would
configured="$(sed -n "s/^ *configured_version: *['\"]\?\([^'\"]*\).*/\1/p" /data/config/baikal.yaml 2>/dev/null || true)"
shipped="$(sed -n 's/^define("BAIKAL_VERSION", "\(.*\)");/\1/p' /data/Core/Distrib.php)"
if [ -n "$configured" ] && [ "$configured" != "$shipped" ]; then
echo "Upgrading the Baikal database from $configured to $shipped"
(
until curl -s -o /dev/null http://127.0.0.1/; do sleep 1; done
if curl -s "http://127.0.0.1/admin/install/?upgradeConfirmed=1" | grep -q "successfully upgraded"; then
echo "Baikal database upgraded to $shipped"
else
echo "Baikal upgrade failed : open the web admin to see the error"
fi
) &
fi
# Start app
# Find the PHP FPM service script and start it
find /etc/init.d -type f -name "php*-fpm" -exec {} start \; \