Compare commits

...

6 Commits

Author SHA1 Message Date
MickLesk d20c06ce0e change comments for new variant
Update `_deploy_source_tarball` and related helper comments to note that CLEAN_INSTALL wipes target contents including dotfiles while preserving mount points. This improves guidance around backup/restore of config dotfiles during source deployments.
2026-08-15 23:26:30 +02:00
MickLesk c0ce8b3a11 Skip mount points during backup and clean install
Prevent accidental deletion or backup of mount points:
- In create_backup(), skip paths that are mount points with a warning
- In _deploy_source_tarball(), _deploy_unpacked_archive(), and fetch_and_deploy_from_url(), use find with mountpoint pruning to avoid deleting mount point directories during CLEAN_INSTALL
2026-08-15 23:22:59 +02:00
community-scripts-pr-app[bot] 91fd6e57a6 Update CHANGELOG.md (#16516)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 03:37:21 +00:00
community-scripts-pr-app[bot] 3aa4538765 Update CHANGELOG.md (#16515)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 03:36:54 +00:00
CanbiZ (MickLesk) a566b6b129 adventurelog: remove pnpm build-allowlist override causing pnpm 10.33 conflict (#16478) 2026-08-15 13:36:49 +10:00
CanbiZ (MickLesk) 91dd24f38c PatchMon: add ssg-content (#16481)
* patchmon: fetch SCAP Security Guide content, bump disk default

* patchmon: simplify SCAP content fetch with &&/|| chaining

* patchmon: use fetch_and_deploy_gh_release for SCAP content

* Reintroduce fetch_and_deploy_gh_release for ssg-content
2026-08-15 13:36:27 +10:00
6 changed files with 30 additions and 12 deletions
+12
View File
@@ -521,6 +521,18 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-08-15
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- AdventureLog: remove pnpm build-allowlist override causing pnpm 10.33 conflict [@MickLesk](https://github.com/MickLesk) ([#16478](https://github.com/community-scripts/ProxmoxVE/pull/16478))
- #### ✨ New Features
- PatchMon: add ssg-content [@MickLesk](https://github.com/MickLesk) ([#16481](https://github.com/community-scripts/ProxmoxVE/pull/16481))
## 2026-08-14
### 🆕 New Scripts
-1
View File
@@ -60,7 +60,6 @@ function update_script() {
$STD .venv/bin/python -m manage migrate
cd /opt/adventurelog/frontend
grep -q "^dangerouslyAllowAllBuilds:" ./pnpm-workspace.yaml 2>/dev/null || echo "dangerouslyAllowAllBuilds: true" >>./pnpm-workspace.yaml
$STD pnpm i
$STD pnpm build
msg_ok "Updated AdventureLog"
+2 -1
View File
@@ -9,7 +9,7 @@ APP="PatchMon"
var_tags="${var_tags:-monitoring}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-4}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
@@ -76,6 +76,7 @@ EOF
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "PatchMon" "PatchMon/PatchMon" "singlefile" "latest" "/opt/patchmon" "patchmon-server-linux-$(arch_resolve)"
mv /opt/patchmon/PatchMon /opt/patchmon/patchmon-server
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz"
restore_backup
-1
View File
@@ -72,7 +72,6 @@ BODY_SIZE_LIMIT=Infinity
ORIGIN='http://$LOCAL_IP:3000'
EOF
cd /opt/adventurelog/frontend
grep -q "^dangerouslyAllowAllBuilds:" ./pnpm-workspace.yaml 2>/dev/null || echo "dangerouslyAllowAllBuilds: true" >>./pnpm-workspace.yaml
$STD pnpm i
$STD pnpm build
msg_ok "Installed AdventureLog"
+3
View File
@@ -60,6 +60,7 @@ REDIS_PORT=6379
# OIDC_ENFORCE_HTTPS=true
AGENT_BINARIES_DIR=/opt/patchmon/agents
SSG_CONTENT_DIR=/opt/patchmon/ssg-content
EOF
msg_ok "Configured PatchMon"
@@ -85,6 +86,8 @@ for arch in "${AGENT_NAME[@]}"; do
done
msg_ok "Fetched PatchMon agent binaries"
fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz"
msg_info "Creating service"
cat <<EOF >/etc/systemd/system/patchmon-server.service
[Unit]
+13 -9
View File
@@ -1336,6 +1336,10 @@ create_backup() {
msg_warn "Skipping backup of '${path}' (not found)"
continue
fi
if mountpoint -q "$path" 2>/dev/null; then
msg_warn "Skipping backup of '${path}' (is a mount point)"
continue
fi
dest="${store}/files${path}"
if ! mkdir -p "$(dirname "$dest")" || ! cp -a "$path" "$dest"; then
msg_error "Backup of '${path}' failed - aborting update"
@@ -2524,9 +2528,9 @@ _download_source_tarball() {
# directory). Extracts <tarball_path> into <workdir>, then copies the contents
# of that top-level directory into <target>.
#
# - Honors CLEAN_INSTALL=1 (wipes <target> first, dotfiles included — back
# up config dotfiles like .env via create_backup and call restore_backup
# BEFORE any build step that sources them).
# - Honors CLEAN_INSTALL=1 (wipes <target> first, dotfiles included, mount
# points preserved — back up config dotfiles like .env via create_backup
# and call restore_backup BEFORE any build step that sources them).
# - Does NOT own <workdir>: the caller creates it and is responsible for its
# cleanup (typically via a RETURN trap on its tmpdir).
# - cp failures are non-fatal here, matching the previous inline behavior.
@@ -2538,7 +2542,7 @@ _deploy_source_tarball() {
mkdir -p "$target"
if [[ "${CLEAN_INSTALL:-0}" == "1" ]]; then
find "${target:?}" -mindepth 1 -delete
find "${target:?}" -mindepth 1 \( -type d -exec mountpoint -q {} \; -prune \) -o -delete
fi
tar --no-same-owner -xzf "$tarball" -C "$workdir" || {
@@ -2564,9 +2568,9 @@ _deploy_source_tarball() {
# a single top-level directory, that directory is stripped (its contents land
# directly in <target>); otherwise the archive contents are copied as-is.
#
# - Honors CLEAN_INSTALL=1 (wipes <target> first, dotfiles included — back
# up config dotfiles like .env via create_backup and call restore_backup
# BEFORE any build step that sources them).
# - Honors CLEAN_INSTALL=1 (wipes <target> first, dotfiles included, mount
# points preserved — back up config dotfiles like .env via create_backup
# and call restore_backup BEFORE any build step that sources them).
# - Does NOT own <workdir>: the caller creates it and cleans it up.
#
# Returns: 0 on success, 65 on unsupported format, 251 on extraction failure,
@@ -2627,7 +2631,7 @@ _deploy_unpacked_archive() {
# was truncated, the archive was unreadable, or it unpacked to nothing.
mkdir -p "$target"
if [[ "${CLEAN_INSTALL:-0}" == "1" ]]; then
find "${target:?}" -mindepth 1 -delete
find "${target:?}" -mindepth 1 \( -type d -exec mountpoint -q {} \; -prune \) -o -delete
fi
if ! cp -r "$source_dir"/* "$target/"; then
@@ -9368,7 +9372,7 @@ fetch_and_deploy_from_url() {
mkdir -p "$directory"
if [[ "${CLEAN_INSTALL:-0}" == "1" ]]; then
find "${directory:?}" -mindepth 1 -delete
find "${directory:?}" -mindepth 1 \( -type d -exec mountpoint -q {} \; -prune \) -o -delete
fi
local unpack_tmp