Documentation previewThese docs are actively being built. Some pages may change as the framework and examples are finalized.
Skip to content

Environment Reference (.env)

Generated .env files are intentionally compact. They contain the values a new App needs to start locally, not every optional override supported by the generated runtime.

Use this page as the complete environment reference when you need to add an override, configure a production driver, or understand a value already present in an .env file. Feature guides explain behavior and deployment tradeoffs; this page owns the exhaustive public variable contract.

Keep .env Intentional

Add a variable only when the App needs a value different from its runtime fallback or rendered local default. Keep secrets in the deployment environment or secret manager outside local development.

Resolution and Naming

Generated Apps load .env files before their Wire graph is initialized. See Configuration for file precedence, build-time defaults, and build-time overrides.

GoForj uses two reusable naming patterns:

  • App overlay: <APP>_<KEY> overrides <KEY> for one selected App. For example, BILLING_APP_URL overlays APP_URL, and BILLING_CACHE_SESSIONS_DRIVER overlays CACHE_SESSIONS_DRIVER while the billing App runs.
  • Named resource: <FAMILY>_<NAME>_<SUFFIX> configures one generated resource. For example, CACHE_SESSIONS_DRIVER selects the sessions cache driver and STORAGE_UPLOADS_BUCKET configures the uploads disk.

The default resource omits <NAME>. Unless a section says otherwise, each default variable below also accepts a named form by inserting <NAME> after its family prefix.

Driver-backed resources separate build and runtime decisions:

PatternMeaning
<FAMILY>_SUPPORTED_DRIVERSComma-separated drivers compiled into the App. Changing this value requires generation and a rebuild.
<FAMILY>_DRIVERActive driver for the default resource.
<FAMILY>_<NAME>_DRIVERActive driver for one named resource.

Variables for components that are not selected are not rendered and have no generated owner. Compatibility aliases are identified explicitly. Internal process handoff variables, test-only controls, and accepted settings with no runtime behavior are not configuration options and are not listed as public variables.

App and Runtime

VariableDefaultPurpose
APP_NAMEProject name when renderedApp display and service name.
APP_KEYGenerated base64: keyApplication encryption key. The standalone Crypt library consumes it through crypt.NewFromEnv; generated subsystems do not consume it automatically. Keep it secret and stable.
APP_PREVIOUS_KEYSEmptyComma-separated older APP_KEY values used by the Crypt library during key rotation.
APP_ENVlocalEnvironment name, such as local, staging, or production.
APP_DEBUG0Numeric log verbosity from 0 through 3.
APP_URLhttp://localhost:3000 when Web API is renderedPublic base URL used by generated browser and runtime features.
APP_DIAG_TOKENGenerated when Web API is renderedBearer token for protected diagnostic commands and endpoints.
APP_SHUTDOWN_TIMEOUT30sRoot graceful-shutdown budget.
APP_VERSIONEmptyDeployment version reported to Lighthouse.
APP_INSTANCE_IDEmptyExplicit process or replica identity reported to Lighthouse. When empty, Lighthouse identifies the instance by hostname, then its generated agent ID.
APP_INSTANCE_KINDEmptyOptional deployment-specific instance classification reported to Lighthouse.
APP_MODEEmptyOptional runtime mode used in generated log labels. Runtime commands normally set their own context.
APP_LOG_PREFIXEmptyOptional log-label prefix. Generated runtime commands set this when they need a source label.

Logging

VariableDefaultPurpose
APP_LOG_FORMATconsoleOutput format: console or json.
APP_LOG_TIMEDisabled; rendered .env enables itInclude timestamps in generated App logs. Values 0, false, off, and no disable it.
APP_LOG_CALLERDisabledInclude caller metadata. Values 0, false, off, and no disable it.
APP_LOG_DEDUPE_ENABLEDtrueCoalesce repeated similar log messages.
APP_LOG_DEDUPE_WINDOW_MS1200Dedupe window in milliseconds.
APP_LOG_DEDUPE_BURST2Matching messages emitted before suppression begins within a window.
APP_LOG_DEDUPE_SUMMARY_EVERY1000Suppressed occurrences between summary messages.

See Logging for event shape, output modes, and sensitive-data guidance.

HTTP and OpenAPI

VariableDefaultPurpose
API_HTTP_HOST0.0.0.0HTTP bind host.
API_HTTP_PORTGenerated App port, starting at 3000HTTP bind port.
PORTEmptyCompatibility override for the default or selected App HTTP port. When set, it takes precedence over API_HTTP_PORT; prefer leaving it unset and configuring API_HTTP_PORT.
HTTP_ACCESS_LOG_ENABLEDtrueEnable generated HTTP access log events.
HTTP_CORS_ALLOW_ENDPOINTShttp://localhost:8080 in local; otherwise emptyComma-separated credentialed CORS origins. Configure production origins explicitly.
API_SWAGGER_ENABLEDtrueEnable generated API reference routes.
SWAGGER_ENABLEDtrueCompatibility fallback for API_SWAGGER_ENABLED. Prefer API_SWAGGER_ENABLED.
OPENAPI_SPEC_PATHbuild/openapi.json; named Apps use build/<app>/openapi.jsonPath to the OpenAPI artifact served by the generated API reference routes.

