Repository navigation
feat: add independent Gatus monitoring and healthcheck integration #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DenizAltunkapan
merged 21 commits into
Vault-Web:main
from
prashantpiyush1111:feature/32-independent-gatus-monitoring
Nov 3, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e24bf77
feat(monitoring): add independent Gatus and host heartbeats
prashantpiyush1111 99396ee
fix(monitoring): align WebSocket checks with Gatus config
prashantpiyush1111 ec2b2d6
fix(monitoring): align WebSocket checks with Gatus config
prashantpiyush1111 52aa1e2
fix(monitoring): align WebSocket checks with Gatus config
prashantpiyush1111 75164ea
fix(monitoring): align WebSocket checks with Gatus config
prashantpiyush1111 ba937ec
fix(monitoring): align websocket checks with Gatus
prashantpiyush1111 059df46
fix(monitoring): align websocket checks with Gatus
prashantpiyush1111 92ecb7e
fix(monitoring): align websocket checks with Gatus
prashantpiyush1111 8d26ece
fix(monitoring): align websocket checks with Gatus
prashantpiyush1111 538c8e6
docs(monitoring): clarify backup heartbeat installation
prashantpiyush1111 9bb46bf
fix(monitoring): load host heartbeat credentials
prashantpiyush1111 0b6c4aa
fix(monitoring): extract Gatus release archive
prashantpiyush1111 36b4aef
fix(monitoring): restrict installer temporary file permissions
prashantpiyush1111 a1f5ed1
fix(monitoring): normalize Gatus configuration
prashantpiyush1111 fed1d5d
fix(monitoring): install Gatus from Go module
prashantpiyush1111 9f531b7
fix(monitoring): bind Gatus dashboard to loopback
prashantpiyush1111 1488e69
docs(monitoring): document local Gatus dashboard access
prashantpiyush1111 d6ade4d
fix(monitoring): add Cloud Page backend probe URL
prashantpiyush1111 c3aee16
fix(monitoring): monitor Cloud Page backend health
prashantpiyush1111 dd2e6da
fix(monitoring): report configured backup heartbeat
prashantpiyush1111 6914197
docs(monitoring): wire backup heartbeat after successful backup
prashantpiyush1111 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Gatus runs on the host, outside the application Compose project. | ||
| # Keep the dashboard local; access it through SSH tunnelling or an authenticated proxy. | ||
| web: | ||
| address: 127.0.0.1 | ||
| port: 8082 | ||
|
|
||
| # Set variables in /etc/gatus/gatus.env to the same routes users visit. | ||
| endpoints: | ||
| - name: Vault Web | ||
| group: Vault Web | ||
| url: "${VAULT_WEB_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[STATUS] == 200" | ||
| - "[RESPONSE_TIME] < 5000" | ||
|
|
||
| - name: Cloud Page | ||
| group: Vault Web | ||
| url: "${CLOUD_PAGE_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[STATUS] == 200" | ||
| - "[RESPONSE_TIME] < 5000" | ||
|
|
||
| # A deliberately unknown public Secure Send token exercises the Cloud Page | ||
| # backend (and its database) through the same /cloud-api/ reverse-proxy route. | ||
| # The expected 404 and response text prove the request reached the application; | ||
| # a stopped backend returns a proxy error/connection failure instead. | ||
| - name: Cloud Page backend | ||
| group: Vault Web | ||
| url: "${CLOUD_PAGE_BACKEND_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[STATUS] == 404" | ||
| - "[BODY] == pat(*Secure Send link is unavailable*)" | ||
| - "[RESPONSE_TIME] < 5000" | ||
|
|
||
| - name: Vaultwarden | ||
| group: Supporting services | ||
| url: "${VAULTWARDEN_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[STATUS] == 200" | ||
| - "[RESPONSE_TIME] < 5000" | ||
|
|
||
| - name: Vault Habits | ||
| group: Supporting services | ||
| url: "${VAULT_HABITS_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[STATUS] == 200" | ||
| - "[RESPONSE_TIME] < 5000" | ||
|
|
||
| # Gatus natively performs a WebSocket handshake for ws:// and wss:// URLs. | ||
| - name: Vault Web chat WebSocket | ||
| group: Realtime | ||
| url: "${VAULT_WEBSOCKET_URL}" | ||
| interval: 1m | ||
| conditions: | ||
| - "[CONNECTED] == true" | ||
| - "[RESPONSE_TIME] < 5000" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Copy to /etc/gatus/gatus.env and replace example URLs. | ||
| # The host running Gatus must have the same VPN/DNS access as its users. | ||
| VAULT_WEB_URL=https://vault.example.com/ | ||
| CLOUD_PAGE_URL=https://vault.example.com/cloud/ | ||
|
DenizAltunkapan marked this conversation as resolved.
Resolved
|
||
| # This deliberately probes a nonexistent Secure Send token. The Cloud Page | ||
| # backend should return 404 with "Secure Send link is unavailable". | ||
| CLOUD_PAGE_BACKEND_URL=https://vault.example.com/cloud-api/public/secure-sends/gatus-health-probe/meta | ||
| VAULTWARDEN_URL=https://vaultwarden.example.internal/ | ||
| VAULT_HABITS_URL=https://habits.example.com/ | ||
| VAULT_WEBSOCKET_URL=wss://vault.example.com/ws-chat | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [Unit] | ||
| Description=Gatus external service health monitoring | ||
| Documentation=https://github.com/TwiN/gatus | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
| # When tailscaled provides the private route, optionally add: | ||
| # Wants=tailscaled.service | ||
| # After=tailscaled.service | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=gatus | ||
| Group=gatus | ||
| EnvironmentFile=/etc/gatus/gatus.env | ||
| Environment=GATUS_CONFIG_PATH=/etc/gatus/config.yaml | ||
| ExecStart=/usr/local/bin/gatus | ||
| Restart=on-failure | ||
| RestartSec=5s | ||
| NoNewPrivileges=true | ||
| PrivateTmp=true | ||
| ProtectSystem=strict | ||
| ProtectHome=true | ||
| ReadWritePaths=/var/lib/gatus | ||
| StateDirectory=gatus | ||
| UMask=0077 | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Install the official Gatus binary from its pinned Go module version. | ||
| GATUS_VERSION="${GATUS_VERSION:-v5.15.0}" | ||
| MIN_GO_VERSION="1.23.3" | ||
|
|
||
| if [[ "$(id -u)" -ne 0 ]]; then | ||
| echo "Run this script with sudo/root." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v go >/dev/null 2>&1; then | ||
| echo "Go >= ${MIN_GO_VERSION} is required to install Gatus." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| GO_VERSION="$(go version | awk '{print $3}' | sed 's/^go//')" | ||
| if [[ "$(printf '%s\n' "$MIN_GO_VERSION" "$GO_VERSION" | sort -V | head -n1)" != "$MIN_GO_VERSION" ]]; then | ||
| echo "Go >= ${MIN_GO_VERSION} is required; found ${GO_VERSION}." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| TMP_DIR="$(mktemp -d)" | ||
| trap 'rm -rf "$TMP_DIR"' EXIT | ||
| umask 077 | ||
|
|
||
| mkdir -p "$TMP_DIR/bin" | ||
|
|
||
| CGO_ENABLED=0 GOBIN="$TMP_DIR/bin" \ | ||
| go install "github.com/TwiN/gatus/v5@${GATUS_VERSION}" | ||
|
|
||
| if [[ ! -x "$TMP_DIR/bin/gatus" ]]; then | ||
| echo "Gatus binary installation failed." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| install -o root -g root -m 0755 "$TMP_DIR/bin/gatus" /usr/local/bin/gatus | ||
|
|
||
| if ! getent group gatus >/dev/null; then | ||
| groupadd --system gatus | ||
| fi | ||
| if ! id gatus >/dev/null 2>&1; then | ||
| useradd --system --gid gatus --home-dir /var/lib/gatus --no-create-home --shell /usr/sbin/nologin gatus | ||
| fi | ||
|
|
||
| install -d -o root -g gatus -m 0750 /etc/gatus | ||
| install -d -o gatus -g gatus -m 0750 /var/lib/gatus | ||
| install -o root -g root -m 0644 "$SCRIPT_DIR/config.yaml" /etc/gatus/config.yaml | ||
| install -o root -g root -m 0644 "$SCRIPT_DIR/gatus.service" /etc/systemd/system/gatus.service | ||
|
|
||
| if [[ ! -f /etc/gatus/gatus.env ]]; then | ||
| install -o root -g gatus -m 0640 "$SCRIPT_DIR/gatus.env.example" /etc/gatus/gatus.env | ||
| echo "Created /etc/gatus/gatus.env. Set your real user-facing URLs." | ||
| else | ||
| echo "Keeping existing /etc/gatus/gatus.env" | ||
| fi | ||
|
|
||
| systemctl daemon-reload | ||
| echo "Gatus installed. Edit /etc/gatus/gatus.env, then run: systemctl enable --now gatus" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| # Called by backup-vault-users.service only after the backup command succeeds. | ||
| if [[ -z "${HC_BACKUP_UUID:-}" ]]; then | ||
| echo "HC_BACKUP_UUID is unset; skipping optional backup heartbeat." >&2 | ||
| exit 0 | ||
| fi | ||
| curl --fail --silent --show-error --max-time 10 "https://hc-ping.com/$HC_BACKUP_UUID" >/dev/null | ||
| echo "Backup heartbeat sent to healthchecks.io." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [Unit] | ||
| Description=Optional healthchecks.io host heartbeat | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| EnvironmentFile=-/etc/default/vault-web-heartbeats | ||
| ExecStart=/usr/local/sbin/vault-web-host-heartbeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| # Optional healthchecks.io heartbeat. Missing UUID is intentionally a no-op. | ||
| [[ -n "${HC_HOST_UUID:-}" ]] || exit 0 | ||
| curl --fail --silent --show-error --max-time 10 "https://hc-ping.com/$HC_HOST_UUID" >/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [Unit] | ||
| Description=Send host uptime heartbeat every five minutes | ||
|
|
||
| [Timer] | ||
| OnBootSec=2min | ||
| OnUnitActiveSec=5min | ||
| Persistent=true | ||
|
|
||
| [Install] | ||
| WantedBy=timers.target |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.