Skip to content

Configuration reference

Environment variables for the operator running a Takosumi endpoint. In a Cloudflare setup, pass them with [vars] and wrangler secret put; in a Bun + PostgreSQL setup, pass them as process environment variables. See Run it yourself for the setup steps.

Variables marked secret in the required column must not go into configuration files — pass them from a secret store.

Service-wide

VariableRequiredDefaultWhat it sets
TAKOSUMI_ENVIRONMENToptionallocalOne of local / development / test / staging / production. staging and production fail closed on encryption keys and durable stores. NODE_ENV and ENVIRONMENT are read as fallbacks
TAKOSUMI_DEV_MODEoptionalunset1 / true / yes / on / enabled lets a non-production process start without setting an encryption key. It has no effect in staging / production
PORToptional8788Listen port when started with bun core/index.ts
TAKOSUMI_DATABASE_URLrequired when running the control plane alone with bun core/index.tsnonePostgreSQL URL for the control plane. DATABASE_URL is read as a fallback. The bundled compose runs control plane and accounts on one connection, so only TAKOSUMI_ACCOUNTS_DATABASE_URL is set there
TAKOSUMI_DB_AUTO_MIGRATEoptionalfalseApply migrations on bun core/index.ts startup. Default verifies read-only. Setting true in staging / production fails startup
TAKOSUMI_DEPLOY_CONTROL_TOKENrequired in production · secretnoneBearer for the operator API. Used by the CLI and operator clients
TAKOSUMI_METRICS_SCRAPE_TOKENoptional · secretnoneBearer for /metrics. /metrics returns 404 until it is set
bash
export TAKOSUMI_ENVIRONMENT=production
export TAKOSUMI_DATABASE_URL="postgres://takosumi:<password>@db.example.com:5432/takosumi"
export TAKOSUMI_DEPLOY_CONTROL_TOKEN="$(openssl rand -hex 32)"

Secret protection

VariableRequiredDefaultWhat it sets
TAKOSUMI_SECRET_STORE_PASSPHRASErequired in staging / production · secretnoneBase material for the AES-GCM key that seals ProviderConnections, state, and plans. Needs 32+ UTF-8 bytes. TAKOSUMI_SECRET_STORE_KEY is read as a fallback
TAKOSUMI_SECRET_STORE_PARTITION_PASSPHRASESoptional · secretnoneJSON mapping partition names to separate passphrases. Omitted partitions derive from the key above
TAKOSUMI_DATABASE_ENCRYPTION_AT_RESTrequired when bun core/index.ts runs in staging / productionnoneDeclares encryption at rest as verified. The only value is verified
TAKOSUMI_DATABASE_ENCRYPTION_EVIDENCEoptionaloperator-attestedNon-secret text describing what you verified
bash
export TAKOSUMI_SECRET_STORE_PASSPHRASE="$(openssl rand -base64 48)"
export TAKOSUMI_DATABASE_ENCRYPTION_AT_REST=verified
export TAKOSUMI_DATABASE_ENCRYPTION_EVIDENCE="rds-storage-encrypted-kms-key-abc123"

Encryption at rest is judged only by the declared evidence, never inferred from the connection string shape. A control plane started with bun core/index.ts requires this declaration in staging and production.

Sign-in and OIDC

Accounts is the OIDC issuer itself. The issuer you set here is the entry for the dashboard and for products that sign in to Takosumi.