Auth

Generated auth has secure runtime fallbacks, so a new .env includes only its generated signing secret and local bootstrap account.

VariableDefaultPurpose
API_JWT_SECRET_KEYEmpty; generated locallyJWT signing secret. Supply a unique deployment secret outside local development.
AUTH_ACCESS_TOKEN_TTL15mAccess-token lifetime.
AUTH_SESSION_IDLE_TTL2hMaximum session inactivity before sign-in is required.
AUTH_SESSION_TTL24hAbsolute session lifetime.
AUTH_REMEMBER_SESSION_TTL720hAbsolute lifetime for remembered sessions.
AUTH_REGISTER_REQUIRES_EMAIL_VERIFICATIONfalseDelay session issuance until a new account verifies its email.
AUTH_PASSWORD_MIN_LENGTH8Minimum local-password length.
AUTH_PASSWORD_REQUIRE_UPPERtrueRequire an uppercase character.
AUTH_PASSWORD_REQUIRE_LOWERfalseRequire a lowercase character.
AUTH_PASSWORD_REQUIRE_NUMBERfalseRequire a number.
AUTH_PASSWORD_REQUIRE_SYMBOLtrueRequire a symbol.
AUTH_COOKIE_SECUREautoSecure-cookie policy. auto follows the request scheme and enables secure cookies for HTTPS requests.
AUTH_PASSWORD_RESET_TTL1hPassword-reset token lifetime.
AUTH_PASSWORD_RESET_RETURN_TOKENtrue in local; otherwise falseReturn reset tokens in API responses. Enable outside local development only for a controlled integration.
AUTH_EMAIL_VERIFICATION_TTL24hEmail-verification token lifetime.
AUTH_EMAIL_VERIFICATION_RETURN_TOKENtrue in local; otherwise falseReturn verification tokens in API responses. Enable outside local development only for a controlled integration.
AUTH_LOGIN_LOCKOUT_ATTEMPTS5Failed attempts before temporary account lockout.
AUTH_LOGIN_LOCKOUT_DURATION15mAccount lockout duration.
AUTH_LOGIN_RATE_LIMIT_ATTEMPTS10Login attempts allowed during the rate-limit window.
AUTH_LOGIN_RATE_LIMIT_DURATION15mLogin rate-limit window.
AUTH_BOOTSTRAP_USERNAMEEmpty; rendered local value is adminLocal bootstrap username. Bootstrap is skipped when username or password is empty.
AUTH_BOOTSTRAP_EMAILDerived as <username>@local.invalid; rendered local value is admin@example.comLocal bootstrap email.
AUTH_BOOTSTRAP_PASSWORDEmpty; rendered local value is adminLocal bootstrap password. Replace or remove it outside local development.

See Auth, Sessions and Cookies, and Production Hardening.

OAuth

OAuth credential stubs are intentionally absent from generated .env files. A provider remains disabled until every required value is present.

ProviderRequired Variables
GitHubAUTH_OAUTH_GITHUB_CLIENT_ID, AUTH_OAUTH_GITHUB_CLIENT_SECRET
GoogleAUTH_OAUTH_GOOGLE_CLIENT_ID, AUTH_OAUTH_GOOGLE_CLIENT_SECRET
MicrosoftAUTH_OAUTH_MICROSOFT_CLIENT_ID, AUTH_OAUTH_MICROSOFT_CLIENT_SECRET
AppleAUTH_OAUTH_APPLE_CLIENT_ID, AUTH_OAUTH_APPLE_TEAM_ID, AUTH_OAUTH_APPLE_KEY_ID, AUTH_OAUTH_APPLE_PRIVATE_KEY

Common and advanced provider settings:

