Skip to main content

Initialize Daikoku

Daikoku can create its initial administrator and default tenant from configuration, without manual setup in the UI. This page lists the DAIKOKU_INIT_* environment variables and their corresponding configuration keys.

Initialization is not synchronization​

At startup, Daikoku checks whether its datastore is empty:

  1. Empty datastore, with DAIKOKU_INIT_DATA_FROM set: Daikoku imports the supplied export instead of generating the default tenant and administrator. The other initialization settings do not override the imported entities.
  2. Empty datastore, without an import: Daikoku generates the default tenant, administrator, teams and supporting entities using the settings below.
  3. Non-empty datastore: Daikoku keeps the existing entities. Initialization settings do not update them.
First initialization only

These settings are bootstrap inputs, not runtime overrides of tenant settings. Changing an environment variable, restarting a pod or running helm upgrade does not update an existing tenant or reset its administrator's password.

After initialization, use the administration UI or the admin API to update existing entities. You do not need to recreate the instance or delete its database.

The tenant settings below apply only to the generated default tenant, not to every tenant hosted by the instance.

How to provide settings​

Use environment variables, or their equivalent keys in a configuration file. Each reference table gives a configuration prefix; append the key in the second column to that prefix. For example, host under daikoku.init.mailer means daikoku.init.mailer.host.

  • Use true or false for booleans.
  • Leave optional environment variables unset when they are not needed. An empty string is not generally equivalent to an absent value.
  • Comma-separated lists are trimmed and empty entries are ignored.
  • The defaults below are application defaults. A deployment chart can supply different values.
  • Keep passwords and API keys out of committed configuration files. On Kubernetes, inject them from Secrets.

Initial administrator and import​

Configuration prefix: daikoku.init.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_HOSThostlocalhostDefault tenant's domain. With hostname-based tenant resolution, use the hostname users will access.
DAIKOKU_INIT_ADMIN_NAMEadmin.nameDaikoku adminInitial Daikoku administrator's display name.
DAIKOKU_INIT_ADMIN_EMAILadmin.emailadmin@daikoku.ioInitial administrator's email/login.
DAIKOKU_INIT_ADMIN_PASSWORDadmin.passwordGeneratedInitial administrator's password. If unset, a random password is generated and the initial credentials are logged during bootstrap.
DAIKOKU_INIT_DATA_FROMdata.fromUnsetFile path or HTTP(S) URL of an NDJSON export to import into an empty datastore. Replaces generated initial data.

For HTTP import headers, use daikoku.init.data.headers in the configuration file (a map of header names to values, empty by default). There is no dedicated environment variable for this map. See Import initial state.

Default tenant identity and security​

Configuration prefix: daikoku.init.tenant.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_TENANT_NAMEnameDaikoku Default TenantTenant name.
DAIKOKU_INIT_TENANT_TITLEtitleDaikoku Default TenantPortal title, independent of the tenant name.
DAIKOKU_INIT_TENANT_DEFAULT_LANGUAGEdefaultLanguageEnDefault language identifier, such as En, Fr or Es.
DAIKOKU_INIT_TENANT_DEFAULT_MESSAGEdefaultMessageUnsetDefault message displayed to users.
DAIKOKU_INIT_TENANT_IS_PRIVATEisPrivatetrueRequire authentication to browse the portal.
DAIKOKU_INIT_TENANT_CREATION_SECURITYcreationSecurityUnsetWhen true, only teams with API creation permission can create APIs.
DAIKOKU_INIT_TENANT_TEAM_CREATION_SECURITYteamCreationSecurityUnsetWhen true, restrict team creation to tenant administrators and Daikoku administrators.
DAIKOKU_INIT_TENANT_SUBSCRIPTION_SECURITYsubscriptionSecurityUnsetWhen true, prevent personal teams from subscribing to APIs.
DAIKOKU_INIT_TENANT_AGGREGATION_APIKEYS_SECURITYaggregationApiKeysSecurityUnsetWhen true, allow plans to enable API key aggregation.

The four optional security flags are stored as unset when omitted; they are not all equivalent to false. See tenant security settings for more context.

Mail delivery​

Configuration prefix: daikoku.init.mailer.

Choose a mailer with DAIKOKU_INIT_MAILER_TYPE, then configure the matching provider. If no type is supplied, the generated tenant uses the console mailer: messages are logged, not delivered.

Common settings​

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_MAILER_TYPEtypeconsoleconsole, mailgun, mailjet, smtpClient (alias: smtp) or sendgrid.
DAIKOKU_INIT_MAILER_FROM_TITLEfromTitleDaikokuSender display name for non-console mailers.
DAIKOKU_INIT_MAILER_FROM_EMAILfromEmaildaikoku@foo.barSender email address for non-console mailers. Set a real sender address for production.

SMTP​

Use DAIKOKU_INIT_MAILER_TYPE=smtpClient.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_MAILER_HOSThostlocalhostSMTP server hostname.
DAIKOKU_INIT_MAILER_PORTport"25"SMTP port, configured as a string.
DAIKOKU_INIT_MAILER_USERNAMEusernameUnsetSMTP authentication username. The variable is USERNAME, not USER.
DAIKOKU_INIT_MAILER_PASSWORDpasswordUnsetSMTP authentication password. Supply both username and password when authentication is required.
DAIKOKU_INIT_MAILER_STARTTLSstarttlsInferred from portIf unset, enabled on port 587, disabled on other ports. Explicit true or false overrides inference. When enabled, STARTTLS is required.
DAIKOKU_INIT_MAILER_SSLsslInferred from portIf unset, implicit SSL/TLS is enabled on port 465, disabled on other ports. Explicit true or false overrides inference.

STARTTLS upgrades an SMTP connection to TLS; implicit SSL/TLS starts the connection with TLS. Choose the mode required by your provider, rather than enabling both.

For a provider using authenticated SMTP with STARTTLS on port 587:

export DAIKOKU_INIT_MAILER_TYPE=smtpClient
export DAIKOKU_INIT_MAILER_HOST=smtp.example.com
export DAIKOKU_INIT_MAILER_PORT=587
export DAIKOKU_INIT_MAILER_FROM_EMAIL=portal@example.com
export DAIKOKU_INIT_MAILER_USERNAME=portal@example.com
export DAIKOKU_INIT_MAILER_STARTTLS=true
export DAIKOKU_INIT_MAILER_SSL=false

Provide DAIKOKU_INIT_MAILER_PASSWORD through your deployment's secret mechanism before starting Daikoku.

Mailgun, Mailjet and SendGrid​

Environment variableConfiguration keyDefaultApplies to
DAIKOKU_INIT_MAILER_DOMAINdomainEmpty stringMailgun sending domain.
DAIKOKU_INIT_MAILER_EUeufalseMailgun: use the EU region when true.
DAIKOKU_INIT_MAILER_KEYkeyEmpty stringMailgun private API key.
DAIKOKU_INIT_MAILER_API_KEY_PUBLICapiKeyPublicEmpty stringMailjet public API key.
DAIKOKU_INIT_MAILER_API_KEY_PRIVATEapiKeyPrivateEmpty stringMailjet private API key.
DAIKOKU_INIT_MAILER_SENDGRID_APIKEYsendgridApiKeyEmpty stringSendGrid API key.

Empty defaults do not provide working credentials. Supply the fields required by the selected provider.

Otoroshi connection​

Configuration prefix: daikoku.init.otoroshi.

An Otoroshi connection is attached to the default tenant only when DAIKOKU_INIT_OTOROSHI_URL is set. This does not deploy an Otoroshi instance.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_OTOROSHI_URLurlUnsetOtoroshi admin API URL. Enables connection seeding.
DAIKOKU_INIT_OTOROSHI_HOSThostEmpty stringHost header for Otoroshi requests.
DAIKOKU_INIT_OTOROSHI_CLIENT_IDclientIdadmin-api-apikey-idAdmin API client ID.
DAIKOKU_INIT_OTOROSHI_CLIENT_SECRETclientSecretadmin-api-apikey-secretAdmin API client secret. Replace the default for production.

S3 asset storage​

Configuration prefix: daikoku.init.s3.

S3 settings are attached only when DAIKOKU_INIT_S3_BUCKET is set. The bucket must already exist and be accessible with the supplied credentials.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_S3_BUCKETbucketUnsetBucket name. Enables S3 configuration seeding.
DAIKOKU_INIT_S3_ENDPOINTendpointEmpty stringBucket endpoint URL.
DAIKOKU_INIT_S3_REGIONregionus-east-1S3 region.
DAIKOKU_INIT_S3_ACCESSaccessEmpty stringAccess key ID.
DAIKOKU_INIT_S3_SECRETsecretEmpty stringSecret access key.
DAIKOKU_INIT_S3_CHUNK_SIZEchunkSize8388608Multipart chunk size in bytes (8 MiB).
DAIKOKU_INIT_S3_V4AUTHv4authtrueUse AWS Signature Version 4; false selects legacy authentication.

Authentication​

Configuration prefix: daikoku.init.authProvider.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_AUTH_PROVIDERdefaultLocalLogin provider: Local, Otoroshi, OAuth2 or LDAP.

Local uses Daikoku-managed accounts. Otoroshi delegates authentication to Otoroshi. The following groups configure OAuth2 and LDAP only when the corresponding provider is selected.

OAuth2​

Configuration prefix: daikoku.init.authProvider.oauth2.

