Skip to content

Commit cf1b13e

Browse files
alpine-gatus (#4442)
* 'Add new script' * Update ct/alpine-gatus.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 9a3b2c0 commit cf1b13e

File tree

4 files changed

+184
-0
lines changed

4 files changed

+184
-0
lines changed

ct/alpine-gatus.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/TwiN/gatus
7+
8+
APP="Alpine-gatus"
9+
var_tags="${var_tags:-alpine;monitoring}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-256}"
12+
var_disk="${var_disk:-3}"
13+
var_os="${var_os:-alpine}"
14+
var_version="${var_version:-3.21}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
25+
if [[ ! -d /opt/gatus ]]; then
26+
msg_error "No ${APP} Installation Found!"
27+
exit 1
28+
fi
29+
RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
30+
if [ "${RELEASE}" != "$(cat /opt/gatus_version.txt)" ] || [ ! -f /opt/gatus_version.txt ]; then
31+
msg_info "Updating ${APP} LXC"
32+
$STD apk -U upgrade
33+
$STD service gatus stop
34+
mv /opt/gatus/config/config.yaml /opt
35+
rm -rf /opt/gatus/*
36+
temp_file=$(mktemp)
37+
curl -fsSL "https://github.com/TwiN/gatus/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
38+
tar zxf "$temp_file" --strip-components=1 -C /opt/gatus
39+
cd /opt/gatus
40+
$STD go mod tidy
41+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
42+
setcap CAP_NET_RAW+ep gatus
43+
mv /opt/config.yaml config
44+
rm -f "$temp_file"
45+
echo "${RELEASE}" >/opt/gatus_version.txt
46+
$STD service gatus start
47+
msg_ok "Updated Successfully"
48+
else
49+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
50+
fi
51+
52+
exit 0
53+
}
54+
55+
start
56+
build_container
57+
description
58+
59+
msg_ok "Completed Successfully!\n"
60+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
61+
echo -e "${INFO}${YW} Access it using the following IP:${CL}"
62+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

ct/headers/alpine-gatus

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
___ __ _ __
2+
/ | / /___ (_)___ ___ ____ _____ _/ /___ _______
3+
/ /| | / / __ \/ / __ \/ _ \______/ __ `/ __ `/ __/ / / / ___/
4+
/ ___ |/ / /_/ / / / / / __/_____/ /_/ / /_/ / /_/ /_/ (__ )
5+
/_/ |_/_/ .___/_/_/ /_/\___/ \__, /\__,_/\__/\__,_/____/
6+
/_/ /____/

frontend/public/json/gatus.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "Alpine-gatus",
3+
"slug": "alpine-gatus",
4+
"categories": [
5+
9
6+
],
7+
"date_created": "2025-05-06",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8080,
12+
"documentation": "https://gatus.io/docs",
13+
"website": "https://gatus.io/",
14+
"logo": "https://raw.githubusercontent.com/TwiN/gatus/refs/heads/master/web/static/img/logo.svg",
15+
"config_path": "/opt/gatus/config/config.yaml",
16+
"description": "Gatus is a developer-oriented health dashboard that gives you the ability to monitor your services using HTTP, ICMP, TCP, and even DNS queries as well as evaluate the result of said queries by using a list of conditions on values like the status code, the response time, the certificate expiration, the body and many others. The icing on top is that each of these health checks can be paired with alerting via Slack, Teams, PagerDuty, Discord, Twilio and many more.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/gatus.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 512,
24+
"hdd": 4,
25+
"os": "debian",
26+
"version": "12"
27+
}
28+
},
29+
{
30+
"type": "alpine",
31+
"script": "ct/alpine-gatus.sh",
32+
"resources": {
33+
"cpu": 1,
34+
"ram": 256,
35+
"hdd": 3,
36+
"os": "alpine",
37+
"version": "3.21"
38+
}
39+
}
40+
],
41+
"default_credentials": {
42+
"username": null,
43+
"password": null
44+
},
45+
"notes": []
46+
}

install/alpine-gatus-install.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/TwiN/gatus
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing dependencies"
17+
$STD apk add --no-cache \
18+
ca-certificates \
19+
libcap-setcap
20+
$STD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community go
21+
msg_ok "Installed dependencies"
22+
23+
RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
24+
msg_info "Installing gatus v${RELEASE}"
25+
temp_file=$(mktemp)
26+
mkdir -p /opt/gatus
27+
curl -fsSL "https://github.com/TwiN/gatus/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
28+
tar zxf "$temp_file" --strip-components=1 -C /opt/gatus
29+
cd /opt/gatus
30+
$STD go mod tidy
31+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
32+
setcap CAP_NET_RAW+ep gatus
33+
mv config.yaml config
34+
echo "${RELEASE}" >/opt/gatus_version.txt
35+
msg_ok "Installed gatus v${RELEASE}"
36+
37+
msg_info "Enabling gatus Service"
38+
cat <<EOF >/etc/init.d/gatus
39+
#!/sbin/openrc-run
40+
description="gatus Service"
41+
directory="/opt/gatus"
42+
command="/opt/gatus/gatus"
43+
command_args=""
44+
command_background="true"
45+
command_user="root"
46+
pidfile="/var/run/gatus.pid"
47+
48+
export GATUS_CONFIG_PATH=""
49+
export GATUS_LOG_LEVEL="INFO"
50+
export PORT="8080"
51+
52+
depend() {
53+
use net
54+
}
55+
EOF
56+
chmod +x /etc/init.d/gatus
57+
$STD rc-update add gatus default
58+
msg_ok "Enabled gatus Service"
59+
60+
msg_info "Starting gatus"
61+
$STD service gatus start
62+
msg_ok "Started gatus"
63+
64+
motd_ssh
65+
customize
66+
67+
msg_info "Cleaning up"
68+
rm -f "$temp_file"
69+
$STD apk cache clean
70+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)