Skip to content

Configuration Sources

alsi-lawr edited this page Jul 22, 2026 · 4 revisions

Configuration sources and runtime activation

Sources and precedence

Later sources override earlier ones:

  1. appsettings.json beside the application contains non-secret defaults and the configuration shape.
  2. appsettings.{Environment}.json overlays the base file.
  3. blokebot serve --config PATH adds an operator JSON file. A relative path is resolved from the current working directory.
  4. Environment variables override JSON values; nested keys use __.
  5. --host and --port override the listener URL.

The CLI accepts help, version, and serve; it does not treat arbitrary command-line arguments as ASP.NET configuration keys.

Docker and the NixOS module select Production. Source and native archive runs use the current ASP.NET environment unless it is explicitly set.

For the separate public help Site, set the live-app link with the exact environment key BlokeBotSite__LiveAppUrl. Leave it unset or blank to disable the call to action. This Site setting is not an arbitrary blokebot CLI configuration argument.

State-path precedence

For each state file, an explicit BlokeBot:DatabasePath or TwitchBot:Identity:TokenCachePath wins over --data-dir. --data-dir supplies only paths that were not explicitly configured; platform defaults supply any paths still unset.

Setting only one explicit path can split state across directories. Verify every resolved path before backup. BlokeBot stores its automatically managed Data Protection keys in private persistent application state; there is no custom-bot key path to configure. See State and secrets.

Twitch runtime activation

The dashboard can start without Twitch credentials. The bot runtime remains offline until all four identity values are nonblank:

TwitchBot:Identity:BotUsername
TwitchBot:Identity:ClientId
TwitchBot:Identity:ClientSecret
TwitchBot:Identity:RedirectUri

Once activated, BlokeBot validates identity, runtime timing, and retry policy settings during startup. Invalid active configuration prevents startup rather than silently changing the requested values.

Recommended deployment split

  • Put ordinary values in environment variables or an external operator JSON file.
  • Put ClientSecret in a secret manager or protected environment file.
  • Keep all application state on durable storage readable only by the service identity.
  • Do not add custom-bot encryption settings; BlokeBot manages them automatically.

For public TLS or local HTTPS, see HTTPS and reverse proxy.

Clone this wiki locally