This commit is contained in:
Slaviša Arežina
2026-01-13 08:09:39 +01:00
committed by GitHub
parent 8d53604ae3
commit 7c3d9d231a
3 changed files with 22 additions and 25 deletions

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-6}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@@ -29,21 +29,19 @@ function update_script() {
fi
msg_info "Updating Caddy LXC"
$STD apt-get update
$STD apt-get -y upgrade
$STD apt update
$STD apt upgrade -y
msg_ok "Updated Caddy LXC"
if command -v xcaddy >/dev/null 2>&1; then
setup_go
msg_info "Updating xCaddy"
cd /opt
RELEASE=$(curl -fsSL https://api.github.com/repos/caddyserver/xcaddy/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
VERSION="${RELEASE#v}"
curl -fsSL "https://github.com/caddyserver/xcaddy/releases/download/${RELEASE}/xcaddy_${VERSION}_linux_amd64.deb" -o "xcaddy_${VERSION}_linux_amd64.deb"
$STD dpkg -i "xcaddy_${VERSION}_linux_amd64.deb"
rm -f "xcaddy_${VERSION}_linux_amd64.deb"
$STD xcaddy build
msg_ok "Updated xCaddy"
if check_for_gh_release "xcaddy" "caddyserver/xcaddy"; then
setup_go
fetch_and_deploy_gh_release "xcaddy" "caddyserver/xcaddy" "binary"
msg_info "Updating xCaddy"
$STD xcaddy build
msg_ok "Updated xCaddy"
fi
fi
msg_ok "Updated successfully!"
exit

View File

@@ -23,7 +23,7 @@
"ram": 512,
"hdd": 6,
"os": "debian",
"version": "12"
"version": "13"
}
},
{

View File

@@ -14,29 +14,28 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
$STD apt install -y \
debian-keyring \
debian-archive-keyring \
apt-transport-https
msg_ok "Installed Dependencies"
msg_info "Installing Caddy"
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' >/etc/apt/sources.list.d/caddy-stable.list
$STD apt-get update
$STD apt-get install -y caddy
setup_deb822_repo \
"caddy" \
"https://dl.cloudsmith.io/public/caddy/stable/gpg.key" \
"https://dl.cloudsmith.io/public/caddy/stable/deb/debian" \
"any-version"
$STD apt install -y caddy
msg_ok "Installed Caddy"
read -r -p "${TAB3}Would you like to install xCaddy Addon? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
setup_go
fetch_and_deploy_gh_release "xcaddy" "caddyserver/xcaddy" "binary"
msg_info "Setup xCaddy"
$STD apt-get install -y git
cd /opt
RELEASE=$(curl -fsSL https://api.github.com/repos/caddyserver/xcaddy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL "https://github.com/caddyserver/xcaddy/releases/download/${RELEASE}/xcaddy_${RELEASE:1}_linux_amd64.deb" -o "xcaddy_${RELEASE:1}_linux_amd64.deb"
$STD dpkg -i xcaddy_"${RELEASE:1}"_linux_amd64.deb
rm -rf /opt/xcaddy*
$STD apt install -y git
$STD xcaddy build
msg_ok "Setup xCaddy"
fi