Skip to content

fix: check the settings when Krini starts #103

Done

Description

@uniqueg

Follow-up of #77 (PR #101).

Why?

Krini reads its settings at runtime but never checks them as a whole. A missing APP_ORIGIN or CLOUD_REGISTRY_URL only shows when a page needs it, and an invalid LOGIN_PROVIDERS (not JSON, not an array, entries without id, issuer, clientId or clientSecret, duplicate ids) is silently dropped by getLoginProviders() (src/lib/oidc/providers.ts): the login page just shows fewer or no buttons, and the server log says nothing. This makes first deployments slow to debug (krini#77 documents the current behaviour in "Checking a deployment").

How?

  • At server start (e.g. Next.js instrumentation.ts), validate the settings of the configuration reference: required LOGIN_PROVIDERS (at least one valid provider), APP_ORIGIN (http(s) origin), CLOUD_REGISTRY_URL (URL), OIDC_REDIRECT_URI same origin as APP_ORIGIN, URLs of COMPUTE_ACCESS_REQUEST_URL.
  • Log each problem without secrets (name the provider id and the missing field, never clientSecret), and refuse to start on missing required settings, as cloud-registry-ui does.
  • Warn if no provider has computeGroups or adminGroups (nobody can run tasks or workflows).
  • Update docs/operator-guide/configuration.md and login.md ("doesn't check its settings").

Acceptance criteria

  • An invalid or incomplete LOGIN_PROVIDERS entry is logged with the reason.
  • Krini doesn't start without its required settings, and says which one is missing.
  • Unit tests cover each check; docs updated.

Activity

  1. added this to the v0.2.0 milestone on Nov 17, 2026
  2. added
    priority: medium
    type: bug
    workload: hours
    status: triage
    on Nov 17, 2026
  3. moved this from Backlog to Nice to have in ELIXIR On-Cloudon Nov 19, 2026
  4. uniqueg commented on Nov 19, 2026

    @uniqueg
    MemberAuthor

    Two more points from the 0.1.0 pre-release review (finding L13) that fit this issue:

    • Without APP_ORIGIN, login still works (the callback falls back to the request URL), but logout always answers 500 (src/app/auth/api/logout/route.ts). With the start-up check, APP_ORIGIN should be required, so this mismatch can't happen.
    • appUrl() in the callback parses APP_ORIGIN itself instead of using getAppOrigin() (src/lib/oidc/providers.ts); the check at start and the routes should use one parser.

    The other settings findings of the review (placeholder issuer and drift between the configuration.md example block and .env.example) are part of #115.

  5. moved this from Nice to have to In review in ELIXIR On-Cloudon Nov 26, 2026
  6. moved this from In review to Done in ELIXIR On-Cloudon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus: triagetype: bugworkload: hours

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions