Compare commits

..

1 Commits

Author SHA1 Message Date
315c5bb82f [Core] Auto-cleanup after all update_script executions
Implements central solution for automatic cleanup after updates:
- Modified start() function in build.func to call cleanup_lxc after update_script
- Applies to ALL scripts automatically (no individual script changes needed)
- Prevents disk space growth from accumulated caches (yarn/npm/pnpm/composer/pip/etc)
- Aligns update behavior with install behavior (which already calls cleanup_lxc)

This fixes issue #10117 (Jotty disk space growth) and prevents similar issues
in all other scripts that use package managers.

Benefits:
- Single point of maintenance
- Consistent behavior across all update scripts
- Reduces disk usage after every update
- No need to manually add cleanup_lxc to 100+ update_script functions

Impact: All LXC update operations will now automatically clean caches after
successful completion, just like installations do.
2025-12-19 13:31:59 +01:00
6 changed files with 18 additions and 30 deletions

View File

@ -12,16 +12,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2025-12-19 ## 2025-12-19
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- InfluxDB: Fix update function [@Liganic](https://github.com/Liganic) ([#10151](https://github.com/community-scripts/ProxmoxVE/pull/10151))
- #### 🔧 Refactor
- Refactor: Proxmox-Mail-Gateway [@tremor021](https://github.com/tremor021) ([#10070](https://github.com/community-scripts/ProxmoxVE/pull/10070))
### ❔ Uncategorized ### ❔ Uncategorized
- Update paymenter.json(#10133) [@DragoQC](https://github.com/DragoQC) ([#10134](https://github.com/community-scripts/ProxmoxVE/pull/10134)) - Update paymenter.json(#10133) [@DragoQC](https://github.com/DragoQC) ([#10134](https://github.com/community-scripts/ProxmoxVE/pull/10134))

View File

@ -23,7 +23,7 @@ function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /usr/bin/influxd ]]; then if [[ ! -f /etc/apt/sources.list.d/influxdata.list ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi

View File

@ -27,11 +27,10 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_info "Updating ${APP}"
msg_info "Updating Proxmox-Mail-Gateway"
$STD apt update $STD apt update
$STD apt upgrade -y $STD apt -y upgrade
msg_ok "Updated Proxmox-Mail-Gateway" msg_ok "Updated ${APP}"
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
exit exit
} }

View File

@ -14,13 +14,16 @@ network_check
update_os update_os
msg_info "Installing Proxmox Mail Gateway" msg_info "Installing Proxmox Mail Gateway"
setup_deb822_repo \ curl -fsSL "https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg" -o "/usr/share/keyrings/proxmox-release-trixie.gpg"
"pmg" \ cat <<EOF >/etc/apt/sources.list.d/pmg.sources
"https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg" \ Types: deb
"http://download.proxmox.com/debian/pmg" \ URIs: http://download.proxmox.com/debian/pmg
"trixie" \ Suites: trixie
"pmg-no-subscription" Components: pmg-no-subscription
$STD apt install -y proxmox-mailgateway-container Signed-By: /usr/share/keyrings/proxmox-release-trixie.gpg
EOF
$STD apt update
$STD apt -y install proxmox-mailgateway-container
msg_ok "Installed Proxmox Mail Gateway" msg_ok "Installed Proxmox Mail Gateway"
motd_ssh motd_ssh

View File

@ -2626,8 +2626,8 @@ configure_ssh_settings() {
# #
# - Entry point of script # - Entry point of script
# - On Proxmox host: calls install_script # - On Proxmox host: calls install_script
# - In silent mode: runs update_script # - In silent mode: runs update_script with automatic cleanup
# - Otherwise: shows update/setting menu # - Otherwise: shows update/setting menu and runs update_script with cleanup
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
start() { start() {
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
@ -2638,6 +2638,7 @@ start() {
VERBOSE="no" VERBOSE="no"
set_std_mode set_std_mode
update_script update_script
cleanup_lxc
else else
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC Update/Setting" --menu \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC Update/Setting" --menu \
"Support/Update functions for ${APP} LXC. Choose an option:" \ "Support/Update functions for ${APP} LXC. Choose an option:" \
@ -2662,6 +2663,7 @@ start() {
;; ;;
esac esac
update_script update_script
cleanup_lxc
fi fi
} }

View File

@ -1,6 +0,0 @@
__ _ __ __ __ __
____ _/ /_ (_) /_/ /_____ _____________ ____ / /_ ___ _ ______ ____ _____/ /____ _____
/ __ `/ __ \/ / __/ __/ __ \/ ___/ ___/ _ \/ __ \/ __/_____/ _ \| |/_/ __ \/ __ \/ ___/ __/ _ \/ ___/
/ /_/ / /_/ / / /_/ /_/ /_/ / / / / / __/ / / / /_/_____/ __/> </ /_/ / /_/ / / / /_/ __/ /
\__, /_.___/_/\__/\__/\____/_/ /_/ \___/_/ /_/\__/ \___/_/|_/ .___/\____/_/ \__/\___/_/
/_/ /_/