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
+2 -1
View File
@@ -219,7 +219,8 @@ install_cloudpanel() {
echo -e "${YELLOW}CloudPanel is already installed!${NC}"
return 0
fi
require_disk_space 2048 || return 1
check_requirements || return 1
echo ""
+2 -1
View File
@@ -66,7 +66,8 @@ install_coolify() {
echo -e "${YELLOW}Coolify is already installed!${NC}"
return 0
fi
require_disk_space 3072 || return 1
check_requirements || return 1
echo ""
+6 -4
View File
@@ -242,16 +242,18 @@ clear_cache() {
update_proxmox() {
echo -e "${WHITE}${BOLD}UPDATE PROXMOX VE${NC}\n"
check_proxmox || return 1
require_disk_space 1024 || return 1
# Configure non-interactive mode
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
export NEEDRESTART_SUSPEND=1
local start_time=$(date +%s)
run_spinner "Updating package lists..." "apt update"
echo ""
+3 -1
View File
@@ -211,7 +211,9 @@ install_pterodactyl() {
echo -e "${YELLOW}Pterodactyl is already installed!${NC}"
return 0
fi
require_disk_space 3072 || return 1
echo "[1/10] Installing dependencies..."
install_dependencies && install_composer
echo ""
+3 -1
View File
@@ -93,7 +93,9 @@ install_uptime_kuma() {
echo -e "${YELLOW}Uptime Kuma is already installed!${NC}"
return 0
fi
require_disk_space 1024 || return 1
echo "[1/4] Installing dependencies..."
install_dependencies
echo ""