mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-06 21:03:25 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d9277bf240 | |||
| d53486c86e | |||
| 4f80c217fc | |||
| f4afdfcd0c | |||
| 3865f855f0 | |||
| 94da6eeb83 | |||
| 078a76f263 | |||
| 58d819b2f4 | |||
| 1c03d0506c |
@@ -518,6 +518,20 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-08-05
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- NextcloudPI: Bump to Debian Trixie & Tweak broken SSH [@MickLesk](https://github.com/MickLesk) ([#15957](https://github.com/community-scripts/ProxmoxVE/pull/15957))
|
||||
|
||||
### 🧰 Tools
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- fix(monitor-all): reduce polling CPU overhead [@jomplox](https://github.com/jomplox) ([#15907](https://github.com/community-scripts/ProxmoxVE/pull/15907))
|
||||
|
||||
## 2026-08-04
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
|
||||
@@ -24,6 +24,16 @@ if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||
exit 10
|
||||
fi
|
||||
|
||||
msg_info "Making ssh.service reloads behave like restarts"
|
||||
mkdir -p /etc/systemd/system/ssh.service.d
|
||||
cat <<'EOF' >/etc/systemd/system/ssh.service.d/reload-as-restart.conf
|
||||
[Service]
|
||||
ExecReload=
|
||||
ExecReload=/usr/bin/systemd-run --no-block --quiet /bin/systemctl restart ssh.service
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
msg_ok "Made ssh.service reloads behave like restarts"
|
||||
|
||||
msg_info "Installing NextCloudPi (Patience)"
|
||||
$STD bash <(curl -fsSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh)
|
||||
msg_ok "Installed NextCloudPi"
|
||||
|
||||
+16
-12
@@ -922,8 +922,10 @@ choose_and_set_storage_for_file() {
|
||||
_list_os_versions() {
|
||||
local ostype="${1:-}"
|
||||
[[ -n "$ostype" ]] || return 0
|
||||
local arch
|
||||
arch="$(dpkg --print-architecture 2>/dev/null || echo amd64)"
|
||||
pveam available -section system 2>/dev/null |
|
||||
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)$" |
|
||||
awk '{print $2}' |
|
||||
sed -nE "s/^${ostype}-([0-9]+(\.[0-9]+)?).*/\1/p" |
|
||||
sort -u -V || true
|
||||
@@ -936,8 +938,10 @@ _list_os_versions() {
|
||||
_list_templates() {
|
||||
local search="${1:-}" pattern="${2:-}"
|
||||
[[ -n "$search" ]] || return 0
|
||||
local arch
|
||||
arch="$(dpkg --print-architecture 2>/dev/null || echo amd64)"
|
||||
pveam available -section system 2>/dev/null |
|
||||
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)$" |
|
||||
awk '{print $2}' |
|
||||
grep -E "^${search}.*${pattern}" |
|
||||
sort -t - -k 2 -V || true
|
||||
@@ -5200,15 +5204,11 @@ EOF
|
||||
# TSTP = Ctrl+Z, TTIN = bg read from tty, TTOU = bg write to tty (tostop)
|
||||
trap '' TSTP TTIN TTOU
|
||||
|
||||
# lxc-attach takes the controlling terminal while the install runs and does
|
||||
# not hand it back, leaving us in a background process group. Reading from
|
||||
# the terminal then returns EIO instead of blocking, because SIGTTIN is
|
||||
# ignored above - so every recovery prompt fails before the user can answer.
|
||||
# Redirecting to /dev/tty does not help: the rule applies to the terminal,
|
||||
# not the file descriptor. Claim the foreground group back; SIGTTOU is
|
||||
# ignored too, so tcsetpgrp() succeeds instead of stopping us. No-op when we
|
||||
# already are in the foreground. perl is a hard dependency of Proxmox VE.
|
||||
perl -e 'use POSIX; open(my $t, "+<", "/dev/tty") or exit 1; POSIX::tcsetpgrp(fileno($t), getpgrp()) or exit 1;' 2>/dev/null || true
|
||||
# lxc-attach left us in a background process group - claim the terminal back
|
||||
# before we print anything. Note this does NOT hold: the log collection
|
||||
# below uses pct pull/exec, which take it away again, so every interactive
|
||||
# prompt has to reclaim it again right before its read.
|
||||
reclaim_tty
|
||||
|
||||
msg_error "Installation failed in container ${CTID} (exit code: ${install_exit_code})"
|
||||
|
||||
@@ -5338,6 +5338,7 @@ EOF
|
||||
pct enter "$CTID"
|
||||
echo ""
|
||||
echo -en "${YW}Container ${CTID} still running. Remove now? (y/N): ${CL}"
|
||||
reclaim_tty
|
||||
if read -r response </dev/tty && [[ "$response" =~ ^[Yy]$ ]]; then
|
||||
pct stop "$CTID" &>/dev/null || true
|
||||
pct destroy "$CTID" &>/dev/null || true
|
||||
@@ -5497,6 +5498,7 @@ EOF
|
||||
|
||||
local response=""
|
||||
local read_rc
|
||||
reclaim_tty
|
||||
read -t 60 -r response </dev/tty
|
||||
read_rc=$?
|
||||
if [[ $read_rc -eq 0 ]]; then
|
||||
@@ -5761,6 +5763,7 @@ destroy_lxc() {
|
||||
trap 'echo; msg_error "Aborted by user (SIGINT/SIGQUIT)"; return 130' INT QUIT
|
||||
|
||||
local prompt
|
||||
reclaim_tty
|
||||
if ! read -rp "Remove this Container? <y/N> " prompt </dev/tty; then
|
||||
# read returns non-zero on Ctrl-D/ESC
|
||||
msg_error "Aborted input (Ctrl-D/ESC)"
|
||||
@@ -6722,7 +6725,8 @@ create_lxc_container() {
|
||||
# Step 1: Check local templates first (instant)
|
||||
mapfile -t LOCAL_TEMPLATES < <(
|
||||
pveam list "$TEMPLATE_STORAGE" 2>/dev/null |
|
||||
awk -v search="${TEMPLATE_SEARCH}" -v pattern="${TEMPLATE_PATTERN}" '$1 ~ search && $1 ~ pattern {print $1}' |
|
||||
awk -v search="${TEMPLATE_SEARCH}" -v pattern="${TEMPLATE_PATTERN}" -v arch="${ARCH}" \
|
||||
'$1 ~ search && $1 ~ pattern && $1 ~ ("_" arch "\\.(tar\\.zst|tar\\.xz|tar\\.gz)$") {print $1}' |
|
||||
sed 's|.*/||' | sort -t - -k 2 -V
|
||||
)
|
||||
|
||||
|
||||
@@ -1042,6 +1042,39 @@ ensure_tput() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# reclaim_tty()
|
||||
#
|
||||
# - Reclaims the controlling terminal's foreground process group
|
||||
# - lxc-attach takes the terminal and does not hand it back, leaving us in a
|
||||
# background process group. Reading from the terminal then returns EIO
|
||||
# instead of blocking, because SIGTTIN is ignored during recovery - so the
|
||||
# prompt fails before the user can answer and their keystroke leaks into the
|
||||
# parent shell. Redirecting to /dev/tty does not help: the rule applies to
|
||||
# the terminal, not to the file descriptor.
|
||||
# - pct exec/pull/enter use lxc-attach internally, so the terminal can be taken
|
||||
# away again at any point. Call this immediately before each interactive
|
||||
# read, not once after the install.
|
||||
# - SIGTTOU is ignored inside perl so tcsetpgrp() succeeds instead of stopping
|
||||
# us. No-op when we already are in the foreground or there is no terminal.
|
||||
# perl is a hard dependency of Proxmox VE.
|
||||
# ------------------------------------------------------------------------------
|
||||
reclaim_tty() {
|
||||
command -v perl >/dev/null 2>&1 || return 0
|
||||
[[ -e /dev/tty ]] || return 0
|
||||
|
||||
local pgid
|
||||
pgid=$(ps -o pgid= -p $$ 2>/dev/null | tr -d ' ') || true
|
||||
|
||||
perl -e '
|
||||
use POSIX;
|
||||
$SIG{TTOU} = "IGNORE";
|
||||
my $pgid = $ARGV[0] || POSIX::getpgrp();
|
||||
open(my $t, "+<", "/dev/tty") or exit 1;
|
||||
POSIX::tcsetpgrp(fileno($t), $pgid) or exit 1;
|
||||
' "${pgid:-0}" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# is_alpine()
|
||||
#
|
||||
|
||||
@@ -499,6 +499,7 @@ error_handler() {
|
||||
|
||||
local response=""
|
||||
local read_rc
|
||||
declare -f reclaim_tty >/dev/null 2>&1 && reclaim_tty
|
||||
read -t 60 -r response </dev/tty
|
||||
read_rc=$?
|
||||
if [[ $read_rc -eq 0 ]]; then
|
||||
|
||||
@@ -54,18 +54,24 @@ while true; do
|
||||
continue
|
||||
fi
|
||||
|
||||
# Determine type and set config command
|
||||
if pct status $instance >/dev/null 2>&1; then
|
||||
# Determine type and read the current config directly from Proxmox's pmxcfs.
|
||||
# Ignore snapshot sections, matching the current config shown by pct/qm config.
|
||||
if [ -r "/etc/pve/lxc/$instance.conf" ]; then
|
||||
type="ct"
|
||||
config_cmd="pct config"
|
||||
config_file="/etc/pve/lxc/$instance.conf"
|
||||
else
|
||||
type="vm"
|
||||
config_cmd="qm config"
|
||||
config_file="/etc/pve/qemu-server/$instance.conf"
|
||||
fi
|
||||
config=$(sed '/^\[/,$d' "$config_file")
|
||||
|
||||
# Skip templates and onboot-disabled
|
||||
onboot=$($config_cmd $instance | grep -q "onboot: 0" || ( ! $config_cmd $instance | grep -q "onboot" ) && echo "true" || echo "false")
|
||||
template=$($config_cmd $instance | grep -q "^template:" && echo "true" || echo "false")
|
||||
if grep -q "onboot: 0" <<<"$config" || ! grep -q "onboot" <<<"$config"; then
|
||||
onboot="true"
|
||||
else
|
||||
onboot="false"
|
||||
fi
|
||||
template=$(grep -q "^template:" <<<"$config" && echo "true" || echo "false")
|
||||
|
||||
if [ "$onboot" == "true" ]; then
|
||||
echo "Skipping $instance because it is set not to boot"
|
||||
@@ -76,7 +82,7 @@ while true; do
|
||||
fi
|
||||
|
||||
# Check for mon-restart tag
|
||||
has_tag=$($config_cmd $instance | grep -q "tags:.*mon-restart" && echo "true" || echo "false")
|
||||
has_tag=$(grep -q "tags:.*mon-restart" <<<"$config" && echo "true" || echo "false")
|
||||
if [ "$has_tag" != "true" ]; then
|
||||
echo "Skipping $instance because it does not have 'mon-restart' tag"
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user