From 2a3b15b4b21d69d83a01a138b87fb3578ee84210 Mon Sep 17 00:00:00 2001 From: sudolulo Date: Mon, 15 Jun 2026 15:58:29 +0000 Subject: [PATCH] Fix two findings from full codebase audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - apply.sh: correct comment from 'one prior generation' to 'two prior generations (.1 and .2)' — rotation has always kept three log files - uninstall.sh: add sync comment on find paths to match WEBUI_CANDIDATES in patch/patch_ui.py, preventing silent drift if a new path is added --- patch/apply.sh | 2 +- uninstall.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/patch/apply.sh b/patch/apply.sh index d63287e..8240c19 100755 --- a/patch/apply.sh +++ b/patch/apply.sh @@ -22,7 +22,7 @@ PATCH_DIR="/data/truecloud-patch" LOG="$PATCH_DIR/apply.log" # Rotate log at 512 KB to avoid unbounded growth on a system volume. -# Keep one prior generation (.1) so the last two boots are always available. +# Keep two prior generations (.1 and .2) so the last three boots are always available. if [ -f "$LOG" ] && [ "$(wc -c < "$LOG")" -gt 524288 ]; then [ -f "${LOG}.1" ] && mv "${LOG}.1" "${LOG}.2" mv "$LOG" "${LOG}.1" diff --git a/uninstall.sh b/uninstall.sh index b7a0426..c7103b0 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -107,6 +107,7 @@ while IFS= read -r backup; do mv "$backup" "$original" echo " Restored: $original" RESTORED=1 +# Keep these paths in sync with WEBUI_CANDIDATES in patch/patch_ui.py done < <(find /usr/share/truenas /usr/share/truenas-ui /var/www/truenas \ -name "*.js.pre-truecloud-patch" 2>/dev/null)