Skip to content

fix(bootstrap): define CODER_ADMIN_* on coder-init-admin, not coder.service#47

Merged
phorcys420 merged 1 commit into
mainfrom
admin-bootstrap-05ha
Jul 1, 2026
Merged

fix(bootstrap): define CODER_ADMIN_* on coder-init-admin, not coder.service#47
phorcys420 merged 1 commit into
mainfrom
admin-bootstrap-05ha

Conversation

@phorcys420

Copy link
Copy Markdown
Member

Summary

Move the admin bootstrap credentials (CODER_ADMIN_EMAIL, CODER_ADMIN_USERNAME, CODER_ADMIN_PASSWORD) out of the long-running coder.service environment and onto the coder-init-admin.service (the bootstrap service that actually consumes them), so they are only present where they are needed.

Changes

  • configuration.nix
    • coder-init-admin.service still inherits coder.service.environment (for CODER_PG_CONNECTION_URL etc.); the CODER_ADMIN_* creds are now merged in on top via systemd.services.coder-init-admin.environment defined in local.nix (NixOS unions attrset option definitions).
    • coder-reset.service (step 8 mints a token using the admin creds) now inherits from coder-init-admin.environment instead of coder.service.
    • Updated comments to note admin creds are deliberately kept off coder.service.
  • local.nix.example — admin creds moved to systemd.services.coder-init-admin.environment; GitHub OAuth block kept under systemd.services.coder.environment (the server reads those).
  • nixos/_images/box-turnkey.nix — turnkey image baked-in admin creds moved to coder-init-admin.environment.
  • hosts/incus-vm/README.md — doc updated to the new option path.

Verification

Evaluated with Nix against the turnkey appliance config:

  • coder-init-admin.environment contains the CODER_ADMIN_* creds and inherits CODER_PG_CONNECTION_URL. ✅
  • coder.service.environment contains no CODER_ADMIN_*. ✅
  • nix flake show evaluates; all edited .nix files parse.

Refs #29

…ervice

Move the admin bootstrap credentials (CODER_ADMIN_EMAIL/USERNAME/PASSWORD)
out of the long-running coder.service environment and onto the
coder-init-admin.service (and its dependent coder-reset.service), so they
are only present where the bootstrap actually needs them.

coder-init-admin and coder-reset still inherit coder.service's environment
for CODER_PG_CONNECTION_URL; the admin creds are merged in via
systemd.services.coder-init-admin.environment in local.nix. GitHub OAuth
vars remain on coder.service since the server reads them.

Refs #29
@phorcys420 phorcys420 force-pushed the admin-bootstrap-05ha branch from dd7149a to 11ce2a8 Compare June 30, 2026 23:22
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

📀 ISO build artifacts

Kind Arch Size Download
Installer aarch64 3.49 GB ⬇️ coder-box-installer-aarch64-linux.iso
Installer x86_64 3.67 GB ⬇️ coder-box-installer-x86_64-linux.iso

↻ Updated for 11ce2a8 · run #82 · artifacts expire in ~1 day · sign in to GitHub to download.

@phorcys420 phorcys420 merged commit b0c6fbb into main Jul 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant