This commit is contained in:
CanbiZ 2026-01-12 09:13:20 +01:00
parent dfed41f70f
commit 698a17089c

View File

@ -693,6 +693,13 @@ load_vars_file() {
[[ "$var_key" != var_* ]] && continue [[ "$var_key" != var_* ]] && continue
_is_whitelisted "$var_key" || continue _is_whitelisted "$var_key" || continue
# Strip inline comments (everything after unquoted #)
# Handle: var=value # comment OR var="value" # comment
if [[ ! "$var_val" =~ ^[\"\'] ]]; then
# Unquoted value: strip from first #
var_val="${var_val%%#*}"
fi
# Strip quotes # Strip quotes
if [[ "$var_val" =~ ^\"(.*)\"$ ]]; then if [[ "$var_val" =~ ^\"(.*)\"$ ]]; then
var_val="${BASH_REMATCH[1]}" var_val="${BASH_REMATCH[1]}"
@ -700,6 +707,9 @@ load_vars_file() {
var_val="${BASH_REMATCH[1]}" var_val="${BASH_REMATCH[1]}"
fi fi
# Trim trailing whitespace
var_val="${var_val%"${var_val##*[![:space:]]}"}"
# Set only if not already exported # Set only if not already exported
[[ -z "${!var_key+x}" ]] && export "${var_key}=${var_val}" [[ -z "${!var_key+x}" ]] && export "${var_key}=${var_val}"
fi fi
@ -802,12 +812,18 @@ var_fuse=no
var_tun=no var_tun=no
# Advanced Settings (Proxmox-official features) # Advanced Settings (Proxmox-official features)
var_nesting=1 # Allow nesting (required for Docker/LXC in CT) # var_nesting: Allow nesting (required for Docker/LXC in CT)
var_keyctl=0 # Allow keyctl() - needed for Docker (systemd-networkd workaround) var_nesting=1
var_mknod=0 # Allow device node creation (requires kernel 5.3+, experimental) # var_keyctl: Allow keyctl() - needed for Docker (systemd-networkd workaround)
var_mount_fs= # Allow specific filesystems: nfs,fuse,ext4,etc (leave empty for defaults) var_keyctl=0
var_protection=no # Prevent accidental deletion of container # var_mknod: Allow device node creation (requires kernel 5.3+, experimental)
var_timezone= # Container timezone (e.g. Europe/Berlin, leave empty for host timezone) var_mknod=0
# var_mount_fs: Allow specific filesystems: nfs,fuse,ext4,etc (leave empty for defaults)
var_mount_fs=
# var_protection: Prevent accidental deletion of container
var_protection=no
# var_timezone: Container timezone (e.g. Europe/Berlin, leave empty for host timezone)
var_timezone=
var_tags=community-script var_tags=community-script
var_verbose=no var_verbose=no