Commit Graph

13 Commits

Author SHA1 Message Date
Jason Staack
b1ac1cce24 feat: v9.8.1 pre-built Docker images and GHCR release workflow
Setup.py now asks whether to pull pre-built images from GHCR
(recommended) or build from source. Pre-built mode skips the
15-minute compile step entirely.

- Add .github/workflows/release.yml (builds+pushes 4 images on tag)
- Add docker-compose.build.yml (source-build overlay)
- Switch docker-compose.prod.yml from build: to image: refs
- Add --build-mode CLI arg and wizard step to setup.py
- Bump version to 9.8.1 across all files
- Document TOD_VERSION env var in CONFIGURATION.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 18:33:12 -05:00
Jason Staack
55266a9188 fix(setup): add sslmode=disable to poller DB URL, add --no-https flag
Go Postgres driver defaults to requiring TLS. Container-to-container
Postgres doesn't have TLS configured. Without sslmode=disable the
poller crashes in a restart loop on fresh installs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:38:51 -05:00
Jason Staack
cb2a311a1f feat(setup): add --no-https flag, ask about HTTPS during domain setup
The wizard previously hardcoded https:// for APP_BASE_URL and
CORS_ORIGINS. LAN and dev deployments without TLS need http:// or
browsers silently drop Secure cookies, causing login to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:30:34 -05:00
Jason Staack
958571c26a feat(setup): add CLI switches for non-interactive setup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:12:15 -05:00
Jason Staack
ecbefae9ab feat: add opt-in anonymous setup telemetry
Instruments setup.py to send per-step diagnostic events to the TOD
telemetry collector when the user opts in. Uses a shared static token
with no registration flow — fully anonymous.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 20:04:26 -05:00
Jason Staack
2ad0367c91 fix(vpn): backport VPN fixes from production debugging
- Fix _commit_and_sync infinite recursion
- Use admin session for subnet_index allocation (bypass RLS)
- Auto-set VPN endpoint from CORS_ORIGINS hostname
- Remove server address field from VPN setup UI
- Add DELETE endpoint and button for VPN config removal
- Add wg-reload watcher for reliable config hot-reload via wg syncconf
- Add wg_status.json writer for live peer handshake status in UI
- Per-tenant SNAT for poller-to-device routing through VPN
- Restrict VPN→eth0 forwarding to Docker networks only (block exit node abuse)
- Use 10.10.0.0/16 allowed-address in RouterOS commands
- Fix structlog event= conflict (use audit=True)
- Export backup_scheduler proxy for firmware/upgrade imports
2026-03-14 20:59:14 -05:00
Jason Staack
b27b0fc946 feat(vpn): update WireGuard forwarding script with tenant isolation rules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:24:30 -05:00
Jason Staack
183f9de0f1 fix(setup): create data dirs with correct ownership and WireGuard forwarding rules
- git-store and firmware-cache owned by appuser (uid 1001)
- wireguard/wg_confs set world-writable for API+WG container sharing
- Auto-create iptables forwarding init script for WireGuard
- Fix init-postgres-prod.sql permissions to 644 (postgres needs to read it)
2026-03-14 11:54:17 -05:00
Jason Staack
b2ea6f0d76 fix(setup): show waiting status during health check with countdown 2026-03-14 10:37:03 -05:00
Jason Staack
a10a0b106c feat(setup): use sudo for writing proxy configs to system directories 2026-03-14 10:29:12 -05:00
Jason Staack
5cf901eda8 feat(setup): add reverse proxy detection and configuration wizard 2026-03-14 10:28:21 -05:00
Jason Staack
4757b93d9d fix(setup): address security and robustness issues
- Use dollar-quoting in generated SQL to prevent injection
- Set .env.prod and init-postgres-prod.sql to mode 0600
- Use run_compose for OpenBao log capture (consistent env-file)
- Prompt user before continuing if OpenBao bootstrap fails
- Improve mask_secret to fully mask short secrets
- Check sysctl return code before parsing RAM
2026-03-14 10:01:44 -05:00
Jason Staack
4885d14a1d feat: add production setup wizard (setup.py)
Interactive Python script that:
- Runs pre-flight checks (Docker, RAM, port conflicts)
- Walks through database, security, admin, email, domain config
- Auto-generates JWT secrets, encryption keys, DB passwords
- Writes .env.prod and init-postgres-prod.sql
- Bootstraps OpenBao (captures unseal key + token from logs)
- Builds images sequentially (avoids OOM)
- Starts the stack and verifies service health
2026-03-14 09:58:16 -05:00