VariableDefaultPurpose
AUTH_OAUTH_STATE_TTL10mLifetime of one-time OAuth state records.
AUTH_OAUTH_MICROSOFT_TENANTcommonMicrosoft tenant segment.
AUTH_OAUTH_GITHUB_AUTH_URLGitHub authorize endpointAdvanced authorization endpoint override.
AUTH_OAUTH_GITHUB_TOKEN_URLGitHub token endpointAdvanced token endpoint override.
AUTH_OAUTH_GITHUB_USERINFO_URLGitHub user endpointAdvanced user-info endpoint override.
AUTH_OAUTH_GITHUB_EMAILS_URLGitHub email endpointAdvanced verified-email endpoint override.
AUTH_OAUTH_GOOGLE_AUTH_URLGoogle authorize endpointAdvanced authorization endpoint override.
AUTH_OAUTH_GOOGLE_TOKEN_URLGoogle token endpointAdvanced token endpoint override.
AUTH_OAUTH_GOOGLE_USERINFO_URLGoogle OpenID user-info endpointAdvanced user-info endpoint override.
AUTH_OAUTH_MICROSOFT_AUTH_URLTenant-specific Microsoft authorize endpointAdvanced authorization endpoint override.
AUTH_OAUTH_MICROSOFT_TOKEN_URLTenant-specific Microsoft token endpointAdvanced token endpoint override.
AUTH_OAUTH_MICROSOFT_USERINFO_URLMicrosoft Graph OpenID user-info endpointAdvanced user-info endpoint override.
AUTH_OAUTH_APPLE_AUTH_URLApple authorize endpointAdvanced authorization endpoint override.
AUTH_OAUTH_APPLE_TOKEN_URLApple token endpointAdvanced token endpoint override.
AUTH_OAUTH_APPLE_JWKS_URLApple signing-key endpointAdvanced JWKS endpoint override.
AUTH_OAUTH_APPLE_RESPONSE_MODEform_postApple callback response mode.

Endpoint overrides are primarily for provider-compatible gateways, controlled testing, and private identity infrastructure. See OAuth for account-linking and callback behavior.

Frontend

Only values with an explicit frontend prefix are exposed to generated browser code. Treat every frontend value as public.

Variable PatternPurpose
FRONTEND_<KEY>Exposes VITE_<KEY> to every generated frontend.
<APP>_FRONTEND_<KEY>Overrides one App frontend, such as MARKETPLACE_FRONTEND_BACKEND_URL.
VITE_BACKEND_URLCompatibility fallback for FRONTEND_BACKEND_URL. Prefer the GoForj frontend prefix in shared environment files.
FRONTEND_BACKEND_URLBackend proxy target. Resolution falls back to <APP>_APP_URL, APP_URL, then the generated App HTTP port.
FRONTEND_AUTH_PASSWORD_MIN_LENGTHVue password guidance matching AUTH_PASSWORD_MIN_LENGTH.
FRONTEND_AUTH_PASSWORD_REQUIRE_UPPERVue password guidance matching AUTH_PASSWORD_REQUIRE_UPPER.
FRONTEND_AUTH_PASSWORD_REQUIRE_LOWERVue password guidance matching AUTH_PASSWORD_REQUIRE_LOWER.
FRONTEND_AUTH_PASSWORD_REQUIRE_NUMBERVue password guidance matching AUTH_PASSWORD_REQUIRE_NUMBER.
FRONTEND_AUTH_PASSWORD_REQUIRE_SYMBOLVue password guidance matching AUTH_PASSWORD_REQUIRE_SYMBOL.

The backend auth policy remains authoritative. The password-policy frontend values are consumed only by the Vue starter.

Generated frontends expose the selected App's <APP>_APP_ENV, or the global APP_ENV, as VITE_APP_ENV.

Metrics and Runtime Ports

Generated runtime metadata assigns the default App ports 3000, 10000, 10001, and 10002. Each named App receives the next non-conflicting block.

VariableDefault App DefaultPurpose
METRICS_PORT10000Shared App metrics port and canonical HTTP metrics port.
API_METRICS_PORTMETRICS_PORTAccepted HTTP metrics alias.
METRICS_API_PORTMETRICS_PORTCompatibility HTTP metrics alias.
SCHEDULER_METRICS_PORT10001Accepted scheduler metrics alias.
METRICS_SCHEDULER_PORT10001Canonical generated scheduler metrics port.
WORKER_METRICS_PORT10002Accepted worker metrics alias.
JOBS_METRICS_PORT10002Accepted jobs metrics alias.
METRICS_JOBS_PORT10002Canonical generated jobs metrics port.

Every port key accepts the <APP>_ overlay. For example, the first named App can use MARKETPLACE_METRICS_PORT=10010, MARKETPLACE_METRICS_SCHEDULER_PORT=10011, and MARKETPLACE_METRICS_JOBS_PORT=10012.

Framework-owned instrumentation toggles all default to true when their component exists:

VariableSurface
METRICS_HTTP_ENABLEDHTTP requests.
METRICS_CACHE_ENABLEDCache operations.
METRICS_STORAGE_ENABLEDStorage operations.
METRICS_EVENTS_ENABLEDEvent operations.
METRICS_MAIL_ENABLEDMail sends.
METRICS_QUEUE_ENABLEDQueue operations.
METRICS_DATABASE_ENABLEDDatabase operations.
METRICS_AUTH_ENABLEDAuth flows.
METRICS_SCHEDULER_ENABLEDScheduler operations.
METRICS_MONITORING_ENABLEDMonitoring metrics in the generated demo App.

