Skip to content

Commit adda76f

Browse files
authored
caddy: modify disk size and implement xCaddy update (#7775)
1 parent cf597b6 commit adda76f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

ct/caddy.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ APP="Caddy"
99
var_tags="${var_tags:-webserver}"
1010
var_cpu="${var_cpu:-1}"
1111
var_ram="${var_ram:-512}"
12-
var_disk="${var_disk:-4}"
12+
var_disk="${var_disk:-6}"
1313
var_os="${var_os:-debian}"
1414
var_version="${var_version:-12}"
1515
var_unprivileged="${var_unprivileged:-1}"
@@ -31,6 +31,19 @@ function update_script() {
3131
$STD apt-get update
3232
$STD apt-get -y upgrade
3333
msg_ok "Updated $APP LXC"
34+
35+
if command -v xcaddy >/dev/null 2>&1; then
36+
install_go
37+
msg_info "Updating xCaddy"
38+
cd /opt
39+
RELEASE=$(curl -fsSL https://api.github.com/repos/caddyserver/xcaddy/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
40+
VERSION="${RELEASE#v}"
41+
curl -fsSL "https://github.com/caddyserver/xcaddy/releases/download/${RELEASE}/xcaddy_${VERSION}_linux_amd64.deb" -o "xcaddy_${VERSION}_linux_amd64.deb"
42+
$STD dpkg -i "xcaddy_${VERSION}_linux_amd64.deb"
43+
rm -f "xcaddy_${VERSION}_linux_amd64.deb"
44+
$STD xcaddy build
45+
msg_ok "Updated xCaddy"
46+
fi
3447
exit
3548
}
3649

@@ -41,4 +54,4 @@ description
4154
msg_ok "Completed Successfully!\n"
4255
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
4356
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
44-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}"
57+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}"

frontend/public/json/caddy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"resources": {
2222
"cpu": 1,
2323
"ram": 512,
24-
"hdd": 4,
24+
"hdd": 6,
2525
"os": "debian",
2626
"version": "12"
2727
}

0 commit comments

Comments
 (0)