Add better update handling (#12611)

This commit is contained in:
Slaviša Arežina
2026-03-06 14:04:23 +01:00
committed by GitHub
parent 4f70196444
commit 14e13edeef

View File

@@ -33,17 +33,23 @@ function update_script() {
systemctl stop cryptpad
msg_info "Stopped Service"
msg_info "Backing up configuration"
msg_info "Creating backup"
[ -f /opt/cryptpad/config/config.js ] && mv /opt/cryptpad/config/config.js /opt/
msg_ok "Backed up configuration"
for dir in blob block customize data datastore www/common/onlyoffice/dist onlyoffice-conf; do
[ -d "/opt/cryptpad/${dir}" ] && mv "/opt/cryptpad/${dir}" "/tmp/cryptpad_${dir//\//_}"
done
msg_ok "Created backup"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cryptpad" "cryptpad/cryptpad" "tarball"
msg_info "Restoring configuration"
msg_info "Restoring backup"
mv /opt/config.js /opt/cryptpad/config/
msg_ok "Configuration restored"
for dir in blob block customize data datastore www/common/onlyoffice/dist onlyoffice-conf; do
[ -d "/tmp/cryptpad_${dir//\//_}" ] && mv "/tmp/cryptpad_${dir//\//_}" "/opt/cryptpad/${dir}"
done
msg_ok "Restored backup"
msg_info "Updating CryptaPad"
msg_info "Updating CryptPad"
cd /opt/cryptpad
$STD npm ci
$STD npm run install:components