See Metrics for endpoints, labels, and scrape topology.

Lighthouse and Inspects

VariableDefaultPurpose
LIGHTHOUSE_ENABLEDtrueEnable Lighthouse runtime integration.
LIGHTHOUSE_URLws://localhost:3000/lighthouse/ws/agentLighthouse agent websocket URL.
LIGHTHOUSE_SECRETEmpty; generated locallyShared agent/server authentication secret.
LIGHTHOUSE_DEBUGDisabledEnable Lighthouse debug output.
LIGHTHOUSE_VSCODE_CMDcodeVS Code command used by Lighthouse source links.
LIGHTHOUSE_GOLAND_CMDgolandGoLand command used by Lighthouse source links.
LIGHTHOUSE_INSPECT_ENABLEDfalse; .env.local sets trueEnable inspect capture.
LIGHTHOUSE_INSPECT_MAX_TOTAL250; .env.local sets 1000Maximum retained inspect records.
LIGHTHOUSE_INSPECT_MAX_INFLIGHT100; .env.local sets 250Maximum in-flight inspect records.
LIGHTHOUSE_INSPECT_MAX_EVENTS200; .env.local sets 500Maximum events recorded per inspect.
LIGHTHOUSE_INSPECT_SAMPLE_RATE1.0Capture rate from 0.0 through 1.0.
LIGHTHOUSE_INSPECT_BUFFER_SIZE4096Finished-inspect delivery buffer size.
LIGHTHOUSE_INSPECT_FLUSH_BATCH_SIZE100Maximum records per Lighthouse delivery batch.
LIGHTHOUSE_INSPECT_FLUSH_INTERVAL1sMaximum delay between delivery flushes.

See Lighthouse and Inspects.

Database

Available drivers: sqlite, mysql, postgres.

The default connection uses DB_<SUFFIX>. Named connections use DB_<NAME>_<SUFFIX>, such as DB_ANALYTICS_DRIVER. DB_SUPPORTED_DRIVERS is project-wide.

VariableDefaultPurpose
DB_SUPPORTED_DRIVERSActive drivers when unsetComma-separated database drivers compiled into the App. Root key only.
DB_DEFAULTdefaultNamed connection returned by the default accessor. Root key only.
DB_DRIVERsqlite; renderer writes the selected driverActive connection driver.
DB_DSNEmptyComplete connection DSN. When set, it takes precedence over individual connection fields.
DB_HOSTEmptyMySQL or Postgres host.
DB_PORTEmptyMySQL or Postgres port.
DB_DATABASE_data/sqlite/app.db for default SQLite; named SQLite uses its resource nameDatabase name or SQLite path.
DB_SQLITE_DATABASEEmptySQLite-specific path override when one configuration also carries server-database fields.
DB_USERNAMEEmptyMySQL or Postgres username.
DB_PASSWORDEmptyMySQL or Postgres password.
DB_QUERY_LOGGINGfalseEnable GORM query logging for the connection.
DB_SLOW_QUERY_THRESHOLD250msDuration above which an observed query is classified as slow.
DB_MAX_IDLE_CONNECTIONSDriver defaultMaximum idle connections when greater than zero.
DB_MAX_OPEN_CONNECTIONSDriver defaultMaximum open connections when greater than zero.
DB_CONN_MAX_LIFETIME_MINUTES3Maximum connection lifetime in minutes.
DB_ROOT_PASSWORDEmptyRoot password used only by the generated local MySQL service. Root key only.
MYSQL_MAX_IDLE_CONNECTIONSDriver defaultCompatibility fallback for DB_MAX_IDLE_CONNECTIONS. Prefer the DB_ key.
MYSQL_MAX_OPEN_CONNECTIONSDriver defaultCompatibility fallback for DB_MAX_OPEN_CONNECTIONS. Prefer the DB_ key.
DB_CONNECTIONS, DB_SUPPORTED_CONNECTIONSEmptyLegacy comma-separated connection-name discovery used by backup commands. New Apps discover DB_<NAME>_* directly.

The renderer supplies usable local MySQL or Postgres connection values when those services are selected. Active driver values also accept the compatibility aliases sqlite3, mariadb, and postgresql; supported-driver lists and new configuration should use the canonical names above. See Database Strategy and Database Shell.

Shared Redis and NATS

Redis-backed Cache, Storage, Events, and Queue resources share the host, port, and password values described below unless their family table says otherwise. Cache, Events, and Queue also use REDIS_DB; Storage defaults its scoped DB to 0.

VariableDefaultPurpose
REDIS_HOSTredis in generated runtime fallbacksShared Redis host. .env.host uses localhost for local host commands.
REDIS_PORT6379Shared Redis port and generated local-service published port.
REDIS_PASSWORDEmptyShared Redis password.
REDIS_DB0Shared Redis database number.
NATS_URLnats://127.0.0.1:4222Fallback URL for the NATS cache driver. Other NATS-backed resource families use their scoped URL setting.

Cache

Available drivers: memory, file, null, redis, memcached, dynamodb, sqlite, postgres, mysql, nats.

Use CACHE_<SUFFIX> for the default cache and CACHE_<NAME>_<SUFFIX> for named caches such as CACHE_SESSIONS_DRIVER.

Auth projects render CACHE_SESSIONS_DRIVER. The demo App also renders CACHE_SETTINGS_DRIVER. Both are ordinary named caches and accept the same named suffixes below.

Common settings:

VariableDefaultPurpose
CACHE_SUPPORTED_DRIVERSActive drivers when unsetComma-separated drivers compiled into the App. Root key only.
CACHE_DRIVERmemoryActive driver.
CACHE_DEFAULT_TTL_SECONDS300Default entry lifetime in seconds.
CACHE_PREFIXappBackend key prefix.
CACHE_COMPRESSIONnoneValue compression: none or gzip.
CACHE_MAX_VALUE_BYTES0Maximum shaped value size in bytes; 0 disables the limit.
CACHE_ENCRYPTION_KEYEmptyRaw 16, 24, or 32-byte AES key for cache values. This is not APP_KEY format.

Driver settings:

VariableDriverDefault or Format
CACHE_MEMORY_CLEANUP_SECONDSmemory600 seconds.
CACHE_FILE_DIRfileCache-specific directory under the operating-system temp root.
CACHE_ADDRESSESmemcachedComma-separated host:port values.
CACHE_ENDPOINTdynamodbEmpty provider endpoint override.
CACHE_REGIONdynamodbus-east-1.
CACHE_TABLEdynamodbcache_entries.
CACHE_DSNsqliteTemporary SQLite file for the cache name.
CACHE_TABLEsqlitecache_entries.
CACHE_DSNpostgres, mysqlRequired connection DSN.
CACHE_TABLEpostgres, mysqlcache_entries.
CACHE_URLnatsNATS_URL, then nats://127.0.0.1:4222.
CACHE_BUCKETnatsDerived from the cache name.
CACHE_BUCKET_TTLnatsfalse; use JetStream bucket TTL mode instead of value-envelope expiration.
CACHE_BUCKET_TTL_SECONDSnats0; bucket-wide JetStream TTL when provisioning a bucket. 0 disables it.
CACHE_DESCRIPTIONnatsEmpty.
CACHE_HISTORYnats1.
CACHE_MAX_BYTESnats0.
CACHE_MAX_VALUE_SIZEnats0.
CACHE_REPLICASnats1.
CACHE_STORAGEnatsfile.
CACHE_COMPRESSEDnatsfalse.
CACHE_ADDRredisREDIS_HOST:REDIS_PORT.
CACHE_USERNAMEredisEmpty.
CACHE_PASSWORDredisREDIS_PASSWORD.
CACHE_DBredisREDIS_DB.
CACHE_TLSredisfalse.
CACHE_INSECURE_SKIP_VERIFYredisfalse; use only in controlled development.
NonenullNo driver-specific settings.

Compression and encryption change the persisted value envelope. See Cache Patterns before changing them in a mixed-version deployment.

File Storage

Available drivers: local, memory, redis, ftp, sftp, s3, gcs, dropbox, rclone.

Use STORAGE_<SUFFIX> for the default disk and STORAGE_<NAME>_<SUFFIX> for named disks such as STORAGE_PUBLIC_ROOT.

Generated projects render STORAGE_PUBLIC_DRIVER and STORAGE_PUBLIC_ROOT. The demo App also renders STORAGE_FAVICONS_DRIVER and STORAGE_FAVICONS_ROOT. These are ordinary named disks and accept the same named suffixes below.

Common settings:

VariableDefaultPurpose
STORAGE_SUPPORTED_DRIVERSActive drivers when unsetComma-separated drivers compiled into the App. Root key only.
STORAGE_DRIVERlocalActive driver.
STORAGE_PREFIXEmptyBackend object-key prefix.

Driver settings:

