Skip to main content
Version: Next

API Configuration

The Fig API can be configured from:

  • appsettings.json
  • environment variables (ApiSettings__Secret, nested keys with __)
  • Docker secrets

ApiSettings

SettingDescriptionDefault
DbConnectionStringDatabase connection string. SQLite by default; any NHibernate-supported SQL database works. See Database.Data Source=fig.db;Version=3;New=True
SecretUsed to sign auth tokens and encrypt setting values at rest. Use a long random value.(required)
TokenLifeMinutesLifetime of Fig-managed JWT auth tokens, in minutes.10080 (7 days)
PreviousSecretPrevious API secret, used during API secret migration.empty
SecretsDpapiEncryptedWhen true, Secret and PreviousSecret are DPAPI-encrypted (Windows only).false
WebClientAddressesAllowed Fig Web origins for CORS.localhost ports used in development
ForceAdminDefaultPasswordChangeRequire the default admin user to change password on first login.false
ImportFolderPathAbsolute path for file-based imports. Empty or invalid disables file import. Supports environment-variable expansion (for example %APPDATA%/Fig/ConfigImport).empty
EnableGitHubReleaseDiscoveryWhen true, the API periodically checks GitHub for newer Fig releases. Set to false (or ApiSettings__EnableGitHubReleaseDiscovery=false) on hosts without outbound internet.true
SchedulingCheckIntervalMsHow often deferred / scheduled setting changes are evaluated.30000
TimeMachineCheckIntervalMsHow often Time Machine checkpoints are considered.3600000
DisableTransactionMiddlewareDisable per-request database transactions. Leave false unless you have a specific reason.false
OutboundHttpProxyAddressExplicit proxy for outbound HTTP from the API. When unset, Fig falls back to HTTPS_PROXY / HTTP_PROXY / ALL_PROXY.empty
HashCacheExpiryMinutesCache expiry for hash validation results. 0 disables caching.60
TrustForwardedHeadersEnable ASP.NET Core forwarded-headers middleware so Connection.RemoteIpAddress reflects the client behind a proxy.false
KnownProxiesProxy IP addresses trusted to supply forwarded headers.empty
KnownNetworksCIDR ranges trusted to supply forwarded headers (for example 10.0.0.0/8).empty
AuthenticationFig-managed or Keycloak authentication. See Security.FigManaged
RateLimitingSliding-window API rate limits. See Security.500 requests / minute

Example:

"ApiSettings": {
"DbConnectionString": "Data Source=fig.db;Version=3;New=True",
"Secret": "76d3bd66ddb74623ad38e39d7eae6ee5da28bbdce9aa40209d0decf630777304",
"TokenLifeMinutes": 10080,
"PreviousSecret": "",
"SecretsDpapiEncrypted": false,
"WebClientAddresses": [
"https://localhost:7148",
"http://localhost:7148",
"http://localhost:8080",
"http://localhost:5050"
],
"ForceAdminDefaultPasswordChange": false,
"ImportFolderPath": "",
"EnableGitHubReleaseDiscovery": true,
"SchedulingCheckIntervalMs": 30000,
"TimeMachineCheckIntervalMs": 3600000,
"OutboundHttpProxyAddress": "",
"HashCacheExpiryMinutes": 60,
"TrustForwardedHeaders": false,
"Authentication": {
"Mode": "FigManaged"
}
}

File-based imports run only when ImportFolderPath is a valid, writable absolute path. JSON files placed there are processed and deleted.

GitHub release discovery is enabled by default. When disabled, the API does not call GitHub; the "new release available" highlight will not appear. Static release highlights shipped with Fig.Web are unaffected.

Security Considerations

The configured import folder path requires write access and any JSON files placed in this directory will be automatically processed and deleted by the Fig API. When configuring this path:

  • Ensure the path has appropriate filesystem permissions to prevent unauthorized access
  • In containerized or shared hosting environments, carefully consider path boundaries and isolation
  • Avoid pointing to system directories or paths outside of your application's designated data area
  • The path supports environment variable expansion (e.g., %APPDATA%/Fig/ConfigImport)

Fig Web settings (WebSettings) are documented on Web Configuration.