feat(build): add var_http_proxy and var_http_no_proxy support

Expose HTTP proxy settings in advanced install and vars whitelist, apply them during early container setup and installs, and persist proxy env for updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
MickLesk
2026-06-19 22:37:06 +02:00
parent 6710cb5210
commit 07c50a092e
4 changed files with 193 additions and 20 deletions
+3 -2
View File
@@ -388,7 +388,8 @@ apt_update_safe() {
# ------------------------------------------------------------------------------
update_os() {
msg_info "Updating Container OS"
if [[ "$CACHER" == "yes" ]]; then
configure_http_proxy
if [[ "$CACHER" == "yes" && -z "${HTTP_PROXY:-${http_proxy:-}}" ]]; then
echo 'Acquire::http::Proxy-Auto-Detect "/usr/local/bin/apt-proxy-detect.sh";' >/etc/apt/apt.conf.d/00aptproxy
local _proxy_raw="${CACHER_IP}"
local _proxy_host _proxy_port _proxy_url
@@ -509,7 +510,7 @@ EOF
systemctl restart "$(basename "$(dirname "$GETTY_OVERRIDE")" | sed 's/\.d//')"
msg_ok "Customized Container"
fi
echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update
echo 'set -a; [ -f /etc/profile.d/90-http-proxy.sh ] && . /etc/profile.d/90-http-proxy.sh; set +a; bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/'"${app}"'.sh)"' >/usr/bin/update
chmod +x /usr/bin/update
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then