Repository navigation
Conversation
added 2 commits
November 4, 2026 23:42
fetch_and_deploy_gh_branch removed the target before cloning, so a failed clone left nothing. It now clones beside the target and replaces it only once the clone has worked, through _cs_clean_target_dir, which also brings mount points and CLEAN_INSTALL_KEEP to this path. lib/alpine.func ran the prebuild wipe after unchecked unzip and tar calls, so a broken archive still emptied the target, and the wipe itself missed dotfiles, took the contents of mounts and ignored CLEAN_INSTALL_KEEP. A tarball with no top-level directory also ran `cd ""` and copied the current directory into the target. Extracts are now checked, an empty payload is an error, and the wipe is the same _cs_clean_target_dir as lib/forge.func.
_cs_clean_target_dir pruned a mount point from its list, but the list still held the mount's parents, and rm -rf on a parent emptied the mount. A bind mount at data/uploads lost its contents on a clean install. Files now go first with rm -f, whose failures still stop the script, then directories deepest first with rmdir, which leaves a parent that still holds a mount.
Contributor
Try this branchThe engine and the scripts resolve independently, so a production script can COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/rcourtman/core/fix/git-alpine-clean-install \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"Swap Run a script from a fork as wellcurl -fsSL https://raw.githubusercontent.com/rcourtman/core/fix/git-alpine-clean-install/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
https://raw.githubusercontent.com/rcourtman/core/fix/git-alpine-clean-installNote that Useful flags while testing
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
The follow-up suggested in #201, for the two spots still wiping too early or too widely.
Git clone path.
fetch_and_deploy_gh_branchranrm -rf "$target"before cloning, so a failed clone left nothing. It now clones beside the target and replaces it through_cs_clean_target_dironce the clone has worked. That also brings mount points andCLEAN_INSTALL_KEEPto this path. The target still ends up with the clone's owner and mode, as it did with a direct clone.lib/alpine.func.unzipandtarwere unchecked, so a broken archive still emptied the target.cd ""and copied the current directory into the target.CLEAN_INSTALL_KEEP.Extracts are now checked, an empty payload is an error, and the wipe is a copy of
_cs_clean_target_dir, so the parity check will flag future edits. It stays in bash because busybox ash already can't parse this file (the array at line 76)._cs_clean_target_diritself (second commit, in both copies). It only protected a mount directly listed byfind. With a mount atdata/uploads,rm -rf datastill emptied it. Files now go withrm -f, then directories deepest first withrmdir. A file that can't be removed still stops the script underset -e, as before.Tested on Proxmox VE 9.2 in real containers, with real tmpfs mounts and under
set -eEo pipefail:mainThe two new test files pass on Ubuntu and on Alpine with busybox
find,tar,sortandxargs. Their failure cases fail onmain. All 40 scripts in the test list pass, with no ShellCheck errors and no new warnings. Not tested on Incus (no Incus host here).Not changed: the update path's
git clean -fdalso empties an untracked mount inside a checkout, then fails on it. That isn't a clean install, so I left it out.This and #201 add to the same test list, so whichever merges second will need both sides kept.
Written and tested with Claude Opus 5.5 (reasoning: high).
🔗 Related Issue
Related: #201
✅ Prerequisites (X in brackets)
API.txtwas updated to match.🛠️ Type of Change (X in brackets)
README,docs/,CONTRIBUTING.md, or other docs.🤖 AI Assistance (X in brackets)