Repository navigation
Commit 30ece3b
LudoLoops
fix(dashboard): validate effective Compose and isolate DB commands (#589)
Addresses the two remaining blockers from the PR #660 review.
B-01 — effective Compose provenance:
- a managed `docker-compose.yml` must now be byte-identical to the canonical
generated document; any added/overriding YAML property is refused;
- Compose override files (`compose.override*`, `docker-compose.override*`,
`compose.yaml`, …) and ambient `COMPOSE_*` controls (COMPOSE_FILE,
COMPOSE_PROJECT_NAME, COMPOSE_PROFILES, …) are rejected before any write or
Compose operation;
- the effective model is parsed by Compose itself (`docker compose config
--format json`, with candidate .env values) and validated for exactly one
service, image, loopback port/published mapping, named volume, environment,
health check and absence of network_mode — before `.env` is written or the
container is started.
B-02 — the verified connection is authoritative:
- `auth:schema`, `db:push` and `admin:create` run with a sanitized child
environment: ambient DATABASE_URL/TEST_DATABASE_URL/PG*/DRIZZLE_* are
removed and DATABASE_URL is set to the verified `.env` URL. An exported
remote DATABASE_URL can no longer redirect `db:push --force`; this is
announced explicitly when it differs.
Tests: override file, ambient COMPOSE_FILE, effective extra ports, canonical
tampering, ambient hostile DATABASE_URL for schema and admin (asserting the
child env), plus the existing refusals. Real-Compose smoke now provisions with
hostile ambient DB vars and asserts override/control refusals.
Validated: `bun run test` 1398 passed, lint, typecheck,
`scripts/test-local-setup.sh` (real Compose/PostgreSQL, positive + hostile
paths), `scripts/test-scaffold.sh dashboard`.
Refs #589.1 parent d6fe739 commit 30ece3b
8 files changed
Lines changed: 586 additions & 140 deletions
File tree
- .changeset
- graphify-out
- packages/svforge
- src
- templates/dashboard/root/scripts
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
0 commit comments