Configuration
One page for every option
This page covers every choice of --Persistence, --Auth, --IncludeTests and --Aspire. A label says which options a part is for; the copy in your app's docs/ folder has only yours. ApiHost stands for your app's name.
Every setting ApiHost reads, by section. Set them in appsettings.json, appsettings.Production.json, or environment variables, where : becomes __ (Jwt:SigningKey is Jwt__SigningKey); a list's items are numbered (Accounts:AdminEmails:0). The defaults are the code's, or appsettings.json's where it sets one. Deployment lists the ones to set in production.
With accounts
Accounts
| Setting | Type | Default | Notes |
|---|---|---|---|
Accounts:AdminEmails:0 | IList<string> | Accounts with these emails are made admins once their email is confirmed (at startup, and when they log in). Set at least one in production, e.g. Accounts__AdminEmails__0. Removing an email here doesn't take the role away; do that on the admin page. (AccountOptions.cs) | |
Accounts:AllowRegistration | bool | true | When false, only people an admin invites can get an account (the admin page's Invite form). (AccountOptions.cs) |
Accounts:AskForProductNews | bool | true | When true, sign-up has an unticked "Send me product news" box, and Settings → Preferences a switch for it; the choice is kept in UserPreferences.ProductNews. Turn it off if the app doesn't send product news. (AccountOptions.cs) |
Accounts:AuthAttemptsPerMinute | int | 10 | Sign-in and account attempts (log in, register, password reset, two-factor codes and the like) allowed per client address per minute; more get 429 Too Many Requests. |
Accounts:RejectBreachedPasswords | bool | false | When true, new passwords that are known from data breaches are refused, checked with Have I Been Pwned without sending the password (Identity/BreachedPasswords.cs). Off by default, as it calls an outside service. (AccountOptions.cs) |
Accounts:RequireTwoFactorForAdmins | bool | false | When true, the Admin role only works for accounts protected by two-factor authentication (or that sign in only with passkeys): other admins' tokens leave the role out, so the back office refuses them until they set it up in Settings (Identity/TwoFactor.cs). (AccountOptions.cs) |
Accounts:TwoFactorIssuer | string | ApiHost | The name an authenticator app shows next to the account (two-factor authentication). (AccountOptions.cs) |
Analytics
| Setting | Type | Default | Notes |
|---|---|---|---|
Analytics:ConnectOrigins:0 | IList<string> | Other origins Tag Manager's tags send data to or show tracking pixels from, such as https://.google-analytics.com and https://.google.com for Google Analytics. They're added to the page's Content-Security-Policy (Security/SecurityHeaders.cs) as connect-src and img-src, which otherwise block them. (AnalyticsOptions.cs) | |
Analytics:ConsentVersion | int | 1 | Raise this when the cookie policy changes (a new tag that sets cookies, say): everyone is asked again, since what they agreed to was the old policy. (AnalyticsOptions.cs) |
Analytics:GoogleTagManagerId | string | The container's ID, such as GTM-ABC1234. (AnalyticsOptions.cs) | |
Analytics:ScriptOrigins:0 | IList<string> | Other origins tags load scripts from (Tag Manager's own is always allowed). Kept apart from ConnectOrigins because allowing scripts from a broad origin such as https://*.google.com would let an attacker's injected script load through it. (AnalyticsOptions.cs) |
With organisations
ApiKeys
| Setting | Type | Default | Notes |
|---|---|---|---|
ApiKeys:AllowedPaths:0 | string[] | ["/api/todos", "/mcp"] | The API's paths an API key can be used on; everything else (account, organisation, billing and admin endpoints, and the realtime hub) needs a user's login. (ApiKey.cs) |
ApiKeys:MaxPerOrganisation | int | 25 | (ApiKey.cs) |
ApiKeys:RequestsPerMinute | int | 120 | Requests a minute for each key, after which it gets 429 Too Many Requests. (ApiKey.cs) |
ApiKeys:RotationGracePeriod | TimeSpan | 1.00:00:00 | How long the old key keeps working after a rotation, so programs can switch over. (ApiKey.cs) |
App
| Setting | Type | Default | Notes |
|---|---|---|---|
App:ClientUrl | string | The app's public address, such as https://app.example.com. Links in emails, passkeys and the sitemap use it; required outside Development with accounts. |
Attachments
| Setting | Type | Default | Notes |
|---|---|---|---|
Attachments:MaxBytes | long | 26214400 (25 MB) | The largest file that may be attached. With Storage:Provider Local, Storage:Local: MaxUploadBytes must be at least this too. (TodoAttachments.cs) |
Attachments:MaxPerTodo | int | 10 | How many files one Todo may have. (TodoAttachments.cs) |
With accounts
Authentication
| Setting | Type | Default | Notes |
|---|---|---|---|
Authentication:GitHub:ClientId | string | With ClientSecret: turns on "Continue with GitHub". | |
Authentication:GitHub:ClientSecret | string | ||
Authentication:Google:ClientId | string | With ClientSecret: turns on "Continue with Google" (how-to). | |
Authentication:Google:ClientSecret | string |
With organisations
Billing
| Setting | Type | Default | Notes |
|---|---|---|---|
Billing:Currency | string | USD | The currency of prices shown and charged, when the organisation hasn't chosen one. (BillingAccount.cs) |
Billing:Stripe:AutomaticTax | bool | false | Stripe Tax: Stripe works out and adds sales tax and VAT. Turn it on in the Stripe dashboard first. (Stripe charges for it.) (StripePaymentProvider.cs) |
Billing:Stripe:SecretKey | string | From the Stripe dashboard (Developers > API keys): sk_test_... while testing, sk_live_... in production. (StripePaymentProvider.cs) | |
Billing:Stripe:WebhookSecret | string | The webhook endpoint's signing secret (whsec_...), from the dashboard or stripe listen. (StripePaymentProvider.cs) | |
Billing:TrialDays | int | 14 | The reverse trial: a new organisation gets TrialPlan for this many days, then the free plan unless it subscribes. 0 turns trials off. (BillingAccount.cs) |
Billing:TrialPlan | string | PlanCatalogue.Pro | (BillingAccount.cs) |
ConnectionStrings
| Setting | Type | Default | Notes |
|---|---|---|---|
Marten ConnectionStrings:Marten | string | Host=localhost;Port=5432;Database=apihost;Username=postgres;Password=postgres | The PostgreSQL database, for Marten and Wolverine. |
EF Core ConnectionStrings:Postgres | string | Host=localhost;Port=5432;Database=apihost;Username=postgres;Password=postgres | The PostgreSQL database, for EF Core and Wolverine. |
With accounts
Email
| Setting | Type | Default | Notes |
|---|---|---|---|
Email:Smtp:From | string | The sender, as an address or "Name <address>". (SmtpEmailSender.cs) | |
Email:Smtp:Host | string | (SmtpEmailSender.cs) | |
Email:Smtp:Password | string | (SmtpEmailSender.cs) | |
Email:Smtp:Port | int | 587 | (SmtpEmailSender.cs) |
Email:Smtp:Security | SecureSocketOptions | SecureSocketOptions.Auto | Auto (the default) uses TLS when the server offers it; None for a local test server such as Mailpit; SslOnConnect for port 465; StartTls to require TLS on port 587. (SmtpEmailSender.cs) |
Email:Smtp:UserName | string | (SmtpEmailSender.cs) |
With accounts
Jwt
| Setting | Type | Default | Notes |
|---|---|---|---|
Jwt:AccessTokenLifetimeMinutes | int | 15 | (JwtOptions.cs) |
Jwt:Audience | string | ApiHost | (JwtOptions.cs) |
Jwt:Issuer | string | ApiHost | (JwtOptions.cs) |
Jwt:RefreshTokenLifetimeDays | int | 14 | (JwtOptions.cs) |
Jwt:RefreshTokenReuseGraceSeconds | int | 30 | How long a rotated refresh token is still accepted (see RefreshEndpoint): two tabs refreshing at the same moment, or an app that lost the response to its refresh, aren't taken for a stolen token. 0 turns it off. (JwtOptions.cs) |
Jwt:SigningKey | string | (JwtOptions.cs) |
Legal
| Setting | Type | Default | Notes |
|---|---|---|---|
Legal:PrivacyUrl | string | (LegalOptions.cs) | |
Legal:TermsUrl | string | Where the documents are: a page of this app ("/terms") or a full address ("https://example.com/terms"). (LegalOptions.cs) | |
Legal:Version | int | 1 | Raise this when either document changes in a way people should agree to again: everyone is asked to accept the new version when they next use the app. (LegalOptions.cs) |
With accounts
Notifications
| Setting | Type | Default | Notes |
|---|---|---|---|
Notifications:KeepPerUser | int | 100 | How many a user keeps: older ones are deleted as new ones arrive. (Notification.cs) |
With organisations
Organisations
| Setting | Type | Default | Notes |
|---|---|---|---|
Organisations:InvitationsPerHour | int | 20 | Invitations each user can send an hour, across their organisations; after that they get 429 Too Many Requests. (OrganisationOptions.cs) |
Organisations:MaxPendingInvitations | int | 100 | Unexpired invitations an organisation can have waiting at once. (OrganisationOptions.cs) |
Other
| Setting | Type | Default | Notes |
|---|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | string | Where to send traces, metrics and logs (OpenTelemetry over OTLP); unset, they are not exported. |
With accounts
Pictures
| Setting | Type | Default | Notes |
|---|---|---|---|
Pictures:Gravatar | bool | false | Show a user's Gravatar (https://gravatar.com) when they haven't uploaded a picture. Off by default: the browser would ask Gravatar for it with a SHA-256 hash of the user's email, which tells a third party the hash and the viewer's IP address, so turn it on only if your privacy policy says so. Without it, the user's initials are shown. (PictureFiles.cs) |
Pictures:UploadsPerMinute | int | 10 | Picture, logo and Todo attachment uploads allowed per user per minute; more get 429 Too Many Requests. (PictureFiles.cs) |
Storage
| Setting | Type | Default | Notes |
|---|---|---|---|
Storage:AzureBlob:ConnectionString | string | A connection string with the account key (signed URLs are signed with it). (StorageOptions.cs) | |
Storage:AzureBlob:Container | string | files | (StorageOptions.cs) |
Storage:Local:MaxUploadBytes | long | 26214400 (25 MB) | The largest upload the app accepts through a signed URL. (With S3 and Azure the store takes any size, so features check sizes after the upload; see IFileStorage.) (StorageOptions.cs) |
Storage:Local:RootPath | string | data/files | The folder files are kept in, relative to the app's folder unless absolute. In a container, mount a volume here (deploy/docker-compose.yml does), or files are lost with the container. (StorageOptions.cs) |
Storage:Provider | Local, S3, AzureBlob | Local | (StorageOptions.cs) |
Storage:S3:AccessKey | string | Leave both empty on AWS to use the SDK's usual sources (environment variables, an instance or task role). (StorageOptions.cs) | |
Storage:S3:Bucket | string | (StorageOptions.cs) | |
Storage:S3:ForcePathStyle | bool | false | Puts the bucket in the URL's path (https://host/bucket/key) rather than its host name (https://bucket.host/key). Self-hosted stores usually need this. (StorageOptions.cs) |
Storage:S3:Region | string | us-east-1 | AWS: the bucket's region, such as eu-west-1. Other stores: whatever region they document ("auto" for Cloudflare R2, "us-east-1" for most self-hosted stores). (StorageOptions.cs) |
Storage:S3:SecretKey | string | (StorageOptions.cs) | |
Storage:S3:ServiceUrl | string | The store's endpoint, such as https://<account>.r2.cloudflarestorage.com or https://s3.eu-central-003.backblazeb2.com. Leave empty for AWS S3 itself, which uses Region. (StorageOptions.cs) |
With organisations
Webhooks
| Setting | Type | Default | Notes |
|---|---|---|---|
Webhooks:AllowPrivateNetworks | bool | false | Lets webhooks go to localhost and private networks, and over plain HTTP. On in Development only: in production a webhook URL could otherwise be used to reach the app's own network. (Webhook.cs) |
Webhooks:Incoming:Secrets:<name> | IDictionary<string, string> | new Dictionary<string, string>(StringComparer.Ordinal) | Signing secret ("whsec_...") by source name, such as "chat". (IncomingWebhooks.cs) |
Webhooks:KeepDeliveriesFor | TimeSpan | 30.00:00:00 | Deliveries older than this are deleted when new ones are made. (Webhook.cs) |
Webhooks:MaxPerOrganisation | int | 10 | (Webhook.cs) |
Webhooks:Timeout | TimeSpan | 00:00:10 | How long a receiver has to answer. (Webhook.cs) |