Repository navigation
feat(ingest): set the first ingest token from configuration - #450
Merged
Merged
Conversation
Ingest stays closed until an administrator issues a token by hand, so an automated install cannot accept telemetry as soon as it starts. FANOUT_INGEST_TOKEN (or its _FILE form) now supplies the first token. Its hash is stored at startup only when no hash exists, so a token rotated in the UI survives restarts. The value must match the ingest token format, and a malformed one fails configuration load naming only the setting. Closes #446
vishr
enabled auto-merge (squash)
November 8, 2026 16:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #446
What changed
An automated install can now accept telemetry as soon as it starts.
FANOUT_INGEST_TOKEN(orFANOUT_INGEST_TOKEN_FILE) supplies the first ingest token.foi_plus 43 base64url characters fails configuration load. The error names the setting and never the value.ingest_key.rotatedaudit event withsource: configuration.ingest_token. The login UI treats that response as a normal sign-in..env.exampleare regenerated. Send-telemetry, first-boot, deploy, operations and authentication docs are updated, including removing the deploy guide's statement that no such setting exists.For reviewers
settingsStoreandauditStoremoved earlier inmainfor this reason.Validateuses the samesecret.ValidSecret(value, "foi_")as ingest auth.internal/configcannot importinternal/settings, becausesettingsdepends onauth, whichconfigalready imports.Verification
Ran:
just check, through the pre-push hook on this commit: passed.bash scripts/with-duckdb.sh go test -race ./internal/config ./internal/settings ./internal/ingest ./internal/api ./cmd/fanout -count=1: passed.just docs-generate, thenjust docs-generate-check: in sync./v1/logs:New tests cover the hash stored on an empty install, a later restart with a different value, UI rotation surviving a restart, an empty stored hash, a corrupt stored setting, malformed values through both the environment and
_FILE, both forms set, ingest accepting the token, setup after a configured token, and log output never containing the token or its hash.Not run:
just test-race; only the five packages above ran with-race.TestSetupKeepsTokenAppliedFromConfiguration; the UI branch for a response withoutingest_tokenwas read, and no UI code changed.Checklist:
just checkjust test-race(focused-racerun only, as above)