Start Hub without a preconfigured auth secret - #50
Merged
Conversation
Let ordinary self-hosted startup generate one durable authority secret while preserving an explicit environment override. Keep startup ownership failure-safe so rejected composition cannot retain database or provider resources.
7 tasks
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.
Ordinary self-hosted Hub startup now creates and reuses one durable authentication and execution-authority secret. Operators can start with the embedded default or PostgreSQL without first manufacturing
PASEO_HUB_AUTH_SECRET; advanced deployments retain an explicit environment override.Goals
PASEO_HUB_AUTH_SECRETprecedence without overwriting the stored generated value, so removing the override returns to the durable secret.PORT, while preserving an explicitPASEO_HUB_APP_URLexactly.Non-goals
Why
Embedded storage removed the external database requirement from ordinary local startup, but Hub still required operators to generate and preserve a separate secret before browser authentication and execution capabilities were available. Runtime identity now has one storage-backed owner, while the environment remains an explicit deployment override rather than a second source of durable state.
Related work
No open Hub issue or pull request covers this behavior, so this PR does not supersede or close another thread.
Verification
Exact accepted-head evidence:
npm run typecheck: passed.npm run lint: passed with 0 warnings and 0 errors.npm run format:check: passed.npm run db:check: passed with no schema drift.npm run build: passed.npm run docker:smoke: passed.git diff --check: passed.Risk surface
The meaningful risks are first-start secret races, migration compatibility, override precedence, and resource ownership when startup rejects. PostgreSQL coverage uses independent pool owners to exercise database-level atomicity; embedded coverage proves persistence, override restoration, secret non-disclosure, and same-directory reopen after invalid URL and authentication initialization failures. Application composition coverage proves started sources stop before upstream storage closes. The existing single secret remains the authority for both browser authentication and execution capabilities; this PR adds no rotation, encryption, provider, billing, or onboarding behavior.