From ce71f1a9b6016023d823cada1ca09663687df411 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 22:59:18 +0000 Subject: [PATCH 2/5] Fix Seafile download URLs: re-apply URL config after upstream init scripts The upstream Docker image's write_config.sh hardcodes FILE_SERVER_ROOT = "http:///seafhttp" in seahub_settings.py, overwriting the addon's configured value on first run. This causes download URLs to contain an incorrect /seafhttp prefix and miss the file server port. Fix by creating a helper script (apply_addon_urls.sh) that re-applies the addon's FILE_SERVER_ROOT and SERVICE_URL right before Seafile services start, after all upstream init/setup/update scripts complete. Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- seafile/rootfs/etc/cont-init.d/99-run.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/seafile/rootfs/etc/cont-init.d/99-run.sh b/seafile/rootfs/etc/cont-init.d/99-run.sh index c7985af08..d0e08cc72 100755 --- a/seafile/rootfs/etc/cont-init.d/99-run.sh +++ b/seafile/rootfs/etc/cont-init.d/99-run.sh @@ -155,6 +155,27 @@ done bashio::log.info "SERVICE_URL set to ${SERVICE_URL_VALUE}" bashio::log.info "FILE_SERVER_ROOT set to ${FILE_SERVER_ROOT_VALUE}" +# The upstream write_config.sh hardcodes /seafhttp in FILE_SERVER_ROOT and +# overwrites our settings on first run. Create a helper that re-applies the +# addon's URL configuration right before Seafile services start, so it always +# takes effect regardless of what the upstream init/setup scripts wrote. +cat > /home/seafile/apply_addon_urls.sh << URLEOF +#!/bin/bash +for _CONF in "${DATA_LOCATION}/conf/seahub_settings.py" "${DATA_LOCATION}/seafile/conf/seahub_settings.py"; do + if [ -f "\$_CONF" ]; then + sed -i '/^SERVICE_URL *=/d' "\$_CONF" + sed -i '/^FILE_SERVER_ROOT *=/d' "\$_CONF" + echo 'SERVICE_URL = "${SERVICE_URL_VALUE}"' >> "\$_CONF" + echo 'FILE_SERVER_ROOT = "${FILE_SERVER_ROOT_VALUE}"' >> "\$_CONF" + fi +done +URLEOF +chmod +x /home/seafile/apply_addon_urls.sh +sed -i '/print "Launching seafile"/i /home/seafile/apply_addon_urls.sh' /home/seafile/launch.sh +if ! grep -q 'apply_addon_urls.sh' /home/seafile/launch.sh 2>/dev/null; then + bashio::log.warning "Could not inject URL configuration into launch.sh; URLs may use upstream defaults" +fi + ################### # Define database # ################### From bc4f9528fe3cfb633513cac50e4ab8fa6ef11d32 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 23:13:23 +0000 Subject: [PATCH 3/5] Bump Seafile version to 12.0.19 and update changelog Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- seafile/CHANGELOG.md | 3 +++ seafile/config.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/seafile/CHANGELOG.md b/seafile/CHANGELOG.md index ed83def92..e37a66a7b 100644 --- a/seafile/CHANGELOG.md +++ b/seafile/CHANGELOG.md @@ -1,4 +1,7 @@ +## 12.0.19 (2026-02-22) +- Fix download URLs containing incorrect `/seafhttp` prefix on first run by re-applying URL configuration after upstream init scripts complete. + ## 12.0.18 (2026-03-20) - Fix `env_vars` handling so extra environment variables are exported correctly. diff --git a/seafile/config.yaml b/seafile/config.yaml index 87bd0b172..b0d23a4d6 100644 --- a/seafile/config.yaml +++ b/seafile/config.yaml @@ -128,5 +128,5 @@ services: slug: seafile udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/seafile -version: "12.0.18" +version: "12.0.19" webui: http://[HOST]:[PORT:8000] From 8efc883ab2d7ad89a724c7a902670dfc32892fb0 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 23 Feb 2026 00:14:22 +0100 Subject: [PATCH 4/5] Update version from 12.0.19 to 12.0.18-2 --- seafile/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seafile/CHANGELOG.md b/seafile/CHANGELOG.md index e37a66a7b..7b21add42 100644 --- a/seafile/CHANGELOG.md +++ b/seafile/CHANGELOG.md @@ -1,5 +1,5 @@ -## 12.0.19 (2026-02-22) +## 12.0.18-2 (2026-02-22) - Fix download URLs containing incorrect `/seafhttp` prefix on first run by re-applying URL configuration after upstream init scripts complete. ## 12.0.18 (2026-03-20) From 9dd66d097722ba618b38fd0cdcd91a838f3c6869 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 23 Feb 2026 00:15:05 +0100 Subject: [PATCH 5/5] Downgrade Seafile version from 12.0.19 to 12.0.18-2 --- seafile/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seafile/config.yaml b/seafile/config.yaml index b0d23a4d6..4cca056bb 100644 --- a/seafile/config.yaml +++ b/seafile/config.yaml @@ -128,5 +128,5 @@ services: slug: seafile udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/seafile -version: "12.0.19" +version: "12.0.18-2" webui: http://[HOST]:[PORT:8000]