Batch B2: #12 Docker build, #18 SOAP defaults, #26 cert URLs, #30 ops gaps #55

Merged
amiryahaya merged 2 commits from fix/b2-ops-config into main 2026-11-15 12:20:59 +01:00
Owner

Batch B2: #12 Docker build, #18 SOAP defaults, #26 cert URLs, #30 ops gaps

#12 Build context is the repo root with a root .dockerignore (no more parent-workspace upload, .env/keys excluded). Release path follows ARG MIX_ENV (re-declared in the runner stage). Dev compose uses a dev build target and just runs mix phx.server (no git/SSH/deps.get at runtime).
#30 Layer order manifests → deps → sources. GET /healthz (200 only with Mnesia loaded + Sub CA present; hidden from the internet at Caddy), image HEALTHCHECK, Caddy depends_on: service_healthy, memory limits, persisted Caddy logs, scripts/backup_mnesia.sh, docs/backup-restore.md.
#18 / #26 In :prod, config/runtime.exs requires MDID_PUBLIC_BASE_URL (AIA/OCSP/CRL URLs baked into every certificate; per-URL overrides optional), MDID_SOAP_PROFILE and MDID_SOAP_ENDPOINT; all https-only, no pilot default. NationalIDClient reads the configured endpoint. Dev/test keep code defaults.
Also fixes an A6 regression: base compose required MDID_KEY_ENCRYPTION_KEY even for dev; the release itself still refuses to boot without it.

Breaking

Prod .env needs MDID_PUBLIC_BASE_URL, MDID_SOAP_PROFILE, MDID_SOAP_ENDPOINT (checked by start-docker-prod.sh and the release). Compose build context moved.

NOT verified

  • Docker image was never built (registry unreachable here); Dockerfile stages, HEALTHCHECK and dev target are reviewed by reading only. Compose files validate with docker compose config.
  • Backup script and the container restore commands are unrehearsed; the Mnesia install_fallback mechanism itself was verified locally with plain Elixir.
  • Dev stack binds loopback in config/dev.exs (pre-existing), so Caddy cannot reach it in dev compose.
  • Not done from #26: eMudhra branding and parameterised seeded client credentials.

Review

Pass 1 (ponytail) and Pass 2 done; all Must/Important items fixed (restore procedure, backup trap/exact match, https validation, **/*.pem, duplicate healthcheck, dev start_period, assets setup). Fixes were not re-reviewed by a second Pass 1.

Tests / coverage

290/292 pass; 2 failures are the pre-existing live-site TrustgateLifecycleTest. New: healthz, runtime.exs prod config (required/empty/https/overrides), configured SOAP endpoint. HealthController 80%, NationalIDClient 77.7% (unchanged paths dominate), total 73.9%.

🤖 Generated with Claude Code

## Batch B2: #12 Docker build, #18 SOAP defaults, #26 cert URLs, #30 ops gaps **#12** Build context is the repo root with a root `.dockerignore` (no more parent-workspace upload, `.env`/keys excluded). Release path follows `ARG MIX_ENV` (re-declared in the runner stage). Dev compose uses a `dev` build target and just runs `mix phx.server` (no git/SSH/`deps.get` at runtime). **#30** Layer order manifests → deps → sources. `GET /healthz` (200 only with Mnesia loaded + Sub CA present; hidden from the internet at Caddy), image HEALTHCHECK, Caddy `depends_on: service_healthy`, memory limits, persisted Caddy logs, `scripts/backup_mnesia.sh`, `docs/backup-restore.md`. **#18 / #26** In `:prod`, `config/runtime.exs` requires `MDID_PUBLIC_BASE_URL` (AIA/OCSP/CRL URLs baked into every certificate; per-URL overrides optional), `MDID_SOAP_PROFILE` and `MDID_SOAP_ENDPOINT`; all https-only, no pilot default. `NationalIDClient` reads the configured endpoint. Dev/test keep code defaults. Also fixes an A6 regression: base compose required `MDID_KEY_ENCRYPTION_KEY` even for dev; the release itself still refuses to boot without it. ### Breaking Prod `.env` needs `MDID_PUBLIC_BASE_URL`, `MDID_SOAP_PROFILE`, `MDID_SOAP_ENDPOINT` (checked by `start-docker-prod.sh` and the release). Compose build context moved. ### NOT verified - **Docker image was never built** (registry unreachable here); Dockerfile stages, HEALTHCHECK and dev target are reviewed by reading only. Compose files validate with `docker compose config`. - Backup script and the container restore commands are unrehearsed; the Mnesia `install_fallback` mechanism itself was verified locally with plain Elixir. - Dev stack binds loopback in `config/dev.exs` (pre-existing), so Caddy cannot reach it in dev compose. - Not done from #26: eMudhra branding and parameterised seeded client credentials. ### Review Pass 1 (ponytail) and Pass 2 done; all Must/Important items fixed (restore procedure, backup trap/exact match, https validation, `**/*.pem`, duplicate healthcheck, dev start_period, assets setup). Fixes were not re-reviewed by a second Pass 1. ### Tests / coverage 290/292 pass; 2 failures are the pre-existing live-site `TrustgateLifecycleTest`. New: healthz, runtime.exs prod config (required/empty/https/overrides), configured SOAP endpoint. HealthController 80%, NationalIDClient 77.7% (unchanged paths dominate), total 73.9%. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Refs #12, #18, #26, #30.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fix: B2 review — restore procedure, backup script safety, https-only URLs, dev start_period, hide /healthz at Caddy
All checks were successful
Lint / lint (pull_request) Successful in 2m53s
Security / Dependency advisories (mix hex.audit) (pull_request) Successful in 27s
Security / Secret scan (gitleaks) (pull_request) Successful in 12s
Unit tests / test (pull_request) Successful in 3m57s
c47cfc7031
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.