commit fc0e7d1babccc2eb2c7971adb5649592e3365a29 Author: Blake Ridgway Date: Sat Mar 21 18:01:06 2026 -0500 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..e357251 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# arcline-uptime + +Lightweight uptime monitor for HTTP and TCP endpoints. Polls on a schedule, stores results in SQLite, sends alerts via Discord webhook or email. Includes an embedded web dashboard. + +No external services required — runs as a single binary on any Linux server. + +## Status + +Planned. Not yet started. + +## Stack + +- Go — single static binary +- SQLite via `modernc.org/sqlite` (pure Go, no CGO) +- Config: YAML +- Alerts: Discord webhook, SMTP email + +## Usage + +```sh +arcline-uptime start --config uptime.yaml +arcline-uptime check --config uptime.yaml --monitor "Main Website" # one-off check +``` + +Dashboard available at `http://localhost:8081` (configurable). + +## Config + +```yaml +global: + check_interval: 60 + timeout: 10 + alert_cooldown: 300 + +alerts: + - type: discord + webhook_url: "https://discord.com/api/webhooks/..." + +monitors: + - name: "Main Website" + type: http + url: "https://arclineit.com" + expected_status: 200 + contains: "[arcline]" + + - name: "SSH" + type: tcp + host: "server1.arclineit.com" + port: 22 +``` + +## Dashboard routes + +- `/` — current status of all monitors +- `/history` — response time graph +- `/metrics` — Prometheus-compatible endpoint (optional) + +Protected by basic auth configured in YAML. + +See [todo.md](todo.md) for the full task list. diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..b6c7ded --- /dev/null +++ b/todo.md @@ -0,0 +1,84 @@ +# arcline-uptime — Lightweight Uptime Monitor + +Polls HTTP/TCP endpoints on a schedule, stores results in SQLite, sends alerts +via webhook (Discord, Slack) and/or email. Single binary, no external services. + +## Stack +- Language: Go +- Storage: SQLite (via modernc.org/sqlite — pure Go, no CGO) +- Config: YAML +- Alerts: HTTP webhook (Discord/Slack compatible), SMTP email +- Optional UI: embedded web dashboard (net/http + Go templates) + +## Config format (uptime.yaml) +```yaml +global: + check_interval: 60 # seconds + timeout: 10 # seconds per check + alert_cooldown: 300 # seconds between repeat alerts for same monitor + +alerts: + - type: discord + webhook_url: "https://discord.com/api/webhooks/..." + - type: email + smtp_host: mail.arclineit.com + smtp_port: 587 + from: alerts@arclineit.com + to: blake@arclineit.com + +monitors: + - name: "Main Website" + type: http + url: "https://arclineit.com" + expected_status: 200 + contains: "[arcline]" # optional string check in body + + - name: "Control Panel" + type: http + url: "https://cp.arclineit.com" + expected_status: 200 + + - name: "SSH" + type: tcp + host: "server1.arclineit.com" + port: 22 + + - name: "Mail Server" + type: tcp + host: "mail.arclineit.com" + port: 587 +``` + +## Web dashboard +- `/` — current status of all monitors (live, auto-refresh) +- `/history` — response time graph (ASCII sparklines or simple SVG) +- `/metrics` — Prometheus-compatible text endpoint (optional) +- Protected by basic auth (config: dashboard.username / dashboard.password) + +## Alert format (Discord example) +``` +[DOWN] Main Website +Expected 200, got 503 +Checked at 2026-03-03 14:32:01 UTC +Response time: 8043ms (timeout) +``` + +## Tasks +- [ ] Project scaffold +- [ ] YAML config parser +- [ ] HTTP monitor (status code, body contains, response time) +- [ ] TCP monitor (dial timeout) +- [ ] Scheduler (ticker per monitor, respect interval) +- [ ] SQLite schema (monitors, checks, alerts_sent) +- [ ] Result storage +- [ ] Discord webhook alerter +- [ ] SMTP email alerter +- [ ] Alert cooldown logic (don't spam on sustained outage) +- [ ] Recovery alert ("Main Website is back up, was down 12m 34s") +- [ ] Web dashboard — current status page +- [ ] Web dashboard — history / sparkline graph +- [ ] /metrics Prometheus endpoint +- [ ] Basic auth for dashboard +- [ ] systemd unit file example +- [ ] README with self-hosting guide +- [ ] Cross-compile Makefile