mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-10-25 16:30:11 +01:00
fix(baikal): run the database upgrade at startup so DAV clients don't loop on redirects (#3149)
* 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> * docs(baikal): recommend a backup before the automatic upgrade Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(baikal): don't abort startup on fresh installs without baikal.yaml Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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]"
|
||||
|
||||
@@ -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 \; \
|
||||
|
||||
Reference in New Issue
Block a user