Skip to content

feat(infra): plumb BUSCASAM_DOCENTE_EMAIL_ALLOWLIST to prod#162

Merged
LucasACH merged 1 commit into
mainfrom
feat/docente-allowlist-infra
Jun 17, 2026
Merged

feat(infra): plumb BUSCASAM_DOCENTE_EMAIL_ALLOWLIST to prod#162
LucasACH merged 1 commit into
mainfrom
feat/docente-allowlist-infra

Conversation

@LucasACH

Copy link
Copy Markdown
Owner

What

Wires the docente email-allowlist setting (ADR-0005 item 17; backend code shipped in v1.4.3) through to the running prod container. It was previously un-plumbed, so setting it had no effect.

Why it was a no-op

  • compose.yaml passes containers an explicit environment: map (no env_file), and it didn't list BUSCASAM_DOCENTE_EMAIL_ALLOWLIST.
  • startup.sh assembles the VM's .env from a fixed heredoc that also didn't include it.

So the var never reached the api container regardless of .env.

Changes

File Change
infra/compose.yaml BUSCASAM_DOCENTE_EMAIL_ALLOWLIST: ${BUSCASAM_DOCENTE_EMAIL_ALLOWLIST:-} in &backend_env (shared with workers)
infra/terraform/modules/app-vm/startup.sh emit the var into the generated .env from a template var
infra/terraform/modules/app-vm/main.tf pass docente_email_allowlist into the templatefile call
infra/terraform/modules/app-vm/variables.tf + variables.tf (root) + main.tf (module wiring) new docente_email_allowlist tf variable, default ""
infra/.env.example document the knob

Default is "" → no-op until set. The value is provided per-env via the gitignored terraform.tfvars (not in this PR).

Verification

  • terraform fmt -check -recursive: clean
  • terraform validate: Success

Deploy sequence (after merge)

  1. New release tag → VM picks up the new compose.yaml (references the var).
  2. Set docente_email_allowlist = "achaval.lucas@gmail.com" in terraform.tfvars, terraform apply (in-place VM metadata update).
  3. Activate the value in the running .env (VM reboot regenerates .env via startup.sh, or a one-time .env line + api restart).

🤖 Generated with Claude Code

The docente email-allowlist setting (ADR-0005 item 17, backend shipped in
v1.4.3) had no path to the running container: compose passes an explicit
environment: map (no env_file) and startup.sh assembles .env from a fixed
list — neither referenced the new var, so it was a silent no-op in prod.

Wire it end to end:
- compose.yaml &backend_env: BUSCASAM_DOCENTE_EMAIL_ALLOWLIST passthrough
- startup.sh .env heredoc: emit it from a new template var
- app-vm + root `docente_email_allowlist` tf variable (default "", so a
  no-op until set) threaded into the templatefile call
- .env.example: document the knob

Value is set per-env via the gitignored terraform.tfvars; empty disables
the override. Survives reboots (startup.sh) and redeploys (compose from
config.tgz).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LucasACH
LucasACH requested a review from MarcosACH as a code owner June 17, 2026 20:06
@LucasACH
LucasACH merged commit 6f29225 into main Jun 17, 2026
3 checks passed
@LucasACH
LucasACH deleted the feat/docente-allowlist-infra branch June 17, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant