Skip to content

fix(settings): bridge REQUIRE_API_KEY env var to requireApiKey setting - #3080

Closed
thatssoheil wants to merge 1 commit into
decolua:masterfrom
thatssoheil:fix/2834-require-api-key-env
Closed

fix(settings): bridge REQUIRE_API_KEY env var to requireApiKey setting#3080
thatssoheil wants to merge 1 commit into
decolua:masterfrom
thatssoheil:fix/2834-require-api-key-env

Conversation

@thatssoheil

@thatssoheil thatssoheil commented Aug 6, 2026

Copy link
Copy Markdown

What

Bridges the REQUIRE_API_KEY env var to the requireApiKey dashboard setting: env initializes the default (true/1/yes/on honored), a stored dashboard value still wins. Read lazily so env set after import is honored.

Note on the default change

The code default was requireApiKey: true but the README (line ~1303) documents the default as false. This aligns code with docs: fresh installs default to open (README behavior), REQUIRE_API_KEY=true restores enforcement, and a stored dashboard value always wins (existing installs with the toggle on keep auth).

Closes #2834

The README documents REQUIRE_API_KEY=true as the way to enforce a Bearer
API key on /v1/* for internet-exposed deploys, but nothing in the runtime
ever read it - the 9 enforcement sites only checked the dashboard DB
setting, which defaults to true (locking local-only installs out until
toggled). Resolve the env var as the default at merge time so a fresh
deploy honors REQUIRE_API_KEY, while a stored dashboard setting still
wins over the env default.

Closes decolua#2834
Copilot AI lite review requested due to automatic review settings August 6, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thatssoheil

Copy link
Copy Markdown
Author

Closing as superseded: maintainer claytontavaresdan already bridged REQUIRE_API_KEY to requireApiKey in #3120 (settingsRepo defaults). His reads the env at module load and only accepts exactly "true"; mine accepted true/1/yes/on at merge time, so cherry-pick envTruthy() if wanted.

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.

REQUIRE_API_KEY documented in README is never read — no enforcement on internet-exposed deploys

2 participants