apps/console/README.md and lib/watch/types.ts already documented WATCH_AGENT_TOKEN and RAILYARD_WATCH_LIVE as if stacks/gatus-customers/agent.sh existed. It did not -- the console side (agentChecks/recordResults, the /api/v1/watch/agent/* routes) had nothing on the other end to call it, so Watch could never actually turn on. Adds the real box 1 stack: a Gatus probe engine (docker-compose.yml, config.yaml) plus agent.sh, the bridge that pulls the console's check list, regenerates Gatus's config, reads Gatus's own results, and pushes them back -- stateless by design since the console already dedupes by last_checked_at. Plus agent.env.sample, a systemd unit and install.sh (same shape as tools/reconcile-relay-rago). Verified against real components: a real ghcr.io/twin/gatus:stable container and a scratch server wiring the exact shipped lib/watch/http.ts handlers to a MemoryWatchStore, exercised end to end over two passes against a real https://example.com check -- which caught and fixed two real bugs (Gatus refuses to start with zero endpoints; the generated config's timestamp was forcing a gatus restart on every single pass). Container, volume and image removed afterward; apps/console's existing 167 tests and 3 bundle tests pass unchanged (this item touched no console source file).
21 lines
833 B
Plaintext
21 lines
833 B
Plaintext
# Rename to agent.env (same directory) and fill in. Never commit the real file.
|
|
# Mirrors the two console-side env vars documented in apps/console/README.md:
|
|
# RAILYARD_WATCH_LIVE=1 (console, turns the feature on)
|
|
# WATCH_AGENT_TOKEN=<this token> (console AND here — same value both places)
|
|
|
|
# The console's public base URL (no trailing slash).
|
|
WATCH_CONSOLE_URL=https://console.example.com
|
|
|
|
# >= 32 chars, random. Generate with: openssl rand -hex 32
|
|
# Must equal the console's WATCH_AGENT_TOKEN exactly.
|
|
WATCH_AGENT_TOKEN=
|
|
|
|
# Usually fine as-is: matches docker-compose.yml's loopback port mapping.
|
|
GATUS_URL=http://127.0.0.1:8083
|
|
|
|
# How often agent.sh takes a pass, in `agent.sh` (no argument, loop mode).
|
|
WATCH_POLL_INTERVAL_S=30
|
|
|
|
# Per-request timeout for every curl call this script makes.
|
|
WATCH_HTTP_TIMEOUT_S=10
|