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.
This commit is contained in:
Corgei
2026-09-05 03:55:11 +07:00
committed by GitHub
parent 455039d11f
commit 06cafd68c4

View File

@@ -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