Skip to content

Commit 704073c

Browse files
gatus (#4443)
* 'Add new script' * Update ct/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 22e1518 commit 704073c

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

ct/gatus.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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="gatus"
9+
var_tags="${var_tags:-monitoring}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-1024}"
12+
var_disk="${var_disk:-4}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
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+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/gatus ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
32+
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
33+
msg_info "Updating $APP"
34+
35+
msg_info "Stopping $APP"
36+
systemctl stop gatus
37+
msg_ok "Stopped $APP"
38+
39+
msg_info "Updating $APP to v${RELEASE}"
40+
mv /opt/gatus/config/config.yaml /opt
41+
rm -rf /opt/gatus/*
42+
temp_file=$(mktemp)
43+
curl -fsSL "https://github.com/TwiN/gatus/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
44+
tar zxf "$temp_file" --strip-components=1 -C /opt/gatus
45+
cd /opt/gatus
46+
$STD go mod tidy
47+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
48+
setcap CAP_NET_RAW+ep gatus
49+
mv /opt/config.yaml config
50+
echo "${RELEASE}" >/opt/${APP}_version.txt
51+
msg_ok "Updated $APP to v${RELEASE}"
52+
53+
msg_info "Starting $APP"
54+
systemctl start gatus
55+
msg_ok "Started $APP"
56+
57+
msg_info "Cleaning Up"
58+
rm -f "$temp_file"
59+
msg_ok "Cleanup Completed"
60+
61+
msg_ok "Update Successful"
62+
else
63+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
64+
fi
65+
exit
66+
}
67+
68+
start
69+
build_container
70+
description
71+
72+
msg_ok "Completed Successfully!\n"
73+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
74+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
75+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

ct/headers/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+
/____/

install/gatus-install.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 apt-get install -y \
18+
ca-certificates \
19+
libcap2-bin
20+
msg_ok "Installed Dependencies"
21+
22+
install_go
23+
24+
RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
25+
msg_info "Setting up gatus v${RELEASE}"
26+
temp_file=$(mktemp)
27+
mkdir -p /opt/gatus
28+
curl -fsSL "https://github.com/TwiN/gatus/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
29+
tar zxf "$temp_file" --strip-components=1 -C /opt/gatus
30+
cd /opt/gatus
31+
$STD go mod tidy
32+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
33+
setcap CAP_NET_RAW+ep gatus
34+
mv config.yaml config
35+
echo "${RELEASE}" >/opt/gatus_version.txt
36+
msg_ok "Done setting up gatus"
37+
38+
msg_info "Creating Service"
39+
cat <<EOF >/etc/systemd/system/gatus.service
40+
[Unit]
41+
Description=gatus Service
42+
After=network.target
43+
44+
[Service]
45+
Type=simple
46+
User=root
47+
WorkingDirectory=/opt/gatus
48+
ExecStart=/opt/gatus/gatus
49+
Restart=always
50+
51+
[Install]
52+
WantedBy=multi-user.target
53+
EOF
54+
systemctl enable -q --now gatus
55+
msg_ok "Created Service"
56+
57+
motd_ssh
58+
customize
59+
60+
msg_info "Cleaning up"
61+
rm -f "$temp_file"
62+
$STD apt-get -y autoremove
63+
$STD apt-get -y autoclean
64+
msg_ok "Cleaned"
65+
66+
motd_ssh
67+
customize

0 commit comments

Comments
 (0)