VariableDriverDefault or Format
STORAGE_ROOTlocalstorage/app/private for the default disk; named disks default to storage/app/<name>, including the rendered public disk.
NonememoryNo driver-specific settings.
STORAGE_ADDRredisREDIS_HOST:REDIS_PORT.
STORAGE_USERNAMEredisEmpty.
STORAGE_PASSWORDredisREDIS_PASSWORD.
STORAGE_DBredis0.
STORAGE_HOSTftpRequired host.
STORAGE_PORTftp21.
STORAGE_USER, STORAGE_PASSWORDftpEmpty credentials.
STORAGE_TLSftpfalse.
STORAGE_INSECURE_SKIP_VERIFYftpfalse; use only in controlled development.
STORAGE_HOSTsftpRequired host.
STORAGE_PORTsftp22.
STORAGE_USERsftproot.
STORAGE_PASSWORDsftpEmpty.
STORAGE_KEY_PATHsftpEmpty private-key path.
STORAGE_KNOWN_HOSTS_PATHsftpEmpty known-hosts path.
STORAGE_INSECURE_IGNORE_HOST_KEYsftpfalse; use only in controlled development.
STORAGE_BUCKETs3Required bucket.
STORAGE_ENDPOINTs3Empty provider endpoint override.
STORAGE_REGIONs3us-east-1.
STORAGE_ACCESS_KEY_ID, STORAGE_SECRET_ACCESS_KEYs3Empty credentials.
STORAGE_USE_PATH_STYLEs3false.
STORAGE_UNSIGNED_PAYLOADs3false.
STORAGE_BUCKETgcsRequired bucket.
STORAGE_CREDENTIALS_JSONgcsEmpty JSON credential string.
STORAGE_ENDPOINTgcsEmpty provider endpoint override.
STORAGE_TOKENdropboxRequired access token.
STORAGE_REMOTErcloneRequired remote name.
STORAGE_RCLONE_CONFIG_PATHrcloneEmpty config-file path.
STORAGE_RCLONE_CONFIG_DATArcloneEmpty inline config data.

See Storage Patterns for path and durability guidance.

Events

Available drivers: inproc, null, redis, nats, natsjetstream, kafka, gcppubsub, sns.

Use EVENTS_<SUFFIX> for the default bus and EVENTS_<NAME>_<SUFFIX> for named buses.

VariableDriverDefault or Format
EVENTS_SUPPORTED_DRIVERSAllActive drivers when unset. Root key only.
EVENTS_DRIVERAllinproc.
Noneinproc, nullNo driver-specific runtime settings.
EVENTS_ADDRredisREDIS_HOST:REDIS_PORT; authentication uses shared REDIS_PASSWORD and REDIS_DB.
EVENTS_URLnatsnats://127.0.0.1:4222.
EVENTS_URLnatsjetstreamnats://127.0.0.1:4222.
EVENTS_SUBJECT_PREFIXnatsjetstreamevents..
EVENTS_STREAM_NAME_PREFIXnatsjetstreamEVENTS_.
EVENTS_INACTIVE_THRESHOLD_SECONDSnatsjetstream30.
EVENTS_ACK_WAIT_SECONDSnatsjetstream30.
EVENTS_FETCH_MAX_WAIT_MSnatsjetstream250.
EVENTS_STORAGEnatsjetstreammemory.
EVENTS_BROKERSkafkaComma-separated brokers; default 127.0.0.1:9092.
EVENTS_PROJECT_IDgcppubsubRequired project ID.
EVENTS_URIgcppubsubOptional emulator or provider URI.
EVENTS_REGIONsnsus-east-1.
EVENTS_ENDPOINTsnsEmpty provider endpoint override.
EVENTS_TOPIC_NAME_PREFIX, EVENTS_QUEUE_NAME_PREFIXsnsEmpty.
EVENTS_WAIT_TIME_SECONDSsns1.
EVENTS_VISIBILITY_TIMEOUT_SECONDSsns30.

See Events for delivery and durability differences.

Queue

Available drivers: null, sync, workerpool, redis, nats, sqs, rabbitmq, sqlite, postgres, mysql.

Use QUEUE_<SUFFIX> for the default queue and QUEUE_<NAME>_<SUFFIX> for named queues.

Common settings:

VariableDefaultPurpose
QUEUE_SUPPORTED_DRIVERSActive drivers when unsetComma-separated drivers compiled into the App. Root key only.
QUEUE_DRIVERworkerpoolActive driver.
QUEUE_WORKERS30Worker count. Named queues inherit the root value when unset.
QUEUE_NAMEdefault; named resources use their resource namePhysical backend queue name before App namespacing.
QUEUE_DEFAULT_QUEUEQUEUE_NAMECompatibility alias for QUEUE_NAME. Prefer QUEUE_NAME.
QUEUE_SHUTDOWN_TIMEOUT10sQueue driver shutdown budget.
QUEUE_WORKERPOOL_WORKERS30Compatibility fallback used only when QUEUE_WORKERS is non-positive. Prefer QUEUE_WORKERS.