VariableRequiredDefaultWhat it sets
TAKOSUMI_ACCOUNTS_ISSUERrequired in Cloudflare setupshttp://localhost:<port> in PostgreSQL setupsThe public issuer URL. Cloudflare setups do not infer it from the request URL and refuse to start without it
TAKOSUMI_ACCOUNTS_DATABASE_URLrequired in PostgreSQL setupsnonePostgreSQL URL for accounts. takosumi accounts migrate reads it too
TAKOSUMI_ACCOUNTS_ES256_PRIVATE_JWKrequired for https issuers · secretnoneThe P-256 JWK signing id_tokens. Contains the private d. Without it the key changes per process and verification breaks on restart or replica add
TAKOSUMI_ACCOUNTS_ES256_KEY_IDoptionalthe JWK's kidKey id published in the JWKS. Falls back to a per-distribution constant when the JWK has no kid
TAKOSUMI_ACCOUNTS_ES256_PREVIOUS_PUBLIC_JWKSoptionalnoneThe previous public JWKS to list during key rotation. Never includes private d
TAKOSUMI_ACCOUNTS_OIDC_PAIRWISE_SUBJECT_SECRETrequired once a signing key is set · secretnoneSecret used to derive per-client subjects. Startup fails if the signing key is set without it
TAKOSUMI_ACCOUNT_SESSION_HASH_SALTrequired · secretnoneSalt for hashing session ids at rest. Cloudflare refuses to start without it; Bun refuses in NODE_ENV=production or TAKOSUMI_ENV=production
TAKOSUMI_ACCOUNTS_CLIENTSoptionalnoneJSON array of statically registered OIDC clients. clientId and redirectUris are required; tokenEndpointAuthMethod and allowedScopes may follow
TAKOSUMI_ACCOUNTS_CLIENT_ID / TAKOSUMI_ACCOUNTS_REDIRECT_URISoptionalnoneShort form registering one client. Set both together
TAKOSUMI_ACCOUNTS_CLIENT_SECREToptional · secretnoneSecret for making the client above confidential. Leave empty for a public PKCE client
TAKOSUMI_ACCOUNTS_CLIENT_AUTH_METHODoptionalclient_secret_post with a secret, else noneOne of client_secret_basic / client_secret_post / none
TAKOSUMI_ACCOUNTS_ALLOWED_SCOPESoptionalnoneComma-separated scopes allowed for the client above
TAKOSUMI_ACCOUNTS_UPSTREAM_PROVIDERSoptionalnoneJSON array of upstream OAuth / OIDC provider descriptors. References endpoint, client id, and secret by variable name
TAKOSUMI_ACCOUNTS_SUBJECT_SECRETrequired when an upstream provider is set · secretnoneHash secret mapping upstream subjects to Takosumi subjects
TAKOSUMI_ACCOUNTS_UPSTREAM_SESSION_TTL_MSoptionalnoneLifetime (ms) of sessions created by upstream sign-in. Set together with an upstream provider
TAKOSUMI_ACCOUNTS_PASSKEY_RP_ID / TAKOSUMI_ACCOUNTS_PASSKEY_RP_NAME / TAKOSUMI_ACCOUNTS_PASSKEY_ORIGINoptionalnoneRelying party for passkeys. All three are required to start. PostgreSQL setups also read the origin from TAKOSUMI_ACCOUNTS_PASSKEY_RP_ORIGIN
TAKOSUMI_ACCOUNTS_PRIVACY_OPERATIONS_TOKENoptional · secretnoneOperator token recording completion of privacy requests

Client registration looks like this.

bash
export TAKOSUMI_ACCOUNTS_CLIENTS='[{"clientId":"takosumi-dashboard","redirectUris":["https://takosumi.example.com/sign-in/callback"],"tokenEndpointAuthMethod":"none"}]'

Pass upstream providers as descriptor plus secret separately. Writing a secret value into the descriptor fails startup.

bash
export TAKOSUMI_ACCOUNTS_UPSTREAM_PROVIDERS='[{"providerId":"company-sso","label":"Company SSO","issuer":"https://id.example.com","authorizationEndpoint":"https://id.example.com/oauth/authorize","tokenEndpoint":"https://id.example.com/oauth/token","userInfoEndpoint":"https://id.example.com/oauth/userinfo","clientId":"accounts-client","clientSecretEnv":"COMPANY_SSO_CLIENT_SECRET","redirectUri":"https://takosumi.example.com/sign-in/callback","scopes":["openid","profile","email"]}]'
export COMPANY_SSO_CLIENT_SECRET="<upstream client secret>"

providerId is a display/identification name; it does not change behavior. You can list any number of providers.

Runs and the runner

VariableRequiredDefaultWhat it sets
TAKOSUMI_ENABLED_RUNNER_PROFILESoptionalopentofu-defaultComma-separated ids of enabled run profiles. Empty keeps only the default
TAKOSUMI_DEFAULT_RUNNER_PROFILE_IDoptionalopentofu-defaultProfile used when a request does not specify one. Must be enabled above
TAKOSUMI_OPENTOFU_PLUGIN_CACHE_DIRoptional/tmp/takosumi-provider-cache in the runner containerPath reused across Runs for provider binaries. Credentials, generated roots, plans, and state never go here
TAKOSUMI_SOURCE_BUILD_CACHE_DIRoptionalnoneDependency cache location for sourceBuild. Absolute path. Its bun / npm / xdg subdirectories are passed to Bun and npm
TAKOSUMI_RUNNER_KEEPALIVE_SECONDSoptional0How long a finished Run container stays alive. Max 900. Runner Durable Objects are per-Run, so it is not reused by the next Run
TAKOSUMI_SOURCE_ARCHIVE_ZSTD_LEVELoptional3zstd level for SourceSnapshot archives. 1 to 19. Lower is bigger but faster on first ingest
TAKOSUMI_SCHEDULED_SOURCE_POLL_BATCHoptional5Auto-sync Sources picked up per poll tick
TAKOSUMI_COMPATIBILITY_CHECK_TIMEOUT_MSoptional45000Max time (ms) to wait for source expansion in a compatibility check request

