Compare commits

..

24 Commits

Author SHA1 Message Date
github-actions[bot]
34fded1d74 Update CHANGELOG.md 2026-02-20 00:19:58 +00:00
community-scripts-pr-app[bot]
27c02dda99 chore: update github-versions.json (#12100)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-20 00:19:44 +00:00
community-scripts-pr-app[bot]
c3bac57055 chore: update github-versions.json (#12095)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 18:19:55 +00:00
community-scripts-pr-app[bot]
9fd11feb1f Update CHANGELOG.md (#12093)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 15:15:43 +00:00
Tobias
32f3748a0e add: patchmon breaking change msg (#12075)
* add: patchmon breaking change msg

* Update ct/patchmon.sh

* Fix sed command for environment variable updates

* Fix protocol variable usage in patchmon.sh

---------

Co-authored-by: Chris <punk.sand7393@fastmail.com>
2026-02-19 16:15:10 +01:00
community-scripts-pr-app[bot]
f4547f10b6 Update CHANGELOG.md (#12091)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 15:00:10 +00:00
Slaviša Arežina
a3a6cbb6a6 Fixes (#12089) 2026-02-19 15:59:39 +01:00
community-scripts-pr-app[bot]
1a6ca67375 Update CHANGELOG.md (#12090)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 14:19:33 +00:00
juronja
401bd6b55b slug fix (#12088) 2026-02-19 15:19:04 +01:00
community-scripts-pr-app[bot]
a40da3c452 chore: update github-versions.json (#12085)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 12:14:57 +00:00
community-scripts-pr-app[bot]
5c48506629 Update CHANGELOG.md (#12078)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 07:47:33 +00:00
community-scripts-pr-app[bot]
45a8f744f1 Update CHANGELOG.md (#12077)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 07:47:07 +00:00
community-scripts-pr-app[bot]
54c66c5af4 Update date in json (#12076)
Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
2026-02-19 07:47:03 +00:00
push-app-to-main[bot]
0fab65f0cf Add truenas-vm (vm) (#12059)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-02-19 08:46:45 +01:00
community-scripts-pr-app[bot]
31482e7489 chore: update github-versions.json (#12074)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 06:23:51 +00:00
community-scripts-pr-app[bot]
d97f9a0bce Update CHANGELOG.md (#12070)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 00:23:09 +00:00
community-scripts-pr-app[bot]
9b2275c980 chore: update github-versions.json (#12069)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-19 00:22:45 +00:00
CanbiZ (MickLesk)
b6a4e6a2a6 OPNSense: add disk space check | increase disk space (#12058)
* Fix: Add disk space checking for OPNsense VM FreeBSD image decompression

- Add check_disk_space() function to verify available storage
- Check for 20GB before download and 15GB before decompression
- Provide clear error messages showing available vs required space
- Add proper error handling for unxz decompression failures
- Clean up compressed .xz file after decompression to save space
- Add progress messages for download and decompression steps

Fixes issue where script fails at line 611 with 'No space left on device'
when /tmp directory lacks sufficient space for ~10-15GB decompressed image.

* Increase OPNsense VM disk size from 10GB to 20GB

- Provides more space for system updates, logs, and package installations
- 20GB is a more appropriate size for OPNsense production use
2026-02-18 22:06:04 +01:00
community-scripts-pr-app[bot]
96c056ea4e chore: update github-versions.json (#12067)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-18 18:17:12 +00:00
CanbiZ (MickLesk)
491081ffbf Add post_progress_to_api lightweight telemetry ping
Introduce post_progress_to_api() in misc/api.func — a non-blocking, fire-and-forget curl ping (gated by DIAGNOSTICS and RANDOM_UUID) that updates telemetry status to "configuring". Wire this progress ping into multiple scripts (alpine-install.func, install.func, build.func, core.func) at key milestones (container start, network ready, customization, creation, cleanup) and replace/deduplicate some earlier post_to_api calls. Also update error_handler.func to always report failures immediately via post_update_to_api to ensure failures are captured even before/after container lifecycle.
2026-02-18 16:19:19 +01:00
community-scripts-pr-app[bot]
1123fdca14 Update CHANGELOG.md (#12064)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-18 12:53:37 +00:00
Chris
a3a383361d [Fix] PatchMon: use SERVER_PORT in Nginx config if set in env (#12053)
- This PR will add the ability to change the PatchMon listen port in the
Nginx config during update, if the `SERVER_PORT` env var is set in
`/opt/patchmon/backend.env` and if the port is not 443
- If not set, or if set and the port is 443, then no changes are made to
the listen port in the Nginx config
2026-02-18 13:53:08 +01:00
CanbiZ (MickLesk)
6cc8877852 Add timeouts and prioritize telemetry on exit
Prevent hangs when pulling logs from containers by wrapping pct pull calls with timeout (8s) and running ensure_log_on_host under timeout (10s). Always send telemetry (post_update_to_api) before attempting best-effort log collection so status is reported even if log retrieval blocks. Update EXIT/ERR/SIGHUP/SIGINT/SIGTERM traps and consolidate error/interrupt handlers to use the new timeouted log collection. Changes in misc/build.func and misc/error_handler.func.
2026-02-18 13:14:59 +01:00
community-scripts-pr-app[bot]
845b89f975 chore: update github-versions.json (#12061)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-18 12:13:39 +00:00
13 changed files with 213 additions and 107 deletions

View File

@@ -404,8 +404,35 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-02-20
## 2026-02-19
### 🆕 New Scripts
- TrueNAS-VM ([#12059](https://github.com/community-scripts/ProxmoxVE/pull/12059))
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- add: patchmon breaking change msg [@CrazyWolf13](https://github.com/CrazyWolf13) ([#12075](https://github.com/community-scripts/ProxmoxVE/pull/12075))
- LibreNMS: Various fixes [@tremor021](https://github.com/tremor021) ([#12089](https://github.com/community-scripts/ProxmoxVE/pull/12089))
### 🌐 Website
- #### 📝 Script Information
- truenas-vm: slug fix for source code link [@juronja](https://github.com/juronja) ([#12088](https://github.com/community-scripts/ProxmoxVE/pull/12088))
## 2026-02-18
### 🚀 Updated Scripts
- #### 💥 Breaking Changes
- [Fix] PatchMon: use `SERVER_PORT` in Nginx config if set in env [@vhsdream](https://github.com/vhsdream) ([#12053](https://github.com/community-scripts/ProxmoxVE/pull/12053))
### 💾 Core
- #### ✨ New Features

View File

@@ -29,6 +29,13 @@ function update_script() {
exit
fi
if ! grep -q "PORT=3001" /opt/patchmon/backend/.env; then
msg_warn "⚠️ The next PatchMon update will include breaking changes (port changes)."
msg_warn "See details here: https://github.com/community-scripts/ProxmoxVE/pull/11888"
msg_warn "Press Enter to continue with the update, or Ctrl+C to abort..."
read -r
fi
NODE_VERSION="24" setup_nodejs
if check_for_gh_release "PatchMon" "PatchMon/PatchMon"; then
msg_info "Stopping Service"
@@ -46,7 +53,8 @@ function update_script() {
VERSION=$(get_latest_github_release "PatchMon/PatchMon")
PROTO="$(sed -n '/SERVER_PROTOCOL/s/[^=]*=//p' /opt/backend.env)"
HOST="$(sed -n '/SERVER_HOST/s/[^=]*=//p' /opt/backend.env)"
[[ "${PROTO:-http}" == "http" ]] && PORT=":3001"
SERVER_PORT="$(sed -n '/SERVER_PORT/s/[^=]*=//p' /opt/backend.env)"
[[ "$PROTO" == "http" ]] && PORT=":3001"
sed -i 's/PORT=3399/PORT=3001/' /opt/backend.env
sed -i -e "s/VERSION=.*/VERSION=$VERSION/" \
-e "\|VITE_API_URL=|s|http.*|${PROTO:-http}://${HOST:-$LOCAL_IP}${PORT:-}/api/v1|" /opt/frontend.env
@@ -66,6 +74,9 @@ function update_script() {
-e '\|try_files |i\ root /opt/patchmon/frontend/dist;' \
-e 's|alias.*|alias /opt/patchmon/frontend/dist/assets;|' \
-e '\|expires 1y|i\ root /opt/patchmon/frontend/dist;' /etc/nginx/sites-available/patchmon.conf
if [[ -n "$SERVER_PORT" ]] && [[ "$SERVER_PORT" != "443" ]]; then
sed -i "s/listen [[:digit:]].*/listen ${SERVER_PORT};/" /etc/nginx/sites-available/patchmon.conf
fi
ln -sf /etc/nginx/sites-available/patchmon.conf /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default
$STD nginx -t

View File

@@ -1,5 +1,5 @@
{
"generated": "2026-02-18T06:25:03Z",
"generated": "2026-02-20T00:19:36Z",
"versions": [
{
"slug": "2fauth",
@@ -11,9 +11,9 @@
{
"slug": "adguard",
"repo": "AdguardTeam/AdGuardHome",
"version": "v0.107.71",
"version": "v0.107.72",
"pinned": false,
"date": "2025-12-08T14:34:55Z"
"date": "2026-02-19T15:37:49Z"
},
{
"slug": "adguardhome-sync",
@@ -39,9 +39,9 @@
{
"slug": "ampache",
"repo": "ampache/ampache",
"version": "7.8.0",
"version": "7.9.0",
"pinned": false,
"date": "2025-12-22T04:23:45Z"
"date": "2026-02-19T07:01:25Z"
},
{
"slug": "argus",
@@ -158,9 +158,9 @@
{
"slug": "bookstack",
"repo": "BookStackApp/BookStack",
"version": "v25.12.5",
"version": "v25.12.7",
"pinned": false,
"date": "2026-02-17T18:42:47Z"
"date": "2026-02-19T23:36:55Z"
},
{
"slug": "byparr",
@@ -256,9 +256,9 @@
{
"slug": "databasus",
"repo": "databasus/databasus",
"version": "v3.14.0",
"version": "v3.14.1",
"pinned": false,
"date": "2026-02-17T17:18:34Z"
"date": "2026-02-18T10:43:45Z"
},
{
"slug": "dawarich",
@@ -270,9 +270,9 @@
{
"slug": "discopanel",
"repo": "nickheyer/discopanel",
"version": "v1.0.36",
"version": "v1.0.37",
"pinned": false,
"date": "2026-02-09T21:15:44Z"
"date": "2026-02-18T08:53:43Z"
},
{
"slug": "dispatcharr",
@@ -417,9 +417,9 @@
{
"slug": "ghostfolio",
"repo": "ghostfolio/ghostfolio",
"version": "2.239.0",
"version": "2.240.0",
"pinned": false,
"date": "2026-02-15T09:51:16Z"
"date": "2026-02-18T20:08:56Z"
},
{
"slug": "gitea",
@@ -557,9 +557,9 @@
{
"slug": "huntarr",
"repo": "plexguide/Huntarr.io",
"version": "9.3.3",
"version": "9.3.7",
"pinned": false,
"date": "2026-02-18T02:35:29Z"
"date": "2026-02-19T01:03:53Z"
},
{
"slug": "immich-public-proxy",
@@ -585,16 +585,16 @@
{
"slug": "invoiceninja",
"repo": "invoiceninja/invoiceninja",
"version": "v5.12.63",
"version": "v5.12.64",
"pinned": false,
"date": "2026-02-18T00:32:09Z"
"date": "2026-02-18T07:59:44Z"
},
{
"slug": "jackett",
"repo": "Jackett/Jackett",
"version": "v0.24.1147",
"version": "v0.24.1157",
"pinned": false,
"date": "2026-02-18T05:54:19Z"
"date": "2026-02-19T05:51:02Z"
},
{
"slug": "jellystat",
@@ -844,9 +844,9 @@
{
"slug": "metube",
"repo": "alexta69/metube",
"version": "2026.02.14",
"version": "2026.02.19",
"pinned": false,
"date": "2026-02-14T07:49:11Z"
"date": "2026-02-19T08:24:04Z"
},
{
"slug": "miniflux",
@@ -1061,9 +1061,9 @@
{
"slug": "pelican-panel",
"repo": "pelican-dev/panel",
"version": "v1.0.0-beta32",
"version": "v1.0.0-beta33",
"pinned": false,
"date": "2026-02-09T22:15:44Z"
"date": "2026-02-18T21:37:11Z"
},
{
"slug": "pelican-wings",
@@ -1187,9 +1187,9 @@
{
"slug": "pulse",
"repo": "rcourtman/Pulse",
"version": "v5.1.9",
"version": "v5.1.11",
"pinned": false,
"date": "2026-02-11T15:34:40Z"
"date": "2026-02-19T20:20:44Z"
},
{
"slug": "pve-scripts-local",
@@ -1250,9 +1250,9 @@
{
"slug": "rdtclient",
"repo": "rogerfar/rdt-client",
"version": "v2.0.120",
"version": "v2.0.121",
"pinned": false,
"date": "2026-02-12T02:53:51Z"
"date": "2026-02-19T04:48:39Z"
},
{
"slug": "reactive-resume",
@@ -1313,9 +1313,9 @@
{
"slug": "scanopy",
"repo": "scanopy/scanopy",
"version": "v0.14.4",
"version": "v0.14.6",
"pinned": false,
"date": "2026-02-10T03:57:28Z"
"date": "2026-02-18T16:54:14Z"
},
{
"slug": "scraparr",
@@ -1341,9 +1341,9 @@
{
"slug": "semaphore",
"repo": "semaphoreui/semaphore",
"version": "v2.17.5",
"version": "v2.17.8",
"pinned": false,
"date": "2026-02-17T18:20:38Z"
"date": "2026-02-18T19:46:43Z"
},
{
"slug": "shelfmark",
@@ -1383,9 +1383,9 @@
{
"slug": "snowshare",
"repo": "TuroYT/snowshare",
"version": "v1.3.5",
"version": "v1.3.6",
"pinned": false,
"date": "2026-02-11T10:24:51Z"
"date": "2026-02-19T11:06:29Z"
},
{
"slug": "sonarr",
@@ -1418,9 +1418,9 @@
{
"slug": "stirling-pdf",
"repo": "Stirling-Tools/Stirling-PDF",
"version": "v2.5.0",
"version": "v2.5.1",
"pinned": false,
"date": "2026-02-16T22:58:17Z"
"date": "2026-02-18T11:05:34Z"
},
{
"slug": "streamlink-webui",
@@ -1551,9 +1551,9 @@
{
"slug": "tunarr",
"repo": "chrisbenincasa/tunarr",
"version": "v1.1.14",
"version": "v1.1.15",
"pinned": false,
"date": "2026-02-17T18:26:17Z"
"date": "2026-02-19T23:51:17Z"
},
{
"slug": "uhf",
@@ -1593,9 +1593,9 @@
{
"slug": "uptimekuma",
"repo": "louislam/uptime-kuma",
"version": "2.1.1",
"version": "2.1.3",
"pinned": false,
"date": "2026-02-13T16:07:33Z"
"date": "2026-02-19T05:37:30Z"
},
{
"slug": "vaultwarden",
@@ -1607,9 +1607,9 @@
{
"slug": "victoriametrics",
"repo": "VictoriaMetrics/VictoriaMetrics",
"version": "v1.135.0",
"version": "v1.136.0",
"pinned": false,
"date": "2026-02-02T14:20:15Z"
"date": "2026-02-16T13:17:50Z"
},
{
"slug": "vikunja",
@@ -1726,9 +1726,9 @@
{
"slug": "yubal",
"repo": "guillevc/yubal",
"version": "v0.6.0",
"version": "v0.6.1",
"pinned": false,
"date": "2026-02-15T17:47:56Z"
"date": "2026-02-18T23:24:16Z"
},
{
"slug": "zigbee2mqtt",
@@ -1761,9 +1761,9 @@
{
"slug": "zwave-js-ui",
"repo": "zwave-js/zwave-js-ui",
"version": "v11.11.0",
"version": "v11.12.0",
"pinned": false,
"date": "2026-02-03T13:13:05Z"
"date": "2026-02-19T10:14:19Z"
}
]
}

View File

@@ -1,10 +1,10 @@
{
"name": "TrueNAS Community Edition",
"slug": "truenas-community-edition",
"slug": "truenas-vm",
"categories": [
2
],
"date_created": "2026-01-16",
"date_created": "2026-02-19",
"type": "vm",
"updateable": false,
"privileged": false,

View File

@@ -35,10 +35,12 @@ $STD apt install -y \
python3-redis \
python3-setuptools \
python3-systemd \
python3-pip
python3-pip \
python3-psutil \
python3-command-runner
msg_ok "Installed Python Dependencies"
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="snmp" setup_php
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="cli,snmp,gmp" setup_php
setup_mariadb
setup_composer
PYTHON_VERSION="3.13" setup_uv
@@ -78,7 +80,7 @@ sed -i "s/listen = \/run\/php\/php8.4-fpm.sock/listen = \/run\/php-fpm-librenms.
msg_ok "Configured PHP-FPM"
msg_info "Configure Nginx"
cat >/etc/nginx/sites-enabled/librenms <<'EOF'
cat <<EOF >/etc/nginx/sites-enabled/librenms
server {
listen 80;
server_name ${LOCAL_IP};
@@ -89,7 +91,7 @@ server {
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
try_files \$uri \$uri/ /index.php?\$query_string;
}
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/run/php-fpm-librenms.sock;

View File

@@ -47,8 +47,8 @@ sed -i -e "s|DATABASE_URL=.*|DATABASE_URL=\"postgresql://$PG_DB_USER:$PG_DB_PASS
-e "/JWT_SECRET/s/[=$].*/=$JWT_SECRET/" \
-e "\|CORS_ORIGIN|s|localhost|$LOCAL_IP|" \
-e "/PORT=3001/aSERVER_PROTOCOL=http \\
SERVER_HOST=$LOCAL_IP \\
SERVER_PORT=3000" \
SERVER_HOST=$LOCAL_IP \\
SERVER_PORT=3000" \
-e '/_ENV=production/aTRUST_PROXY=1' \
-e '/REDIS_USER=.*/,+1d' /opt/patchmon/backend/.env

View File

@@ -148,6 +148,7 @@ motd_ssh() {
# Start the sshd service
$STD /etc/init.d/sshd start
fi
post_progress_to_api
}
# Validate Timezone for some LXC's
@@ -184,5 +185,5 @@ EOF
echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update
chmod +x /usr/bin/update
post_progress_to_api
}

View File

@@ -688,6 +688,29 @@ EOF
POST_TO_API_DONE=true
}
# ------------------------------------------------------------------------------
# post_progress_to_api()
#
# - Lightweight progress ping from host or container
# - Updates the existing telemetry record status to "configuring"
# - Signals that the installation is actively progressing (not stuck)
# - Fire-and-forget: never blocks or fails the script
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
# - Can be called multiple times safely
# ------------------------------------------------------------------------------
post_progress_to_api() {
command -v curl &>/dev/null || return 0
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
[[ -z "${RANDOM_UUID:-}" ]] && return 0
local app_name="${NSAPP:-${app:-unknown}}"
local telemetry_type="${TELEMETRY_TYPE:-lxc}"
curl -fsS -m 5 -X POST "${TELEMETRY_URL:-https://telemetry.community-scripts.org/telemetry}" \
-H "Content-Type: application/json" \
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"${telemetry_type}\",\"nsapp\":\"${app_name}\",\"status\":\"configuring\"}" &>/dev/null || true
}
# ------------------------------------------------------------------------------
# post_update_to_api()
#

View File

@@ -3660,9 +3660,6 @@ $PCT_OPTIONS_STRING"
exit 214
fi
msg_ok "Storage space validated"
# Report installation start to API (early - captures failed installs too)
post_to_api
fi
create_lxc_container || exit $?
@@ -3908,6 +3905,7 @@ EOF
for i in {1..10}; do
if pct status "$CTID" | grep -q "status: running"; then
msg_ok "Started LXC Container"
post_progress_to_api # Signal container is running
break
fi
sleep 1
@@ -3962,6 +3960,7 @@ EOF
echo -e "${YW}Container may have limited internet access. Installation will continue...${CL}"
else
msg_ok "Network in LXC is reachable (ping)"
post_progress_to_api # Signal network is ready
fi
fi
# Function to get correct GID inside container
@@ -4033,6 +4032,7 @@ EOF'
fi
msg_ok "Customized LXC Container"
post_progress_to_api # Signal ready for app installation
# Optional DNS override for retry scenarios (inside LXC, never on host)
if [[ "${DNS_RETRY_OVERRIDE:-false}" == "true" ]]; then
@@ -4106,9 +4106,9 @@ EOF'
build_log_copied=true
fi
# Copy and append INSTALL_LOG from container
# Copy and append INSTALL_LOG from container (with timeout to prevent hangs)
local temp_install_log="/tmp/.install-temp-${SESSION_ID}.log"
if pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_install_log" 2>/dev/null; then
if timeout 8 pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_install_log" 2>/dev/null; then
{
echo "================================================================================"
echo "PHASE 2: APPLICATION INSTALLATION (Container)"
@@ -4888,6 +4888,9 @@ create_lxc_container() {
exit 206
fi
# Report installation start to API early - captures failures in storage/template/create
post_to_api
# Storage capability check
check_storage_support "rootdir" || {
msg_error "No valid storage found for 'rootdir' [Container]"
@@ -5417,9 +5420,7 @@ create_lxc_container() {
}
msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created."
# Report container creation to API
post_to_api
post_progress_to_api # Signal container creation complete
}
# ==============================================================================
@@ -5492,6 +5493,7 @@ EOF
# - If INSTALL_LOG points to a container path (e.g. /root/.install-*),
# tries to pull it from the container and create a combined log
# - This allows get_error_text() to find actual error output for telemetry
# - Uses timeout on pct pull to prevent hangs on dead/unresponsive containers
# ------------------------------------------------------------------------------
ensure_log_on_host() {
# Already readable on host? Nothing to do.
@@ -5521,9 +5523,9 @@ ensure_log_on_host() {
echo ""
} >>"$combined_log"
fi
# Pull INSTALL_LOG from container
# Pull INSTALL_LOG from container (with timeout to prevent hangs on dead containers)
local temp_log="/tmp/.install-temp-${SESSION_ID}.log"
if pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_log" 2>/dev/null; then
if timeout 8 pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_log" 2>/dev/null; then
{
echo "================================================================================"
echo "PHASE 2: APPLICATION INSTALLATION (Container)"
@@ -5546,8 +5548,8 @@ ensure_log_on_host() {
# - Exit trap handler for reporting to API telemetry
# - Captures exit code and reports to PocketBase using centralized error descriptions
# - Uses explain_exit_code() from api.func for consistent error messages
# - For signal exits (>128): sends telemetry FIRST before log collection
# to prevent pct pull hangs from blocking status updates
# - ALWAYS sends telemetry FIRST before log collection to prevent pct pull
# hangs from blocking status updates (container may be dead/unresponsive)
# - For non-zero exit codes: posts "failed" status
# - For zero exit codes where post_update_to_api was never called:
# catches orphaned "installing" records (e.g., script exited cleanly
@@ -5556,14 +5558,12 @@ ensure_log_on_host() {
api_exit_script() {
local exit_code=$?
if [ $exit_code -ne 0 ]; then
if [ $exit_code -gt 128 ]; then
# Signal exit: send telemetry IMMEDIATELY (container may be dying)
post_update_to_api "failed" "$exit_code" 2>/dev/null || true
ensure_log_on_host 2>/dev/null || true
else
# Normal error: collect logs first for better error details
ensure_log_on_host 2>/dev/null || true
post_update_to_api "failed" "$exit_code"
# ALWAYS send telemetry FIRST - ensure status is reported even if
# ensure_log_on_host hangs (e.g. pct pull on dead container)
post_update_to_api "failed" "$exit_code" 2>/dev/null || true
# Best-effort log collection with timeout (non-critical after telemetry is sent)
if declare -f ensure_log_on_host >/dev/null 2>&1; then
timeout 10 bash -c 'ensure_log_on_host' 2>/dev/null || true
fi
elif [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
# Script exited with 0 but never sent a completion status
@@ -5575,7 +5575,7 @@ api_exit_script() {
if command -v pveversion >/dev/null 2>&1; then
trap 'api_exit_script' EXIT
fi
trap 'local _ec=$?; if [[ $_ec -ne 0 ]]; then ensure_log_on_host 2>/dev/null || true; post_update_to_api "failed" "$_ec"; fi' ERR
trap 'post_update_to_api "failed" "129" 2>/dev/null || true; ensure_log_on_host 2>/dev/null || true; exit 129' SIGHUP
trap 'post_update_to_api "failed" "130" 2>/dev/null || true; ensure_log_on_host 2>/dev/null || true; exit 130' SIGINT
trap 'post_update_to_api "failed" "143" 2>/dev/null || true; ensure_log_on_host 2>/dev/null || true; exit 143' SIGTERM
trap 'local _ec=$?; if [[ $_ec -ne 0 ]]; then post_update_to_api "failed" "$_ec" 2>/dev/null || true; timeout 10 bash -c "ensure_log_on_host" 2>/dev/null || true; fi' ERR
trap 'post_update_to_api "failed" "129" 2>/dev/null || true; timeout 10 bash -c "ensure_log_on_host" 2>/dev/null || true; exit 129' SIGHUP
trap 'post_update_to_api "failed" "130" 2>/dev/null || true; timeout 10 bash -c "ensure_log_on_host" 2>/dev/null || true; exit 130' SIGINT
trap 'post_update_to_api "failed" "143" 2>/dev/null || true; timeout 10 bash -c "ensure_log_on_host" 2>/dev/null || true; exit 143' SIGTERM

View File

@@ -1496,6 +1496,11 @@ cleanup_lxc() {
fi
msg_ok "Cleaned"
# Send progress ping if available (defined in install.func)
if declare -f post_progress_to_api &>/dev/null; then
post_progress_to_api
fi
}
# ------------------------------------------------------------------------------

View File

@@ -204,6 +204,12 @@ error_handler() {
printf "\e[?25h"
# ALWAYS report failure to API immediately - don't wait for container checks
# This ensures we capture failures that occur before/after container exists
if declare -f post_update_to_api &>/dev/null; then
post_update_to_api "failed" "$exit_code" 2>/dev/null || true
fi
# Use msg_error if available, fallback to echo
if declare -f msg_error >/dev/null 2>&1; then
msg_error "in line ${line_number}: exit code ${exit_code} (${explanation}): while executing command ${command}"
@@ -254,11 +260,6 @@ error_handler() {
# Offer to remove container if it exists (build errors after container creation)
if [[ -n "${CTID:-}" ]] && command -v pct &>/dev/null && pct status "$CTID" &>/dev/null; then
# Report failure to API before container cleanup
if declare -f post_update_to_api &>/dev/null; then
post_update_to_api "failed" "$exit_code"
fi
echo ""
if declare -f msg_custom >/dev/null 2>&1; then
echo -en "${TAB}${TAB}${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}"
@@ -339,24 +340,17 @@ on_exit() {
# post_to_api was called ("installing" sent) but post_update_to_api was never called
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
if declare -f post_update_to_api >/dev/null 2>&1; then
if [[ $exit_code -gt 128 ]]; then
# Signal exit: send telemetry IMMEDIATELY (container may be dying, pct pull could hang)
# ALWAYS send telemetry FIRST - ensure status is reported even if
# ensure_log_on_host hangs (e.g. pct pull on dead/unresponsive container)
if [[ $exit_code -ne 0 ]]; then
post_update_to_api "failed" "$exit_code" 2>/dev/null || true
# Then try log collection (non-critical, best-effort)
if declare -f ensure_log_on_host >/dev/null 2>&1; then
ensure_log_on_host 2>/dev/null || true
fi
else
# Normal exit: collect logs first for better error details
if declare -f ensure_log_on_host >/dev/null 2>&1; then
ensure_log_on_host 2>/dev/null || true
fi
if [[ $exit_code -ne 0 ]]; then
post_update_to_api "failed" "$exit_code"
else
# exit_code=0 is never an error — report as success
post_update_to_api "done" "0"
fi
# exit_code=0 is never an error — report as success
post_update_to_api "done" "0" 2>/dev/null || true
fi
# Best-effort log collection with timeout (non-critical after telemetry is sent)
if declare -f ensure_log_on_host >/dev/null 2>&1; then
timeout 10 bash -c 'ensure_log_on_host' 2>/dev/null || true
fi
fi
fi
@@ -380,9 +374,9 @@ on_interrupt() {
if declare -f post_update_to_api >/dev/null 2>&1; then
post_update_to_api "failed" "130" 2>/dev/null || true
fi
# Best-effort log collection (non-critical after telemetry is sent)
# Best-effort log collection with timeout (non-critical after telemetry is sent)
if declare -f ensure_log_on_host >/dev/null 2>&1; then
ensure_log_on_host 2>/dev/null || true
timeout 10 bash -c 'ensure_log_on_host' 2>/dev/null || true
fi
if declare -f msg_error >/dev/null 2>&1; then
msg_error "Interrupted by user (SIGINT)" 2>/dev/null || true
@@ -409,9 +403,9 @@ on_terminate() {
if declare -f post_update_to_api >/dev/null 2>&1; then
post_update_to_api "failed" "143" 2>/dev/null || true
fi
# Best-effort log collection (non-critical after telemetry is sent)
# Best-effort log collection with timeout (non-critical after telemetry is sent)
if declare -f ensure_log_on_host >/dev/null 2>&1; then
ensure_log_on_host 2>/dev/null || true
timeout 10 bash -c 'ensure_log_on_host' 2>/dev/null || true
fi
if declare -f msg_error >/dev/null 2>&1; then
msg_error "Terminated by signal (SIGTERM)" 2>/dev/null || true

View File

@@ -285,6 +285,7 @@ motd_ssh() {
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi
post_progress_to_api
}
# ==============================================================================
@@ -323,4 +324,5 @@ EOF
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
fi
post_progress_to_api
}

View File

@@ -91,6 +91,17 @@ function cleanup() {
rm -rf $TEMP_DIR
}
function check_disk_space() {
local path="$1"
local required_gb="$2"
local available_kb=$(df -k "$path" | awk 'NR==2 {print $4}')
local available_gb=$((available_kb / 1024 / 1024))
if [ $available_gb -lt $required_gb ]; then
return 1
fi
return 0
}
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
function send_line_to_vm() {
@@ -605,11 +616,41 @@ if [ -z "$URL" ]; then
exit 1
fi
msg_ok "Download URL: ${CL}${BL}${URL}${CL}"
# Check available disk space (require at least 20GB for safety)
if ! check_disk_space "$TEMP_DIR" 20; then
AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}')
msg_error "Insufficient disk space in temporary directory ($TEMP_DIR)."
msg_error "Available: ${AVAILABLE_GB}, Required: ~20GB for FreeBSD image decompression."
msg_error "Please free up space or ensure /tmp has sufficient storage."
exit 1
fi
msg_info "Downloading FreeBSD Image"
curl -f#SL -o "$(basename "$URL")" "$URL"
echo -en "\e[1A\e[0K"
msg_ok "Downloaded ${CL}${BL}$(basename "$URL")${CL}"
# Check disk space again before decompression
if ! check_disk_space "$TEMP_DIR" 15; then
AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}')
msg_error "Insufficient disk space for decompression."
msg_error "Available: ${AVAILABLE_GB}, Required: ~15GB for decompressed image."
exit 1
fi
msg_info "Decompressing FreeBSD Image (this may take a few minutes)"
FILE=FreeBSD.qcow2
unxz -cv $(basename $URL) >${FILE}
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
if ! unxz -cv $(basename $URL) >${FILE}; then
msg_error "Failed to decompress FreeBSD image."
msg_error "This is usually caused by insufficient disk space."
df -h "$TEMP_DIR"
exit 1
fi
# Remove the compressed file to save space
rm -f "$(basename "$URL")"
msg_ok "Decompressed ${CL}${BL}${FILE}${CL}"
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
case $STORAGE_TYPE in
@@ -649,7 +690,7 @@ qm set $VMID \
-boot order=scsi0 \
-serial0 socket \
-tags community-script >/dev/null
qm resize $VMID scsi0 10G >/dev/null
qm resize $VMID scsi0 20G >/dev/null
DESCRIPTION=$(
cat <<EOF
<div align='center'>