Skip to content

Configuring a deployment

fc-server reads all of its configuration from environment variables; there are no config files. This page covers the settings a production deployment has to make, and why. Every variable, with its default and aliases, is in the environment reference.

Setting Variable Without it
Public URL FC_JWT_ISSUER Tokens carry http://localhost:8080 as issuer, SSO callbacks point there, and the console’s cross-origin check trusts the wrong origin
App key FLOWCATALYST_APP_KEY Secrets cannot be stored, the dispatch scheduler refuses to start, and field-worker PINs fail closed. It also turns on the signing keyring: without it the JWT signing keys come from configuration
JWT signing key With the app key set, nothing: the platform keeps and rotates its own keys. Otherwise FLOWCATALYST_JWT_PRIVATE_KEY, FC_JWT_SIGNING_KEY_PEM or FC_JWT_SIGNING_KEY_PATH Without the app key and without a configured key, an ephemeral key per process: every token dies on restart, and replicas reject each other’s tokens
Database FC_DATABASE_URL, or DB_HOST with credentials or a Secrets Manager secret The process connects to postgresql://postgres@localhost:5432/flowcatalyst
First administrator FLOWCATALYST_BOOTSTRAP_ADMIN_EMAIL and _PASSWORD Nobody can sign in to a new installation
SMTP FC_SMTP_HOST and friends Reset links and email PINs are written to the log instead of sent
Passkeys FC_WEBAUTHN_RP_ID, FC_WEBAUTHN_ORIGINS Passkeys work only on localhost

FC_JWT_ISSUER (aliases FC_EXTERNAL_BASE_URL, EXTERNAL_BASE_URL) is the platform’s external base URL, for example https://platform.example.com, with no trailing path. It is:

  • the iss and audience of every token, and the issuer in the OIDC discovery document;
  • the base of the SSO callback, <FC_JWT_ISSUER>/auth/oidc/callback, which must be registered with every customer identity provider;
  • the origin the console’s cross-site request check trusts when a proxy rewrites the Host header.

Set it once, to the URL users and applications actually use, and do not change it lightly: every SDK and resource server that validates FlowCatalyst tokens checks the issuer.

FC_JWT_KEY_STORE chooses where the signing keys live:

  • database (the default whenever FLOWCATALYST_APP_KEY is set): the platform keeps a keyring in PostgreSQL and rotates it on its own. It holds a key for each of four algorithms, and a token is signed with the algorithm that suits it: RS256 for access tokens, field-worker tokens, client assertions and, by default, id_tokens; EdDSA and ML-DSA-65 for the id_tokens of OAuth clients that choose them; HS256 for session cookies, which are never published in the JWKS. RS256, EdDSA and ML-DSA-65 keys rotate every 90 days, with a day’s notice in the JWKS; the HS256 key every 30 days. The private keys are sealed with the app key, so every process that signs or verifies needs FLOWCATALYST_APP_KEY, and database without it refuses to start. Every process, including a separate push gateway, reads the same keyring from the database, so there is no key to distribute.
  • config: the keys come from configuration and are never rotated: an RSA key in PEM form from a file at FC_JWT_SIGNING_KEY_PATH, the inline PEM in FLOWCATALYST_JWT_PRIVATE_KEY or the inline PEM in FC_JWT_SIGNING_KEY_PEM, checked in that order (values mangled by a secret store are normalised), and every token including session cookies is RS256. Every process that issues or validates tokens must have the same key. This is the behaviour from before the keyring, and it is what you get without an app key.

With the keyring, a configured RSA key is not required. If one is set, the first API process to start adopts it once as the active RS256 key so that nothing already issued is invalidated, and it is rotated away after 90 days. The routine rotation, an emergency rotation (fc-server signing-keys list | rotate | expire) and the manual procedure for config are in the key rotation runbook.

Terminal window
# Only for FC_JWT_KEY_STORE=config
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out jwt-signing-key.pem

FLOWCATALYST_APP_KEY is a base64-encoded 32-byte AES-256 key:

Terminal window
openssl rand -base64 32