Leaving TAKOSUMI_OPENTOFU_PLUGIN_CACHE_DIR empty makes the runner expand providers into the per-Run working area. Nothing is shared, so nothing can be mixed up between Runs.

bash
export TAKOSUMI_ENABLED_RUNNER_PROFILES="opentofu-default"
export TAKOSUMI_OPENTOFU_PLUGIN_CACHE_DIR="/tmp/takosumi-provider-cache"

Cloudflare setups

VariableRequiredDefaultWhat it sets
TAKOSUMI_CONTROL_D1_SCHEMA_MODEoptionalbootstrapbootstrap prepares the schema on request. predeployed stops that and verifies the migration ledger read-only
TAKOSUMI_PRODUCTION_HARDENING_GATEoptionalobserveobserve only reports gaps. enforce makes internal inspection endpoints return 503 while evidence is missing
TAKOSUMI_PLATFORM_HARDENING_EVIDENCErequired with enforcenoneNon-secret JSON answering the inspection above
TAKOSUMI_RELEASE_ACTIVATOR_URLoptionalnoneWebhook URL that takes over app publication after apply
TAKOSUMI_RELEASE_ACTIVATOR_TOKENrequired when set above · secretnoneBearer for that webhook
TAKOSUMI_RELEASE_SOURCE_BUCKEToptionalnoneBucket name for the SourceSnapshot passed to the webhook

Set these in [vars] in wrangler.toml or push them as secrets.

bash
bunx wrangler secret put TAKOSUMI_RELEASE_ACTIVATOR_TOKEN \
  --config deploy/platform/wrangler.toml

PostgreSQL setups

VariableRequiredDefaultWhat it sets
TAKOSUMI_ACCOUNTS_PUBLIC_HOSTNAMErequired with Caddyapp.example.comPublic hostname users hit. Caddy issues the ACME certificate for it
TAKOSUMI_ACCOUNTS_BIND_HOSToptional0.0.0.0Address to listen on inside the container
TAKOSUMI_ACCOUNTS_PORToptional8787Port to listen on. PORT wins if set
TAKOSUMI_ACCOUNTS_STATIC_DIRoptionalthe dashboard build in the repoWhere the dashboard distribution lives
TAKOSUMI_ACCOUNTS_PG_POOL_MAXoptional20Connection pool ceiling
TAKOSUMI_ACCOUNTS_PG_IDLE_TIMEOUT_MSoptional30000Time before an idle connection closes
TAKOSUMI_ACCOUNTS_PG_CONNECT_TIMEOUT_MSoptional5000Time to wait for a connection
TAKOSUMI_ACCOUNTS_PG_STATEMENT_TIMEOUT_MSoptional30000Time to wait for one statement
TAKOSUMI_ACCOUNTS_PG_SSL_MODEoptionaldisabledisable / require / verify-ca / verify-full
TAKOSUMI_ACCOUNTS_PG_SSL_ROOT_CERTrequired with verify-ca / verify-fullnonePEM CA bundle
POSTGRES_PASSWORDrequired with compose · secretnonePassword the bundled compose sets on PostgreSQL

The bundled compose reads these from deploy/node-postgres/.env.

bash
cat >> deploy/node-postgres/.env <<'ENV'
TAKOSUMI_ACCOUNTS_PUBLIC_HOSTNAME=takosumi.example.com
TAKOSUMI_ACCOUNTS_PG_SSL_MODE=require
ENV

What the CLI reads

VariableRequiredDefaultWhat it sets
TAKOSUMI_DEPLOY_CONTROL_URLrequired when --url is omittednoneThe Takosumi origin the CLI talks to
TAKOSUMI_DEPLOY_CONTROL_TOKENrequired when --token is omitted · secretnoneBearer for that origin
TAKOSUMI_ACCOUNTS_URLrequired when --accounts-url is omittednoneAccounts URL used by takosumi accounts tokens
TAKOSUMI_ACCOUNTS_DATABASE_URLrequired when --database-url is omittednoneConnection used by takosumi accounts migrate
TAKOSUMI_LANGoptionalfrom LANG etc.A value starting with ja makes CLI help Japanese. TAKOSUMI_LOCALE is read too
bash
export TAKOSUMI_DEPLOY_CONTROL_URL=https://takosumi.example.com
export TAKOSUMI_DEPLOY_CONTROL_TOKEN="$(cat ~/.config/takosumi/token)"
takosumi connections list

AGPL-3.0-only