Fix two findings from full codebase audit
- 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
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ PATCH_DIR="/data/truecloud-patch"
|
|||||||
LOG="$PATCH_DIR/apply.log"
|
LOG="$PATCH_DIR/apply.log"
|
||||||
|
|
||||||
# Rotate log at 512 KB to avoid unbounded growth on a system volume.
|
# 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
|
if [ -f "$LOG" ] && [ "$(wc -c < "$LOG")" -gt 524288 ]; then
|
||||||
[ -f "${LOG}.1" ] && mv "${LOG}.1" "${LOG}.2"
|
[ -f "${LOG}.1" ] && mv "${LOG}.1" "${LOG}.2"
|
||||||
mv "$LOG" "${LOG}.1"
|
mv "$LOG" "${LOG}.1"
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ while IFS= read -r backup; do
|
|||||||
mv "$backup" "$original"
|
mv "$backup" "$original"
|
||||||
echo " Restored: $original"
|
echo " Restored: $original"
|
||||||
RESTORED=1
|
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 \
|
done < <(find /usr/share/truenas /usr/share/truenas-ui /var/www/truenas \
|
||||||
-name "*.js.pre-truecloud-patch" 2>/dev/null)
|
-name "*.js.pre-truecloud-patch" 2>/dev/null)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user