It is the most important secret of a deployment. It:

  • encrypts secrets at rest: identity-provider client secrets, TOTP secrets, platform configuration secrets, function and ingestion secrets, service-account credentials;
  • keys the hashes of verify-only secrets such as OAuth client secrets;
  • is the root of the HMAC key that signs every dispatch message (so the scheduler and the API tier must share it);
  • is the root of the pepper in every field-worker PIN hash.

Back it up with the database backups. A database restored without the matching app key has unreadable secrets and unusable PINs. FLOWCATALYST_APP_KEY_PREVIOUS is a comma-separated list of retired keys, every one of which is tried when reading and verifying (new writes use the current key). Rotation has more steps than swapping the key (a two-step deploy, fc-server reencrypt, lazy PIN and client-secret re-hashing); the key rotation runbook spells them out.

Resolution order: a full URL (FC_DATABASE_URL or DATABASE_URL), then Secrets Manager (DB_SECRET_ARN with DB_HOST), then explicit DB_HOST, DB_PORT, DB_NAME, DB_USERNAME, DB_PASSWORD.

  • TLS. A composed connection string carries no sslmode, so the driver’s default applies (TLS if the server offers it, without verifying the certificate). To verify the server, use a full URL with sslmode=verify-full, or set the standard PGSSLMODE and PGSSLROOTCERT variables, which the driver honours.
  • Pool size. A full URL can carry pool_max_conns, pool_min_conns and pool_max_conn_lifetime. See database operations.
  • Rotation without a restart is available with Secrets Manager only: with DB_SECRET_ARN set, the secret is re-read every DB_SECRET_REFRESH_INTERVAL_MS (5 minutes) and new connections use the current credentials.

Use Secrets Manager mode: DB_SECRET_ARN (an RDS-style JSON secret with username, password and port), DB_HOST, DB_NAME. The region comes from the ARN and credentials from the task role. Turn on RDS-managed rotation; the platform follows it.

On start, the seeder creates an anchor-tier super administrator only if both FLOWCATALYST_BOOTSTRAP_ADMIN_EMAIL and FLOWCATALYST_BOOTSTRAP_ADMIN_PASSWORD are set and no anchor user exists yet (FLOWCATALYST_BOOTSTRAP_ADMIN_NAME is optional). Otherwise it logs a warning and does nothing. Set them for the first start, sign in, set up a second factor, and then remove them from the environment.

Set FC_SMTP_HOST, FC_SMTP_PORT (587), FC_SMTP_USERNAME, FC_SMTP_PASSWORD and FC_SMTP_FROM. FC_SMTP_SECURE=true uses implicit TLS (port 465); the default uses STARTTLS. Without a host, password-reset links and email PINs are written to the log. That is convenient in development and a leak in production.

