Protocol dd0c Agent
e16f322869
add db-setup service: idempotent per-service Postgres user bootstrap
...
Runs on every 'docker compose up -d' before product services start.
Creates dd0c_{drift,alert,portal,cost,run} users with least-privilege
grants if they don't exist. Fixes auth failures on existing PG volumes
that predate the security hardening.
2026-03-03 05:04:42 +00:00
5a1e287ab6
Add console + marketing site to Docker Compose and build-push
...
- Console: nginx SPA on port 3010, image reg.dd0c.net/dd0c-console
- Marketing: nginx static on port 3011, image reg.dd0c.net/dd0c-marketing
- Dockerfiles + .dockerignore for both
- build-push.sh updated to include console + marketing targets
2026-03-03 00:36:48 +00:00
eb953cdea5
Security hardening: auth encapsulation, pool restriction, rate limiting, invites, async webhooks
...
CI — P2 Drift (Go + Node) / agent (push) Successful in 43s
CI — P2 Drift (Go + Node) / saas (push) Failing after 5s
CI — P3 Alert / test (push) Failing after 4s
CI — P4 Portal / test (push) Failing after 4s
CI — P5 Cost / test (push) Failing after 4s
CI — P6 Run / saas (push) Failing after 5s
CI — P2 Drift (Go + Node) / build-push (push) Failing after 7s
CI — P3 Alert / build-push (push) Has been skipped
CI — P4 Portal / build-push (push) Has been skipped
CI — P5 Cost / build-push (push) Has been skipped
CI — P6 Run / build-push (push) Failing after 5s
Phase 1 (Security Critical):
- Auth plugin encapsulation: replaced global addHook with Fastify plugin scope
- Removed startsWith URL matching; public routes registered outside auth scope
- JWT verify now enforces algorithms: ['HS256'] (prevents algorithm confusion)
- Raw pool no longer exported from db.ts; systemQuery() + getPoolForAuth() instead
- withTenant() remains primary tenant-scoped query path
Phase 2 (Infrastructure):
- docker-compose.yml: all secrets via env var substitution (${VAR:-default})
- Per-service Postgres users (dd0c_drift, dd0c_alert, etc.) in docker-init-db.sh
- .env.example with all configurable secrets
- build-push.sh uses $REGISTRY_PASSWORD instead of hardcoded
- .gitignore excludes .env files
- @fastify/rate-limit: 100 req/min global, 5/min login, 3/min signup
- CORS_ORIGIN default changed from '*' to 'http://localhost:5173 '
Phase 3 (Product):
- Team invite flow: tenant_invites table, POST /invite, GET /invites, DELETE /invites/:id
- Signup accepts optional invite_token to join existing tenant
- Async webhook ingestion (P3): LPUSH to Redis, BRPOP worker, dead-letter queue
Console:
- All 5 product modules wired: drift, alert, portal, cost, run
- PageHeader accepts children prop
- 71 modules, 70KB gzipped production build
All 6 projects compile clean (tsc --noEmit).
2026-03-02 23:53:55 +00:00
6b045637be
Switch registry to reg.dd0c.net (HTTPS on 443)
2026-03-02 13:31:11 +00:00
6b79d3cbc9
Switch to Brian's registry at 192.168.86.11:30095, add CI build+push+deploy jobs
...
- All services pull from 192.168.86.11:30095 instead of localhost:5000
- Removed self-hosted registry container (Brian runs his own)
- CI workflows: test → build → push to registry → deploy
- build-push.sh and watch-loop.sh updated with new registry address
2026-03-02 05:28:35 +00:00
1ea42bbb87
Restore build: directives alongside image: tags — allows both local build and registry pull
2026-03-02 05:21:33 +00:00
41e016e9a6
Add local Docker registry: registry:2 on :5000, build-push.sh, CI auto-deploy
...
- docker-compose services now pull from localhost:5000 instead of building locally
- build-push.sh builds + pushes all 5 Node images to local registry
- CI workflows get build-push job: test → build → push → deploy
- Deploy becomes: docker compose pull && docker compose up -d
- Eliminates silent git pull + stale Docker cache issues
2026-03-02 05:15:37 +00:00
d175c3a6e7
Clean up drift: restore Dockerfile name, remove cache bust artifacts
CI — P2 Drift (Go + Node) / agent (push) Successful in 14s
CI — P2 Drift (Go + Node) / saas (push) Successful in 28s
2026-03-02 04:45:12 +00:00
d55162a047
Force drift rebuild: explicit image tag dd0c-drift:v2
2026-03-02 00:21:12 +00:00
364e411e69
Nuclear cache bust: rename drift Dockerfile to Dockerfile.v2
CI — P2 Drift (Go + Node) / saas (push) Successful in 25s
CI — P2 Drift (Go + Node) / agent (push) Successful in 42s
2026-03-02 00:14:43 +00:00
00aaf1a941
Force drift rebuild: add CACHE_BUST build arg to Dockerfile + docker-compose
CI — P2 Drift (Go + Node) / agent (push) Successful in 10s
CI — P2 Drift (Go + Node) / saas (push) Successful in 27s
2026-03-01 23:06:19 +00:00
580872f059
Fix docker-compose: add NODE_ENV=production to all services (drift crashes on pino-pretty in dev mode)
2026-03-01 20:41:47 +00:00
d6d8de16db
Fix docker-compose: remap Postgres from :5432 to :5433 (5432 already in use on NAS)
2026-03-01 20:34:49 +00:00
aec0d62787
docker-compose: put Rust services behind 'rust' profile so Node services start independently
...
docker compose up -d → starts Node services only (fast)
docker compose --profile rust up -d → starts everything including Rust (slow build)
2026-03-01 19:15:49 +00:00
6c97ce0547
Fix docker-compose: remap P5 cost from :3005 to :3007 (3005 is Gitea)
2026-03-01 19:07:52 +00:00
64213c39e9
Add P1/P2 to docker-compose, mount all 6 migration dirs, add P2 agent Dockerfile
...
- route-api (3001), route-proxy (8080), route-worker as separate services
- drift SaaS (3002) added
- All 6 product migrations mounted into postgres init
- docker-init-db.sh creates all 6 databases
2026-03-01 06:11:20 +00:00
2b86abc18d
Fix docker-compose: use init script for multi-DB setup, fix build context paths
...
- Postgres init: mount docker-init-db.sh to create per-product databases and run migrations
- Fix build contexts: relative to products/ dir (compose lives in products/)
2026-03-01 05:59:27 +00:00
f2e0a32cc7
Wire auth middleware into all products, add docker-compose and init-db script
...
- Auth middleware (JWT + API key + RBAC) copied into P3/P4/P5/P6
- All server entry points now register auth hooks + auth routes
- Webhook and Slack endpoints skip JWT auth (use HMAC/signature)
- docker-compose.yml: shared Postgres + Redis + Meilisearch, all 4 Node products as services
- init-db.sh: creates per-product databases and runs migrations
- P1 (Rust) and P2 (Go agent) run standalone, not in compose
2026-03-01 03:10:35 +00:00