Skip to content

Add opt-in file-backed Secrets adapter for non-Fly deployments#512

Open
FinanceAlex wants to merge 1 commit into
mkreyman:masterfrom
FinanceAlex:feat/local-file-secrets-adapter
Open

Add opt-in file-backed Secrets adapter for non-Fly deployments#512
FinanceAlex wants to merge 1 commit into
mkreyman:masterfrom
FinanceAlex:feat/local-file-secrets-adapter

Conversation

@FinanceAlex

Copy link
Copy Markdown

Refs #496.

Tenant signup hard-depends on Fly secrets storage: off-platform, FlyAdapter fails signup with {:audit_key_storage_failed, :fly_not_configured} — a fresh non-Fly install cannot create its first tenant.

Change: an opt-in Loopctl.Secrets.LocalFileAdapter (same behaviour contract as FlyAdapter; atomic write via temp+rename; file mode 0600; path from SECRETS_FILE). It is selected in runtime.exs only when SECRETS_ADAPTER=local_file is set — default (Fly) behaviour is unchanged, so this is purely additive for cloud deployments.

I'm aware this one touches product direction (self-hosting) more than the other two PRs, so treat it as a proposal — happy to rework the shape (adapter name, env contract, or moving it under the epic-39 private-tier umbrella) to fit your vision.

Testing: this adapter has been running in my self-hosted deployment since 2026-07-22 (signup, key issuance, daily use). Compile-checked against current master with the Dockerfile's build image.

Tenant signup hard-depends on Fly secrets storage: off-platform,
FlyAdapter fails signup with {:audit_key_storage_failed, :fly_not_configured}.

This adds Loopctl.Secrets.LocalFileAdapter (same behaviour contract as
FlyAdapter, atomic writes, 0600 file mode) selected at runtime only when
SECRETS_ADAPTER=local_file is set. Default (Fly) behaviour is unchanged.

Refs mkreyman/loopctl issue 496.
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