mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-22 20:27:19 +02:00
gatus: pin Go to gatus's go.mod version, modernize Alpine path to shared helpers (#16893)
This commit is contained in:
committed by
GitHub
parent
ff606af7ba
commit
b1edc2722d
@@ -20,8 +20,8 @@ setup_deb_based() {
|
||||
libcap2-bin
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_go
|
||||
fetch_and_deploy_gh_release "gatus" "TwiN/gatus" "tarball"
|
||||
GO_VERSION="$(grep -m1 '^go ' /opt/gatus/go.mod | awk '{print $2}')" setup_go
|
||||
|
||||
msg_info "Configuring gatus"
|
||||
cd /opt/gatus
|
||||
@@ -59,19 +59,16 @@ setup_alpine() {
|
||||
$STD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community go
|
||||
msg_ok "Installed dependencies"
|
||||
|
||||
RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
msg_info "Installing gatus v${RELEASE}"
|
||||
temp_file=$(mktemp)
|
||||
mkdir -p /opt/gatus
|
||||
curl -fsSL "https://github.com/TwiN/gatus/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
|
||||
tar zxf "$temp_file" --strip-components=1 -C /opt/gatus
|
||||
fetch_and_deploy_gh_release "gatus" "TwiN/gatus" "tarball"
|
||||
|
||||
msg_info "Configuring gatus"
|
||||
cd /opt/gatus
|
||||
$STD go get golang.org/x/net@v0.55.0
|
||||
$STD go mod tidy
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
|
||||
setcap CAP_NET_RAW+ep gatus
|
||||
mv config.yaml config
|
||||
echo "${RELEASE}" >/opt/gatus_version.txt
|
||||
msg_ok "Installed gatus v${RELEASE}"
|
||||
msg_ok "Configured gatus"
|
||||
|
||||
msg_info "Enabling gatus Service"
|
||||
cat <<EOF >/etc/init.d/gatus
|
||||
@@ -99,8 +96,6 @@ EOF
|
||||
msg_info "Starting gatus"
|
||||
$STD service gatus start
|
||||
msg_ok "Started gatus"
|
||||
|
||||
rm -f "$temp_file"
|
||||
}
|
||||
|
||||
run_os_setup
|
||||
|
||||
Reference in New Issue
Block a user