Driver settings:

VariableDriverDefault or Format
Nonenull, sync, workerpoolNo driver-specific runtime settings.
QUEUE_ADDRredisREDIS_HOST:REDIS_PORT.
QUEUE_PASSWORDredisREDIS_PASSWORD.
QUEUE_DBredisREDIS_DB.
QUEUE_QUEUESredisComma-separated queue=weight map; the configured default queue gets weight 1.
QUEUE_SERVER_LOG_LEVELredisBackend default; accepted values include debug, info, warn, error, and fatal.
QUEUE_URLnatsnats://127.0.0.1:4222.
QUEUE_REGIONsqsus-east-1.
QUEUE_ENDPOINTsqsEmpty provider endpoint override.
QUEUE_ACCESS_KEY, QUEUE_SECRET_KEYsqsEmpty credentials.
QUEUE_URLrabbitmqamqp://guest:guest@127.0.0.1:5672/.
QUEUE_DSNsqliteTemporary SQLite file per queue.
QUEUE_DSNpostgres, mysqlRequired connection DSN.
QUEUE_PROCESSING_RECOVERY_GRACE_SECONDSsqlite, postgres, mysql2.
QUEUE_PROCESSING_LEASE_NO_TIMEOUT_SECONDSsqlite, postgres, mysql300.

See Queues for selection and dispatch, and Queue Workers for lifecycle and scaling.

Mail

Available drivers: log, smtp, resend, postmark, mailgun, sendgrid, ses.

Use MAIL_<SUFFIX> for the default mailer and MAIL_<NAME>_<SUFFIX> for named mailers.

VariableDriverDefault or Format
MAIL_SUPPORTED_DRIVERSAllActive drivers when unset. Root key only.
MAIL_DRIVERAlllog; rendered Docker projects use smtp.
MAIL_FROM_ADDRESSAllno-reply@example.com.
MAIL_FROM_NAMEAllAPP_NAME; the renderer writes the project name.
MAIL_LOG_BODIESlogfalse.
MAIL_SMTP_HOSTsmtpRequired host. Docker projects render mailpit.
MAIL_SMTP_PORTsmtp587; Mailpit projects render 1025.
MAIL_SMTP_USERNAME, MAIL_SMTP_PASSWORD, MAIL_SMTP_IDENTITYsmtpEmpty.
MAIL_SMTP_FORCE_TLSsmtpfalse.
MAIL_RESEND_API_KEYresendRequired API key.
MAIL_RESEND_ENDPOINTresendProvider default.
MAIL_POSTMARK_SERVER_TOKENpostmarkRequired server token.
MAIL_POSTMARK_ENDPOINTpostmarkProvider default.
MAIL_POSTMARK_MESSAGE_STREAMpostmarkEmpty.
MAIL_MAILGUN_DOMAIN, MAIL_MAILGUN_API_KEYmailgunRequired provider values.
MAIL_MAILGUN_ENDPOINTmailgunProvider default.
MAIL_SENDGRID_API_KEYsendgridRequired API key.
MAIL_SENDGRID_ENDPOINTsendgridProvider default.
MAIL_SES_REGIONsesEmpty.
MAIL_SES_ACCESS_KEY_ID, MAIL_SES_SECRET_ACCESS_KEY, MAIL_SES_SESSION_TOKENsesEmpty credentials.
MAIL_SES_ENDPOINTsesAWS SDK default.
MAIL_SES_CONFIGURATION_SETsesEmpty.

See Mail for local delivery, named mailers, and production guidance.

Scheduler and Process Shutdown

VariableDefaultPurpose
SCHEDULER_COMMAND_TIMEOUT10mMaximum runtime for a command launched by a scheduled task.
SCHEDULER_SUBPROCESS_SHUTDOWN_TIMEOUTAPP_SHUTDOWN_TIMEOUT; rendered as 90sGrace period for scheduler-owned subprocesses.
QUEUE_SHUTDOWN_TIMEOUT10sQueue shutdown budget, also listed with Queue settings.

Local Observability

These values configure generated local VictoriaMetrics and Grafana infrastructure. Production observability may use different deployment configuration.

VariableDefaultPurpose
OBSERVABILITY_VM_PORT8428Published VictoriaMetrics HTTP port.
GRAFANA_PORT13001Published Grafana HTTP port.
GRAFANA_ADMIN_USERadminLocal Grafana administrator username.
GRAFANA_ADMIN_PASSWORDadminLocal Grafana administrator password. Change it before network exposure.
OBSERVABILITY_METRICS_TARGET_MODEauto, resolved to local-singleTarget topology: auto, local-single, local-multi, compose, or disabled.
OBSERVABILITY_METRICS_TARGET_HOSThost.docker.internalHost used by local generated scrape targets. An explicitly empty value preserves the existing target file.
OBSERVABILITY_API_METRICS_HOSTapiHTTP role host in compose mode. Empty omits the role target.
OBSERVABILITY_JOBS_METRICS_HOSTjobsJobs role host in compose mode. Empty omits the role target.
OBSERVABILITY_SCHEDULER_METRICS_HOSTschedulerScheduler role host in compose mode. Empty omits the role target.

