Harden core packages and add interactive CLI config builder (rud config/validate/test)
This commit is contained in:
parent
d37503c863
commit
99e24be6c9
29 changed files with 6763 additions and 165 deletions
16
README.md
16
README.md
|
|
@ -21,6 +21,7 @@ It compiles to a single zero-dependency binary, runs concurrent checks across mu
|
|||
- `dns`: Record resolution (`A`, `AAAA`, `CNAME`, `MX`, `TXT`, `NS`), custom resolvers, and regex validation.
|
||||
- `cmd`: Custom shell commands or scripts with exit code and output regex verification.
|
||||
- **Declarative Event & Alert Engine**: Combine monitor boolean triggers (`all` or `any` of monitor IDs in a state), sustained durations (e.g., `"for": "5h"`), and metric thresholds (`uptime_pct`, `latency_ms`, `consecutive_failures`) using `"and"` / `"or"` logic to trigger outbound webhooks or execute commands.
|
||||
- **Interactive CLI Config Builder (`rud config`)**: Built-in zero-dependency CLI to create new configurations from starter templates or a quick-start wizard, edit existing `rud.json` files (including nested `AND`/`OR` event condition trees, Discord/Slack/ntfy/Gotify webhook presets, and theme presets), test monitors live, validate/lint (`rud validate`), and save atomically with optional `.bak` backups.
|
||||
- **In-Memory Ring Buffer + Optional Persistence**: Maximum speed in-memory circular buffer by default, with optional atomic disk persistence across restarts.
|
||||
- **Docker & Cloudflare Tunnel Ready**: Includes a multi-stage `Dockerfile`, a direct `docker-compose.yml`, and a zero-exposed-port `docker-compose.cloudflared.yml`.
|
||||
|
||||
|
|
@ -34,13 +35,26 @@ It compiles to a single zero-dependency binary, runs concurrent checks across mu
|
|||
# Build the self-contained binary
|
||||
go build -trimpath -ldflags="-s -w" -o rud .
|
||||
|
||||
# (Optional) Generate a default rud.json explicitly
|
||||
# (Optional) Build or edit rud.json interactively
|
||||
./rud config -config rud.json
|
||||
|
||||
# (Optional) Generate a default rud.json non-interactively
|
||||
./rud -init -config rud.json
|
||||
|
||||
# Validate & lint rud.json, or run one-shot live checks
|
||||
./rud validate -config rud.json
|
||||
./rud test -config rud.json
|
||||
|
||||
# Run R u ded? (auto-generates rud.json if not present)
|
||||
./rud -config rud.json
|
||||
```
|
||||
|
||||
#### CLI Subcommands
|
||||
|
||||
- `./rud config [-config path] [-new] [-plain] [-no-color]`: Interactive configuration builder (arrow-key navigation on TTYs with automatic numbered fallback; `-new` forces the starter template / quick-start wizard).
|
||||
- `./rud validate [-config path] [-strict]`: Validates schema, regexes, URLs, and alert templates, and reports lint warnings (unknown JSON fields, dangling monitor IDs). `-strict` treats lint warnings as errors.
|
||||
- `./rud test [-config path] [-json] [-no-retry] [monitor-ids...]`: Executes live monitor checks once and prints results (exits non-zero if any tested monitor is `down`).
|
||||
|
||||
Query the single endpoint:
|
||||
```bash
|
||||
# Minimal HTML Status Page
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue