Compare commits

..

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 3b2b0c6440 fix(passwordpusher): dynamically read Ruby version in CT update_script too 2026-08-03 19:24:04 +00:00
copilot-swe-agent[bot] 12d40e309f fix(passwordpusher): dynamically read Ruby version from .ruby-version file 2026-08-03 19:20:51 +00:00
copilot-swe-agent[bot] dce2ebd712 Initial plan 2026-08-03 19:18:49 +00:00
6 changed files with 21 additions and 20 deletions
-1
View File
@@ -524,7 +524,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 🐞 Bug Fixes
- Correction to link in Paperless-NGX update script [@jsspen](https://github.com/jsspen) ([#16241](https://github.com/community-scripts/ProxmoxVE/pull/16241))
- fix restore env in split pro [@johanngrobe](https://github.com/johanngrobe) ([#16228](https://github.com/community-scripts/ProxmoxVE/pull/16228))
### 💾 Core
+1 -1
View File
@@ -42,7 +42,7 @@ function update_script() {
echo -e ""
msg_custom "🔄" "Migration required to new data structure (/opt/paperless_data/)"
msg_custom "📖" "Please follow the migration guide:"
echo -e "${GATEWAY}${BGN}https://github.com/community-scripts/ProxmoxVE/pull/9223${CL}"
echo -e "${GATEWAY}${BGN}https://github.com/community-scripts/ProxmoxVE/discussions/9223${CL}"
echo -e ""
msg_custom "⚠️" "Update aborted. Please migrate your data first."
exit 253
+1
View File
@@ -38,6 +38,7 @@ function update_script() {
create_backup /opt/passwordpusher/storage /opt/passwordpusher/.env.production
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "passwordpusher" "pglombardo/PasswordPusher" "tarball"
RUBY_VERSION="$(cat /opt/passwordpusher/.ruby-version)" RUBY_INSTALL_RAILS="false" setup_ruby
msg_info "Installing Gem Dependencies"
cd /opt/passwordpusher
+1 -1
View File
@@ -143,7 +143,7 @@ EOF
fi
msg_ok "Migrated Configuration"
create_backup /opt/termix/data /opt/termix/uploads /opt/termix/.env
create_backup /opt/termix/data /opt/termix/uploads
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "termix" "Termix-SSH/Termix" "tarball"
+3 -2
View File
@@ -22,12 +22,13 @@ $STD apt install -y \
pkg-config
msg_ok "Installed Dependencies"
RUBY_VERSION="4.0.5" RUBY_INSTALL_RAILS="false" setup_ruby
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
fetch_and_deploy_gh_release "passwordpusher" "pglombardo/PasswordPusher" "tarball"
RUBY_VERSION="$(cat /opt/passwordpusher/.ruby-version)" RUBY_INSTALL_RAILS="false" setup_ruby
export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
msg_info "Installing Gem Dependencies"
cd /opt/passwordpusher
$STD bundle config set --local without 'development test'
+15 -15
View File
@@ -1292,17 +1292,14 @@ create_temp_dir() {
# - Copies each given file/directory into a persistent store at
# /opt/<NSAPP>.backup, mirroring its absolute path inside the store, and
# records it in a manifest so restore_backup needs no arguments.
# - Idempotent per path: a path already recorded in the manifest (from this
# run or a previous failed one) is left untouched, keeping the
# last-known-good copy instead of overwriting it with now-partially-updated
# data on retry. Any requested path NOT yet in the manifest is backed up
# now and appended - so a manifest left incomplete by an interrupted prior
# run gets completed instead of silently missing paths on restore.
# - Idempotent: if a store from a previous (failed) run already exists, it is
# left untouched and no new backup is taken. This keeps the last-known-good
# data instead of overwriting it with now-partially-updated data on retry.
# - Missing source paths are skipped with a warning (not fatal).
# - Aborts the update on copy failure: if any file/dir cannot be backed up,
# the script exits before the update runs against unprotected data (the
# paths already recorded are left in place, so a retry only redoes the one
# that failed).
# the half-written store is removed and the script exits, so the update
# never runs against unprotected data (and a retry re-attempts a clean
# backup rather than skipping it).
#
# restore_backup
# - Copies every path recorded in the manifest back to its origin (replacing
@@ -1321,17 +1318,19 @@ create_backup() {
return 0
}
if ! mkdir -p "$store" || ! touch "$manifest"; then
msg_error "Backup failed: could not create store at ${store} - aborting update"
exit 1
if [[ -f "$manifest" ]]; then
msg_ok "Existing backup found at ${store}, skipping backup"
return 0
fi
msg_info "Backing up data"
if ! mkdir -p "$store" || ! : >"$manifest"; then
msg_error "Backup failed: could not create store at ${store} - aborting update"
rm -rf "$store"
exit 1
fi
for path in "$@"; do
path="${path%/}"
if grep -qxF "$path" "$manifest" 2>/dev/null; then
continue
fi
if [[ ! -e "$path" ]]; then
msg_warn "Skipping backup of '${path}' (not found)"
continue
@@ -1339,6 +1338,7 @@ create_backup() {
dest="${store}/files${path}"
if ! mkdir -p "$(dirname "$dest")" || ! cp -a "$path" "$dest"; then
msg_error "Backup of '${path}' failed - aborting update"
rm -rf "$store"
exit 1
fi
echo "$path" >>"$manifest"