FC_WEBAUTHN_RP_ID is the registrable domain that covers every origin passkeys are used on (for example example.com for platform.example.com). FC_WEBAUTHN_ORIGINS lists every origin exactly, comma separated, scheme included (https://platform.example.com). A passkey registered under one relying-party ID does not work under another, so choose it before users enrol.

Variable Default Controls
FC_JWT_ACCESS_TOKEN_TTL_SECS 3600 Access-token lifetime (the OIDC id_token is fixed at 5 minutes)
FC_JWT_ACCESS_TOKEN_ALG RS256 RS256 or EdDSA: the algorithm access tokens are minted with. The platform verifies both. Switch only once every SDK that verifies your access tokens supports EdDSA. The Laravel SDK verifies EdDSA explicitly. The Go and TypeScript SDKs verify with libraries that take the algorithm from the published key, which has not been tested end to end with EdDSA access tokens. The Rust and Java SDKs do not support it. Field tokens and client assertions stay RS256
OIDC_SESSION_TTL 86400 Console and login session lifetime
OIDC_REFRESH_TOKEN_TTL 604800 Absolute lifetime of a refresh-token family; rotation never extends it
FC_FIELD_ACCESS_TOKEN_TTL_SECS 600 Field-worker access tokens
FC_SESSION_COOKIE_SAME_SITE lax lax is required for SSO redirects; strict and none (HTTPS only) are accepted
FC_JWT_KEY_STORE database with an app key, else config Where the signing keys live; see the JWT signing key
FC_PASSWORD_RESET_REQUIRE_STRONG_FACTOR false true routes self-service resets of users without TOTP or a passkey to an administrator approval queue

See tokens and second factors.

Two layers protect the OAuth, OIDC and password-reset endpoints:

  • Cluster-wide limits (FC_RL_*): requests per IP and per client per minute on /oauth/token and /oauth/authorize, and password-reset requests per IP and per email per hour. Counters live in Redis when FC_REDIS_URL is set and reachable, otherwise in PostgreSQL.
  • Per-process limits (FC_OAUTH_TOKEN_*, FC_OIDC_*, FC_FIELD_*): in-memory token buckets in front of them.

The password login has its own backoff: after FC_LOGIN_BACKOFF_FREE_ATTEMPTS (3) failures for one identifier from one address, each attempt waits twice as long as the last, from 2 seconds up to 5 minutes; 100 failures for one identifier across all addresses within an hour lock it for 15 minutes. The defaults are sensible; change them only with a reason. FC_RATE_LIMIT_DISABLE=1 switches the distributed limits off and exists for load tests, not production.

Per-IP limits and login backoff use the rightmost X-Forwarded-For address, which your load balancer appends, and fall back to the connection’s address without one. FC_HTTP_REAL_IP_MIDDLEWARE (default true) also rewrites the request’s remote address from X-Real-IP or the leftmost X-Forwarded-For, both of which a client can forge. Behind a load balancer that sets X-Forwarded-For (any cloud load balancer), set it to false.

The platform API sends no CORS headers: browser applications call it through their own backend, or from the same origin. The console’s CORS Origins list applies to two groups of endpoints: the push gateway’s (/api/push/*) and the field-worker device protocol (/field/*, for a web page that uses the browser build of the field library). Neither is ever answered with credentials. A function’s public routes answer CORS as the function declares.

The platform can serve over-the-air updates for Expo apps (the Expo Updates protocol) under /app-updates/{app}/{appKey}/.... The routes answer 503 (APP_UPDATES_UNCONFIGURED) until at least one manifest-signing key is configured. They are public by design, which is why they are rate limited per source IP.

Variable Default Controls
FC_APP_UPDATES_SIGNING_KEYS none The manifest-signing keyring: comma-separated keyid=source. A source is aws-sm://... or aws-ps://... (a secret reference, which FC_SECRET_REFERENCE_ALLOW must admit), env:NAME (a variable holding the PEM) or file:/path. RSA, at least 2048 bits, PKCS#1 or PKCS#8
FC_APP_UPDATES_DEFAULT_KEY_ID the first key The key that signs for a client that names none
FC_APP_UPDATES_STORE /var/lib/flowcatalyst/app-updates Where update files live: s3://bucket/prefix (use this when deployed) or file:///abs/path. Content-addressed by SHA-256
FC_APP_UPDATES_ASSET_BASE_URL none (relative URLs) A base address for asset URLs in manifests, for a CDN in front of the asset route
FC_APP_UPDATES_INSTALL_BASE_URL the external base URL The address install links and their QR codes use, when phones reach the platform under another host
FC_APP_UPDATES_MAX_FILE_BYTES 64 MiB Largest update file accepted
FC_APP_UPDATES_MAX_BINARY_BYTES 512 MiB Largest app binary (APK) accepted. The upload is spooled to TMPDIR while it is checked, so the host needs that much free temporary space per concurrent upload
FC_APP_UPDATES_{MANIFEST,ASSET,INSTALL,DOWNLOAD}_RATE_PER_MIN and _BURST 300/100, 3000/1000, 300/100, 120/100 Per-instance rate limits per source IP on the manifest, asset, install-page and download routes. A depot’s phones share one address, so do not set these low

A phone trusts only the certificate built into its app and the key id the app names, so rotating a signing key needs a new app binary: add the new key beside the old one, ship a binary that embeds the new certificate, and remove the old key when the old binaries are gone. Never put a different key behind an existing key id. fcdev updates keygen creates a key and certificate. Every variable is in the environment reference.

The platform can also write a copy of a service account’s or an OAuth client’s credentials to AWS Systems Manager Parameter Store, so a receiving application, or a function or ingestion through an aws-ps:// reference, reads them there instead of someone copying them by hand. It is off unless you set FC_CREDENTIAL_PUBLISH, and even then it is a choice made on each service account and OAuth client (the option starts unticked). Every credential also stays where it is today: publishing adds a copy.

Variable Default Controls
FC_CREDENTIAL_PUBLISH unset The store. The only value is aws-ps. Unset: publishing is not offered anywhere
FC_CREDENTIAL_PUBLISH_PREFIX none Required when publishing is on. Every published parameter must lie under it, for example /flowcatalyst/<env>/. It starts and ends with /
FC_CREDENTIAL_PUBLISH_SERVICE_ACCOUNT_PATH {prefix}service-accounts/{account}/{credential} Path template for a service account’s parameters
FC_CREDENTIAL_PUBLISH_OAUTH_CLIENT_PATH {prefix}oauth-clients/{oauthClient}/{credential} Path template for a stand-alone OAuth client’s parameters
FC_CREDENTIAL_PUBLISH_DEFAULT off on ticks the option by default on the create forms
FC_CREDENTIAL_PUBLISH_KMS_KEY the account’s aws/ssm key KMS key id or alias for the SecureString parameters

An invalid setting stops the server at start, rather than publishing somewhere you did not mean. The platform’s role needs, on arn:aws:ssm:<region>:<account>:parameter/<prefix>*:

{
"Effect": "Allow",
"Action": ["ssm:PutParameter", "ssm:DeleteParameter", "ssm:AddTagsToResource", "ssm:ListTagsForResource"],
"Resource": "arn:aws:ssm:<region>:<account>:parameter/flowcatalyst/<env>/*"
}

plus kms:Encrypt on the key when you set FC_CREDENTIAL_PUBLISH_KMS_KEY. The platform never overwrites a parameter it did not create (it tags its own), and a failed publish is retried with backoff without blocking the change that queued it. To let a function or ingestion read a published credential, FC_SECRET_REFERENCE_ALLOW must also admit the path, for example aws-ps:///flowcatalyst/<env>/service-accounts/: the two lists are separate on purpose. The receiving application’s role needs ssm:GetParameter on its own path only. An OAuth client secret is stored only as a hash, so it is published when it is created or rotated, not afterwards.

The platform makes HTTP requests to addresses customers supply: subscription endpoints, dispatch-job target URLs, scheduled-job targets. The guard refuses destinations inside your network, at write time (400 INVALID_ENDPOINT or INVALID_TARGET_URL) and again at connection time after DNS resolution:

  • Always refused: cloud metadata (169.254.169.254, fd00:ec2::254), link-local, unspecified and multicast addresses.
  • Refused by default: loopback (FC_DELIVERY_ALLOW_LOOPBACK) and private ranges, including RFC 1918, fc00::/7 and CGNAT (FC_DELIVERY_ALLOW_PRIVATE).
  • Exceptions by name: FC_DELIVERY_ALLOW_HOSTS takes host:port patterns with * wildcards, for example partner-gw.internal:443,*.fn.svc:8095. Prefer this to opening every private range.

The platform’s own endpoints (FC_DISPATCH_PROCESSING_ENDPOINT, FC_FUNCTIONS_RUNNER_URL) are exempt automatically. The router applies no guard of its own: its targets are the platform’s callback and first-party endpoints.

Things that must never be on in production

Section titled “Things that must never be on in production”
  • FC_AUTH_ALLOW_TEST_HEADERS=true lets a request name its own principal. fc-server refuses to start with it unless APP_ENV is local or test.
  • FLOWCATALYST_DEV_MODE=true relaxes the router’s TLS checks and allows a push gateway to invent its own signing key.
  • FC_DELIVERY_ALLOW_LOOPBACK=true lets customer endpoints reach the process’s own loopback.

Logs are JSON lines on standard error (level, time, msg, and fields such as correlation_id, principal_id, message_id). FC_LOG_LEVEL is info by default; debug, warn and error are accepted. Repeated failures are paced and summarised rather than logged once per occurrence; see audit, traces and logs.