Commit Graph

9 Commits

Author SHA1 Message Date
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