Local Services and Docker

VariableDefaultPurpose
IP_ADDRESS0.0.0.0Host address used for generated Compose port publishing.
COMPOSE_PROFILESEmptyCompose profiles to activate. The renderer uses redis when a local optional Redis service is selected.
MAILPIT_SMTP_PORT1025Published Mailpit SMTP port.
MAILPIT_HTTP_PORT8025Published Mailpit inbox port.
DB_MYSQL_PORTDB_PORT, then 3306Published local MySQL port without changing the App connection port.
DB_POSTGRES_PORTDB_PORT, then 5432Published local Postgres port without changing the App connection port.
INNODB_BUFFER_POOL_SIZE512MBBuild setting for the generated local MariaDB image.
TZUS/CentralTime zone passed to generated local database services.

Backups

VariableDefaultPurpose
BACKUP_PATH.goforj/backupsDefault local backup root.
APP_BACKUP_DRIVERlocalBackup repository driver: local, s3, or b2-s3.
APP_BACKUP_S3_BUCKETEmptyS3-compatible repository bucket.
APP_BACKUP_S3_ENDPOINTEmptyS3-compatible endpoint override.
APP_BACKUP_S3_REGIONEmptyS3-compatible region.
APP_BACKUP_S3_ACCESS_KEY_IDEmptyRepository access key.
APP_BACKUP_S3_SECRET_ACCESS_KEYEmptyRepository secret key.
APP_BACKUP_S3_USE_PATH_STYLEfalseEnable path-style S3 addressing.
APP_BACKUP_S3_PREFIXEmptyObject prefix for completed backup sets.
APP_BACKUP_KEEP_DAILY14Completed sets retained in recent daily buckets when calendar retention is enabled.
APP_BACKUP_KEEP_WEEKLY4Completed sets retained in weekly buckets when calendar retention is enabled.
APP_BACKUP_KEEP_MONTHLY6Completed sets retained in monthly buckets when calendar retention is enabled.

S3-backed STORAGE_<NAME>_* resources can be inventoried as backup inputs, but they are separate from the APP_BACKUP_S3_* repository that stores completed backup sets. See Backup and Restore.

Forj Developer Tools

VariableDefaultPurpose
FORJ_APPappSelect the active App for source-mode commands. Prefer forj <app> <command> in normal workflows.
FORJ_MAKE_OPENautoGenerated-file opening policy: auto, always, or never.
FORJ_EDITORAuto-detectedEditor command for generated files. Supports {file}, {line}, and {location} placeholders.
FORJ_DEV_PLAINDisabledUse plain forj dev output instead of the interactive terminal UI.
FORJ_DEBUGDisabledEnable additional CLI and generated-console diagnostics.
FORJ_DEVDisabledShow developer and maintainer commands in CLI help.
FORJ_RENDER_TIMINGSDisabledPrint render timing summaries.
FORJ_RENDER_DEBUG_TIMINGSDisabledPrint detailed render timing diagnostics.
FORJ_BUILD_PROFILE_LOGEmptyFile path for compile profile records written by profiled builds.

FORJ_COMMAND_*, FORJ_SUBPROCESS, FORJ_NATIVE_COMMAND_NAMES, FORJ_MULTI_APP_HELP, and FORJ_BUILD_PROGRESS are reserved process-handoff variables. Do not set them in App configuration.

See Opening Generated Files and forj dev.

Generated Demo App

These controls exist only when the demo monitoring and Lighthouse benchmark surfaces are rendered.

VariableDefaultPurpose
MONITOR_POLL_INTERVAL_SECONDS30Demo monitor polling schedule interval.
BENCHMARK_HTTP_URLAPP_URL, then http://localhost:3000Base URL for the Lighthouse HTTP benchmark.
BENCHMARK_HTTP_PATH/-/healthRequest path for the Lighthouse HTTP benchmark.
BENCHMARK_QUEUE_PREFILL_COUNT100000Queue jobs prepared for a benchmark run.
BENCHMARK_QUEUE_DRAIN_TIMEOUT_MSDerived from run duration, bounded from 45 seconds to 3 minutesQueue benchmark drain timeout in milliseconds.

Standalone Library Diagnostics

VariablePurpose
HTTP_TRACEEnables httpx request and response dump output for clients created with httpx.New() when the variable is present. Treat output as sensitive.