The localhost defaults are development placeholders. Set the endpoints and callback URL for your actual identity provider and public Daikoku URL.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_AUTH_OAUTH2_CLIENT_IDclient-idclientOAuth2 client ID.
DAIKOKU_INIT_AUTH_OAUTH2_CLIENT_SECRETclient-secretUnsetOAuth2 client secret.
DAIKOKU_INIT_AUTH_OAUTH2_TOKEN_URLtoken-urlhttp://localhost:8082/oauth/tokenToken endpoint.
DAIKOKU_INIT_AUTH_OAUTH2_AUTHORIZE_URLauthorized-urlhttp://localhost:8082/oauth/authorizeAuthorization endpoint. Note the configuration key spelling: authorized-url.
DAIKOKU_INIT_AUTH_OAUTH2_USERINFO_URLuser-info-urlhttp://localhost:8082/userinfoUser info endpoint.
DAIKOKU_INIT_AUTH_OAUTH2_LOGIN_URLlogin-urlhttp://localhost:8082/loginLogin URL.
DAIKOKU_INIT_AUTH_OAUTH2_LOGOUT_URLlogout-urlUnsetLogout URL.
DAIKOKU_INIT_AUTH_OAUTH2_CALLBACK_URLcallback-urlhttp://localhost:8080/auth/oauth2/callbackDaikoku callback URL registered with the identity provider.
DAIKOKU_INIT_AUTH_OAUTH2_SCOPEscopeopenid profile email nameRequested scopes, separated by spaces.
DAIKOKU_INIT_AUTH_OAUTH2_NAME_FIELDname-fieldnameDisplay name field.
DAIKOKU_INIT_AUTH_OAUTH2_EMAIL_FIELDemail-fieldemailEmail field.
DAIKOKU_INIT_AUTH_OAUTH2_PICTURE_FIELDpicture-fieldpictureProfile picture field.
DAIKOKU_INIT_AUTH_OAUTH2_ROLE_CLAIMrole-claimUnsetClaim used for role mapping.
DAIKOKU_INIT_AUTH_OAUTH2_ADMIN_ROLEadmin-roleUnsetAdministrator role mapping.
DAIKOKU_INIT_AUTH_OAUTH2_USER_ROLEuser-roleUnsetUser role mapping.

LDAP​

Configuration prefix: daikoku.init.authProvider.ldap.

LDAP configuration is seeded only when the provider is LDAP and DAIKOKU_INIT_AUTH_LDAP_SEARCH_BASE is set. Supply server URLs and the search base for a usable configuration.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_AUTH_LDAP_SERVER_URLSserver-urlsEmpty listComma-separated LDAP server URLs.
DAIKOKU_INIT_AUTH_LDAP_SEARCH_BASEsearch-baseUnsetSearch base DN. Required to seed LDAP settings.
DAIKOKU_INIT_AUTH_LDAP_USER_BASEuser-baseUnsetUser base DN.
DAIKOKU_INIT_AUTH_LDAP_SEARCH_FILTERsearch-filter(mail=${username})User lookup filter. Preserve the literal ${username} placeholder.
DAIKOKU_INIT_AUTH_LDAP_ADMIN_USERNAMEadmin-usernameUnsetBind username.
DAIKOKU_INIT_AUTH_LDAP_ADMIN_PASSWORDadmin-passwordUnsetBind password.
DAIKOKU_INIT_AUTH_LDAP_NAME_FIELDSname-fieldscnComma-separated display name fields.
DAIKOKU_INIT_AUTH_LDAP_EMAIL_FIELDemail-fieldmailEmail attribute.
DAIKOKU_INIT_AUTH_LDAP_GROUP_FILTERgroup-filterUnsetGroup lookup filter.
DAIKOKU_INIT_AUTH_LDAP_ADMIN_GROUP_FILTERadmin-group-filterUnsetAdministrator group filter.
DAIKOKU_INIT_AUTH_LDAP_USE_SSLuse-sslUnsetOptional LDAP SSL setting.

See the authentication guide for authentication concepts.

Audit destinations​

Configuration prefix: daikoku.init.audit.

Audit configuration is seeded when the alert email list is non-empty or an Elasticsearch cluster URI is supplied.

Environment variableConfiguration keyDefaultDescription
DAIKOKU_INIT_AUDIT_ALERTS_EMAILSalertsEmailsEmpty listComma-separated alert recipients.
DAIKOKU_INIT_AUDIT_ELASTIC_CLUSTER_URIelastic.clusterUriUnsetElasticsearch cluster URI. Enables Elasticsearch configuration seeding.
DAIKOKU_INIT_AUDIT_ELASTIC_INDEXelastic.indexUnsetElasticsearch index.
DAIKOKU_INIT_AUDIT_ELASTIC_TYPEelastic.typeUnsetElasticsearch document type.
DAIKOKU_INIT_AUDIT_ELASTIC_USERelastic.userUnsetElasticsearch username.
DAIKOKU_INIT_AUDIT_ELASTIC_PASSWORDelastic.passwordUnsetElasticsearch password.

Helm and GitOps​

The Helm chart exposes tenant bootstrap settings under daikoku.initTenant. It also accepts raw environment variables through daikoku.extraEnv, including valueFrom.secretKeyRef references.

In chart values, optional boolean fields use null to mean "do not set"; an explicit false is rendered and overrides the application's default or inference.

Helm manages Kubernetes resources, not the tenant records in Daikoku's database. Once the database is initialized:

  • Updating initTenant values or the referenced Secrets does not change the stored tenant settings, including SMTP credentials.
  • Restarting Daikoku does not reapply those bootstrap values.
  • An upgrade or rollback of the Helm release does not synchronize or roll back tenant settings.

For ongoing declarative management, your automation must explicitly update the existing tenant through the admin API. The chart does not provide a tenant reconciliation mechanism. Define which fields automation owns to avoid conflicts with changes made in the UI.