Use temp dir for Web-Vault deployment

Deploy the Web-Vault release into a temporary directory before moving it into /opt/vaultwarden. The change creates a mktemp -d directory, passes that to fetch_and_deploy_gh_release, moves the extracted web-vault into /opt/vaultwarden/web-vault, and removes the temp dir. This prevents partial or mixed artifacts in /opt during the fetch/extract step and keeps the existing ownership/chown behavior.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-02 17:03:02 +01:00
parent abfd57f486
commit d7872a8240

View File

@@ -75,7 +75,10 @@ function update_script() {
msg_info "Updating Web-Vault to $WVRELEASE"
rm -rf /opt/vaultwarden/web-vault
fetch_and_deploy_gh_release "vaultwarden_webvault" "dani-garcia/bw_web_builds" "prebuild" "latest" "/opt/vaultwarden" "bw_web_*.tar.gz"
TEMP_DIR=$(mktemp -d)
fetch_and_deploy_gh_release "vaultwarden_webvault" "dani-garcia/bw_web_builds" "prebuild" "latest" "$TEMP_DIR" "bw_web_*.tar.gz"
mv "$TEMP_DIR/web-vault" /opt/vaultwarden/web-vault
rm -rf "$TEMP_DIR"
chown -R root:root /opt/vaultwarden/web-vault/
msg_ok "Updated Web-Vault to ${WVRELEASE}"