From 06cafd68c416a5dc58675ca46ca639c8e9412794 Mon Sep 17 00:00:00 2001 From: Corgei <87030087+Corgei@users.noreply.github.com> Date: Sat, 5 Sep 2026 03:55:11 +0700 Subject: [PATCH] fix(shlink): preserve servers.json across web-client updates (#17023) CLEAN_INSTALL wipes /opt/shlink-web-client on every `update`, deleting the user's servers.json (and its API key) with no backup, unlike the main /opt/shlink app which already backs up/restores .env and data around its CLEAN_INSTALL. This makes the Web Client lose its configured server(s) on every update. Reuse the existing create_backup/restore_backup helpers around the web-client's CLEAN_INSTALL, mirroring the pattern already used for /opt/shlink. --- ct/shlink.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ct/shlink.sh b/ct/shlink.sh index 30904d6aa..fb76d25ae 100644 --- a/ct/shlink.sh +++ b/ct/shlink.sh @@ -61,7 +61,12 @@ function update_script() { if [[ -d /opt/shlink-web-client ]]; then if check_for_gh_release "shlink-web-client" "shlinkio/shlink-web-client"; then + create_backup /opt/shlink-web-client/servers.json + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "shlink-web-client" "shlinkio/shlink-web-client" "prebuild" "latest" "/opt/shlink-web-client" "shlink-web-client_*_dist.zip" + + restore_backup + msg_ok "Updated Web Client" fi fi