feat(lib): add require_disk_space helper and enforce pre-flight disk checks

- add `require_disk_space` function to lib/common.sh with dedup logic for shared filesystems
- gate cloudpanel, coolify, pterodactyl installs behind a 2–3 GB disk check
- gate uptime-kuma, proxmox update, harden, update-server, and server-benchmark behind 300–1024 MB disk checks
- fail early with a clear error before apt installs or config writes can leave the system in a partial state
This commit is contained in:
2026-05-12 22:39:19 -04:00
parent 173b3bd581
commit 15c42e1f24
9 changed files with 58 additions and 9 deletions
+1
View File
@@ -56,6 +56,7 @@ done
# ═══════════════════════════════════════════════════════════════════════════
require_debian_ubuntu || exit 1
require_disk_space 500 || exit 1
# Read the effective Port from sshd_config + any drop-in under sshd_config.d/
sshd_effective_port() {
+3 -1
View File
@@ -38,7 +38,9 @@ install_dependencies() {
if ! command -v sysbench &> /dev/null; then
echo -e "${YELLOW}[!] sysbench not found, installing...${NC}"
echo ""
require_disk_space 300 || return 1
if command -v apt-get &> /dev/null; then
run_spinner "Updating package list..." "apt-get update -qq"
run_spinner "Installing sysbench..." "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq sysbench"
+2
View File
@@ -62,6 +62,8 @@ if ! command -v apt-get >/dev/null 2>&1; then
exit 1
fi
require_disk_space 1024 || exit 1
UPGRADE_CMD="upgrade"
UPGRADE_LABEL="Upgrade installed packages"
if [ $DO_FULL_UPGRADE -eq 1 ]; then