mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-05 21:14:27 +01:00
fix(caddy): skip the xCaddy test build below 2 GB RAM
The container defaults to 512 MB (256 MB on Alpine), and Go's linker was killed in xcaddy build: 14 runs on 6 hosts in a week. The build only produced an unused binary, so below 2 GB xCaddy is installed without it and a warning says why; install and update alike.
This commit is contained in:
+7
-3
@@ -55,9 +55,13 @@ update_deb_based() {
|
||||
setup_go
|
||||
fetch_and_deploy_gh_release "xcaddy" "caddyserver/xcaddy" "binary"
|
||||
|
||||
msg_info "Updating xCaddy"
|
||||
$STD xcaddy build
|
||||
msg_ok "Updated xCaddy"
|
||||
if (($(awk '/^MemTotal:/ {print int($2 / 1024)}' /proc/meminfo) < 1900)); then
|
||||
msg_warn "xCaddy updated; its test build was skipped because linking Caddy needs about 2 GB RAM"
|
||||
else
|
||||
msg_info "Updating xCaddy"
|
||||
$STD xcaddy build
|
||||
msg_ok "Updated xCaddy"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
msg_ok "Updated successfully!"
|
||||
|
||||
@@ -23,10 +23,14 @@ setup_deb_based() {
|
||||
setup_go
|
||||
fetch_and_deploy_gh_release "xcaddy" "caddyserver/xcaddy" "binary"
|
||||
|
||||
msg_info "Setup xCaddy"
|
||||
$STD apt install -y git
|
||||
$STD xcaddy build
|
||||
msg_ok "Setup xCaddy"
|
||||
if (($(awk '/^MemTotal:/ {print int($2 / 1024)}' /proc/meminfo) < 1900)); then
|
||||
msg_warn "xCaddy is installed; its test build was skipped because linking Caddy needs about 2 GB RAM"
|
||||
else
|
||||
msg_info "Setup xCaddy"
|
||||
$STD xcaddy build
|
||||
msg_ok "Setup xCaddy"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -69,10 +73,14 @@ EOF
|
||||
GO_VERSION="$(curl -fsSL https://go.dev/VERSION?m=text | head -1 | cut -c3-)" setup_go
|
||||
fetch_and_deploy_gh_release "xcaddy" "caddyserver/xcaddy" "prebuild" "latest" "/opt/xcaddy" "xcaddy_*_linux_$(arch_resolve).tar.gz"
|
||||
ln -sf /opt/xcaddy/xcaddy /usr/local/bin/xcaddy
|
||||
msg_info "Setup xCaddy"
|
||||
cd /opt
|
||||
$STD xcaddy build
|
||||
msg_ok "Setup xCaddy"
|
||||
if (($(awk '/^MemTotal:/ {print int($2 / 1024)}' /proc/meminfo) < 1900)); then
|
||||
msg_warn "xCaddy is installed; its test build was skipped because linking Caddy needs about 2 GB RAM"
|
||||
else
|
||||
msg_info "Setup xCaddy"
|
||||
cd /opt
|
||||
$STD xcaddy build
|
||||
msg_ok "Setup xCaddy"
|
||||
fi
|
||||
fi
|
||||
|
||||
msg_info "Enabling Caddy Service"
|
||||
|
||||
Reference in New Issue
Block a user