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 ​

GoForj Apps load .env files before their Wire graph is initialized. See Configuration Reference for file precedence, app overlays, compiled defaults, and compiled overrides.

GoForj uses two reusable naming patterns:

  • App overlay: <APP>_<KEY> overrides <KEY> for one selected App. For example, ADMIN_APP_URL overlays APP_URL, and ADMIN_CACHE_SESSIONS_DRIVER overlays CACHE_SESSIONS_DRIVER while the admin 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.

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.

Driver Options ​

The resource tables list the driver values GoForj Apps accept.

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.

To add driver support, update SUPPORTED_DRIVERS and run forj build. To switch between compiled drivers, update the active driver and restart the App. Unsupported selections fail during generation or App construction.

See Driver Selection to compare local and shared backends.

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_TZUTCApp timezone for local dates, log timestamps, and schedules.
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_MAINTENANCE_ENABLEDfalseForce HTTP maintenance mode from process startup while keeping operational routes available. Queue workers and scheduled tasks continue normally. Prefer the live ./bin/<app> maintenance:enable and maintenance:disable commands for planned work; they connect to the App's configured HTTP port over loopback. Restart after changing this environment policy.
APP_MAINTENANCE_DRIVERmemoryMaintenance state mechanism. memory is local-only, process-scoped, and not recommended for production. Use cache with a distributed generated cache resource in production.
APP_MAINTENANCE_STOREdefaultResource selected from the App runtime's existing generated cache manager when APP_MAINTENANCE_DRIVER=cache. A value such as operations selects the existing CACHE_OPERATIONS_* driver and connection settings.
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_REVISIONEmptyImmutable deployment revision used by framework-managed metrics discovery. Keep it bounded and low-cardinality, such as a commit SHA.
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.

App Timezone ​

Set APP_TZ in .env or in the deployment environment using an IANA timezone name. The App reads the setting at startup.

dotenv
APP_TZ=America/Chicago

APP_TZ sets the default timezone for Go's time.Local, log timestamps, and cron and calendar schedules. Generated Compose services inherit the same setting. Database sessions and automatic persistence use UTC.

HTTP and OpenAPI ​

VariableDefaultPurpose
API_HTTP_HOST0.0.0.0HTTP bind host.
API_HTTP_PORTApp 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_SPA_ACCESS_LOG_ENABLEDfalseInclude successful requests served by a registered SPA in HTTP access logs. SPA failures remain visible when disabled.
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; additional apps use build/<app>/openapi.jsonPath to the OpenAPI artifact served by the generated API reference routes.

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 ADMIN_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 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.

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 [email protected]Local 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.

Database ​

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 drivers compiled into the App. Choices are sqlite, mysql, postgres. 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.

forj new selects mysql by default. The runtime fallback when DB_DRIVER is unset is SQLite. 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 Connections 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 ​

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. Choices are memory, file, null, redis, memcached, dynamodb, sqlite, postgres, mysql, nats. 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 before changing them in a mixed-version deployment. The Cache library compares individual driver capabilities.

File Storage ​

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

New 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. Choices are local, memory, redis, ftp, sftp, s3, gcs, dropbox, rclone. 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 File Storage for path and durability guidance and the Storage library for driver capabilities.

Enable search in the owning App. Use bleve for a local, single-process index and meilisearch for an externally managed service. Bleve is always compiled. The Search guide shows how to provision and query an index.

VariableDefaultPurpose
SEARCH_DRIVERbleveActive backend for indexes without a named driver override.
SEARCH_SUPPORTED_DRIVERSbleve when rendered; active drivers plus bleve when unsetRoot build manifest. Choices are bleve, meilisearch. Add meilisearch before generating and building an App that uses it.
SEARCH_PATHstorage/search; additional Apps render storage/search/<app>Root directory for Bleve indexes. Each index defaults to a child directory named after its exact logical name.
SEARCH_URLEmptyRequired Meilisearch endpoint when that driver is active. The framework does not provision the service.
SEARCH_API_KEYEmptyMeilisearch API key. Supply deployment credentials outside committed files.
SEARCH_PREFIXEmptyMeilisearch physical index-name prefix. Use distinct prefixes for independently owned App indexes.

Define index schemas in app/search.go or app/<app>/search.go. Environment variables select backends and locations; they do not declare schemas or create an implicit default index. After declaring a catalog index, its local configuration can be:

dotenv
SEARCH_DRIVER=bleve
SEARCH_SUPPORTED_DRIVERS=bleve
SEARCH_PATH=storage/search
SEARCH_CATALOG_PATH=storage/search/catalog

Named overrides use SEARCH_<NAME>_DRIVER, SEARCH_<NAME>_PATH, SEARCH_<NAME>_URL, SEARCH_<NAME>_API_KEY, and SEARCH_<NAME>_PREFIX. A named path is the complete physical index path, not a root directory. Driver and remote-service settings inherit root defaults before more-specific named settings apply. SEARCH_SUPPORTED_DRIVERS remains a root build setting.

App overrides use forms such as ADMIN_SEARCH_PATH and ADMIN_SEARCH_CATALOG_URL. Resolution proceeds from global root to App root to global named to App named settings. Index aliases ignore case and replace hyphens with underscores, so catalog-v2 uses SEARCH_CATALOG_V2_*; the logical name and default physical path keep their original spelling. Alias collisions are rejected. Known App prefixes take precedence over ambiguous index prefixes.

Run forj generate --search after changing the build manifest or named index configuration, then forj build. A declared catalog index gets manager.Catalog(). Provision schemas explicitly before first startup; startup validates existing schemas and rejects incompatible definitions. Stop the owner process before provisioning the same Bleve path, and use a separate path or service prefix when rebuilding a schema. See the Search library for the portable index API.

Feature Flags ​

Enable feature in the owning App. The memory and file sources are both compiled. Each named resource configures an evaluator that can read multiple flags. Follow Feature Flags to load a definition file and check a flag.

VariableDefaultPurpose
FEATURE_DRIVERmemoryActive source: memory or file. Vendor SDK adapters are not part of this integration.
FEATURE_SUPPORTED_DRIVERSmemory,fileRoot build manifest. Choices are memory, file.
FEATURE_DOCUMENT{"schema":1,"flags":{}}Startup JSON document for a memory source. Optional for tests and small fixtures; an empty source needs no override.
FEATURE_PATHEmptyRequired definition-file path for a file source. Relative paths resolve from the process working directory.
FEATURE_INITIALIZATION_TIMEOUT5sPositive Go duration bounding initial source loading. Invalid or unavailable initial configuration fails startup.
FEATURE_REFRESH_INTERVAL30sFallback polling and source-read retry interval. Go duration of at least 10ms. Healthy watched files do not poll at this interval.

For a file-backed checkout evaluator, create the definition file before starting the App and configure:

dotenv
FEATURE_CHECKOUT_DRIVER=file
FEATURE_CHECKOUT_PATH=storage/flags/checkout.json

Run forj generate --feature and forj build; the named evaluator is then available through manager.Checkout(). Named settings use FEATURE_<NAME>_DRIVER, FEATURE_<NAME>_DOCUMENT, FEATURE_<NAME>_PATH, FEATURE_<NAME>_INITIALIZATION_TIMEOUT, and FEATURE_<NAME>_REFRESH_INTERVAL. Named evaluators have their own runtime defaults rather than inheriting the default evaluator's settings. FEATURE_SUPPORTED_DRIVERS remains a root build setting.

App overlays use the same names with an App prefix, such as BILLING_FEATURE_CHECKOUT_PATH. Root-declared evaluators are inherited by participating Apps; an evaluator declared only for one App is not initialized by another App.

Flag keys, values, targeting, and rollout rules belong in the definition document. Memory sources start empty by default, and undefined boolean checks return false. File sources refresh through filesystem notifications, with polling when notifications are unavailable. Invalid updates retain the last valid decisions; shutdown stops the file workers. Keep authorization policy separate from flag-controlled presentation or rollout decisions. The Feature library covers standalone SDK drivers.

Events ​

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

VariableDriverDefault or Format
EVENTS_SUPPORTED_DRIVERSAllActive drivers when unset. Choices are inproc, null, redis, nats, natsjetstream, kafka, gcppubsub, sns. 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. The standalone Events library calls the local driver sync; the framework uses inproc and names its JetStream driver natsjetstream.

Queue ​

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. Choices are null, sync, workerpool, redis, nats, sqs, rabbitmq, sqlite, postgres, mysql. 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_TIMEOUT10sWorker drain budget, capped at APP_SHUTDOWN_TIMEOUT. A non-positive value inherits the App 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:[email protected]: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, Queue Workers for lifecycle and scaling, and the Queue library for individual driver capabilities.

Scheduler and Process Shutdown ​

Configure the scheduler's default timezone through the App timezone.

VariableDefaultPurpose
SCHEDULER_COMMAND_TIMEOUT10mMaximum runtime for a command launched by a scheduled task.
SCHEDULER_SUBPROCESS_SHUTDOWN_TIMEOUTAPP_SHUTDOWN_TIMEOUTGrace period for scheduler-owned subprocesses, capped at the App budget. A non-positive value inherits the App budget.
QUEUE_SHUTDOWN_TIMEOUT10sWorker drain budget, capped at APP_SHUTDOWN_TIMEOUT. A non-positive value inherits the App budget.

Mail ​

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

VariableDriverDefault or Format
MAIL_SUPPORTED_DRIVERSAllActive drivers when unset. Choices are log, smtp, resend, postmark, mailgun, sendgrid, ses. Root key only.
MAIL_DRIVERAlllog; rendered Docker projects use smtp.
MAIL_FROM_ADDRESSAll[email protected].
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 and named mailers. The standalone Mail library compares providers and includes an in-memory driver for tests.

Notifications ​

Enable notification in the owning App. The manager supports synchronous log capture and webhook delivery. Follow Notifications to send an alert and configure delivery or retries.

VariableDefaultPurpose
NOTIFICATION_DRIVERlogActive sender: log for redacted local capture or webhook for a configured destination.
NOTIFICATION_SUPPORTED_DRIVERSlog when rendered; active drivers plus log when unsetRoot build manifest. Choices are log, webhook. Include webhook before generating and building an App that uses it. The local log driver remains available.
NOTIFICATION_WEBHOOK_URLEmptyRequired destination URL when webhook is active. Use a trusted deployment-controlled endpoint.
NOTIFICATION_WEBHOOK_FORMATgenericPayload format: generic or slack.
NOTIFICATION_WEBHOOK_TIMEOUT5sPositive Go duration for the webhook request timeout.
NOTIFICATION_WEBHOOK_BEARER_TOKENEmptyOptional bearer authentication token. Keep it in the deployment environment or secret manager.
NOTIFICATION_WEBHOOK_ALLOW_PRIVATEfalseAllow private and loopback destinations when explicitly required by the deployment, such as a local test receiver.

Keep local capture as the default while adding a named webhook sender:

dotenv
NOTIFICATION_DRIVER=log
NOTIFICATION_SUPPORTED_DRIVERS=log,webhook
NOTIFICATION_ALERTS_DRIVER=webhook
NOTIFICATION_ALERTS_WEBHOOK_URL=https://hooks.example.com/alerts

Run forj generate --notification and forj build; the named sender is then available through manager.Alerts(). Named senders accept NOTIFICATION_<NAME>_DRIVER and every NOTIFICATION_<NAME>_WEBHOOK_* setting above. Each sender has its own runtime defaults; an unset named driver uses log, and a named webhook needs its own URL. NOTIFICATION_SUPPORTED_DRIVERS remains a root build setting.

App overlays include forms such as REPORTS_NOTIFICATION_DRIVER and REPORTS_NOTIFICATION_ALERTS_WEBHOOK_URL. Root-declared named senders are inherited by participating Apps; a sender declared only for one App is not initialized by another App. Changing an active driver already in the build manifest requires configuration and restart; adding a driver requires regeneration and a rebuild.

Successful send completion means local capture or provider acceptance, not confirmed recipient receipt. Construction makes no network requests, and shutdown closes owned transport resources. Use queues for durable deferred work and Mail for email composition. The standalone Notification library supports additional drivers.

Logging ​

VariableDefaultPurpose
APP_LOG_FORMATconsoleOutput format: console or json.
APP_LOG_TIMEDisabled; rendered .env enables itInclude timestamps in 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.
APP_LOG_REDACT_KEYSEmptyComma-separated application-specific field names to redact in addition to mandatory secret-bearing names.
APP_LOG_REDACT_MESSAGE_PATTERNSEmptyJSON array of regular expressions replaced with [REDACTED] before output and sink delivery. Invalid JSON or expressions fail during logger construction.

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

Metrics and Runtime Ports ​

Generated runtime metadata assigns the default App ports 3000, 10000, 10001, and 10002. Each additional 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 additional app can use ADMIN_METRICS_PORT=10010, ADMIN_METRICS_SCHEDULER_PORT=10011, and ADMIN_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 demo App.

See Metrics for endpoints, labels, and scrape topology.

OpenTelemetry ​

These app-wide settings configure trace and application log export and do not use the named-resource pattern above. New .env files show only the common overrides; add the settings below when you need to change a default. Metrics use the app's Prometheus-compatible endpoints independently.

Local Defaults and Remote Export ​

Projects with Grafana, Observability, and Docker export traces and logs through Alloy to Tempo and Loki automatically when APP_ENV=local and the grafana Compose profile is active. Host processes use http://127.0.0.1:14318 for HTTP/protobuf or port 14317 for gRPC. Containers use http://alloy:4318 or http://alloy:4317. The host address follows IP_ADDRESS, with wildcard bind addresses resolved to loopback; the published ports follow TEMPO_OTLP_HTTP_PORT and TEMPO_OTLP_GRPC_PORT.

Staging, production, and test processes have no automatic destination. To send traces and logs to an external HTTP/protobuf collector, add:

dotenv
OTEL_EXPORTER_OTLP_ENDPOINT=https://collector.example.com:4318
OTEL_LOGS_EXPORTER=otlp

A generic endpoint enables trace export, but does not enable remote application logs by itself. Logs require OTEL_LOGS_EXPORTER=otlp or a log-specific endpoint. Explicit endpoints override the local receiver for their signal. Set OTEL_TRACES_EXPORTER=none or OTEL_LOGS_EXPORTER=none to disable that signal's export.

Restart the app after changing these settings. Request an HTTP route with access logging enabled, then check the collector for a request span and a request log carrying the same trace ID. Application logs use the active execution's identity when written through appLogger.WithContext(ctx).

Identity and Signal Selection ​

VariableDefaultPurpose
OTEL_SERVICE_NAMEGo module path followed by / and the current app nameService identity shared by traces and logs.
OTEL_RESOURCE_ATTRIBUTESEmptyComma-separated key=value resource attributes, such as service.version=1.2.0,service.namespace=orders. OTEL_SERVICE_NAME takes precedence over a service.name attribute.
OTEL_TRACES_EXPORTERotlp when an endpoint or the local Grafana default selects it; otherwise noneSupports otlp and none. Disabling external trace export does not disable Lighthouse inspect capture.
OTEL_LOGS_EXPORTERotlp for the local Grafana default or a log-specific endpoint; otherwise noneSupports otlp and none. Explicit otlp enables logs at the configured generic endpoint. Console and Lighthouse log outputs remain independent.
OTEL_SDK_DISABLEDfalseDisable OTel span recording and OTLP log export. Console logging remains available.

Endpoints, Protocols, and Headers ​

VariableDefaultPurpose
OTEL_EXPORTER_OTLP_ENDPOINTUnset; local Grafana supplies a receiver when eligibleShared collector base URL. For HTTP/protobuf, exporters append /v1/traces and /v1/logs for enabled signals.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTGeneric endpoint or local receiverTrace-specific destination. For HTTP/protobuf, provide the complete URL, including /v1/traces. Setting this endpoint enables traces unless explicitly disabled.
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTGeneric endpoint or local receiver when logs are enabledLog-specific destination. For HTTP/protobuf, provide the complete URL, including /v1/logs. Setting this endpoint enables logs unless explicitly disabled.
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobufShared transport: http/protobuf or grpc.
OTEL_EXPORTER_OTLP_TRACES_PROTOCOLOTEL_EXPORTER_OTLP_PROTOCOLOverride the trace transport.
OTEL_EXPORTER_OTLP_LOGS_PROTOCOLOTEL_EXPORTER_OTLP_PROTOCOLOverride the log transport.
OTEL_EXPORTER_OTLP_HEADERSEmptyComma-separated name=value authentication or collector headers. Percent-encode reserved characters in values, such as Authorization=Bearer%20example-token.
OTEL_EXPORTER_OTLP_TRACES_HEADERSOTEL_EXPORTER_OTLP_HEADERSReplace the generic headers for trace export.
OTEL_EXPORTER_OTLP_LOGS_HEADERSOTEL_EXPORTER_OTLP_HEADERSReplace the generic headers for log export.

Use absolute http:// or https:// endpoint URLs. For gRPC, use the collector's gRPC port without an HTTP signal path. For example, https://collector.example.com:4317 with OTEL_EXPORTER_OTLP_PROTOCOL=grpc selects gRPC for both enabled signals. Invalid endpoints, headers, exporter selections, and unsupported protocols fail during app construction. Keep credentials in the deployment environment or secret manager, and use HTTPS for remote collectors.

Export Transport Overrides ​

The Go OTel exporters consume these settings. Each generic variable also accepts a signal-specific form by inserting TRACES_ or LOGS_ after OTEL_EXPORTER_OTLP_. For example, OTEL_EXPORTER_OTLP_TRACES_TIMEOUT overrides OTEL_EXPORTER_OTLP_TIMEOUT for traces. A signal-specific value takes precedence over the generic value for that signal.

VariableDefaultPurpose
OTEL_EXPORTER_OTLP_TIMEOUT10000Exporter request timeout in milliseconds.
OTEL_EXPORTER_OTLP_COMPRESSIONNoneSet gzip to compress exported payloads.
OTEL_EXPORTER_OTLP_CERTIFICATESystem trust rootsPath to a PEM certificate file used to verify the collector's TLS certificate.
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATEEmptyPath to the client PEM certificate chain for mutual TLS. Configure it with the matching client key.
OTEL_EXPORTER_OTLP_CLIENT_KEYEmptyPath to the PEM private key for mutual TLS.
OTEL_EXPORTER_OTLP_INSECUREfalseExporter transport-security switch. An explicit endpoint URL's http or https scheme takes precedence; use the URL scheme to select transport security.

Trace Sampling and Limits ​

VariableDefaultPurpose
OTEL_TRACES_SAMPLERparentbased_always_on when trace export or Lighthouse inspect capture is enabled; otherwise always_offHead sampler used by the app's trace provider.
OTEL_TRACES_SAMPLER_ARG1.0Ratio between 0 and 1, used by traceidratio and parentbased_traceidratio.
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT128Maximum attributes per span.
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMITUnlimitedMaximum string attribute value length on a span.
OTEL_ATTRIBUTE_COUNT_LIMIT128Fallback when OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT is unset.
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMITUnlimitedFallback when OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT is unset.
OTEL_SPAN_EVENT_COUNT_LIMIT128Maximum events retained on a span.
OTEL_SPAN_LINK_COUNT_LIMIT128Maximum links retained on a span.
OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT128Maximum attributes per span event.
OTEL_LINK_ATTRIBUTE_COUNT_LIMIT128Maximum attributes per span link.

Supported samplers are always_on, always_off, parentbased_always_on, parentbased_always_off, traceidratio, and parentbased_traceidratio. Ratio values outside 0 through 1 and unsupported sampler names fail during app construction. For example, parentbased_traceidratio with an argument of 0.1 samples approximately 10% of new root traces while respecting an incoming parent's sampling decision.

OTel sampling controls span recording for external export and Lighthouse projection. LIGHTHOUSE_INSPECT_SAMPLE_RATE can further reduce Lighthouse detail capture without reducing external export. Log export is independent of trace sampling, so an exported log can refer to an unsampled trace that is absent from the trace backend.

Batch Delivery ​

Queues are bounded and telemetry delivery is best effort. Trace batches use the SDK defaults below; the framework overrides the log batch size and log batch timeout to 256 records and 5000 milliseconds. Explicit batch environment settings take precedence. All delay and timeout values in this table are milliseconds, not Go duration strings.

VariableDefaultPurpose
OTEL_BSP_MAX_QUEUE_SIZE2048Maximum queued spans awaiting export.
OTEL_BSP_MAX_EXPORT_BATCH_SIZE512Maximum spans per export batch, bounded by queue capacity.
OTEL_BSP_SCHEDULE_DELAY5000Maximum interval between trace batch exports.
OTEL_BSP_EXPORT_TIMEOUT30000Trace processor's export deadline. The transport timeout applies separately.
OTEL_BLRP_MAX_QUEUE_SIZE2048Maximum queued log records. A full log queue drops its oldest records.
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE256Maximum log records per export batch, bounded by queue capacity.
OTEL_BLRP_SCHEDULE_DELAY1000Maximum interval between log batch exports.
OTEL_BLRP_EXPORT_TIMEOUT5000Log processor's export deadline. The transport timeout applies separately.

Shutdown flushes telemetry within the app's shutdown context. Collector failures affect telemetry delivery rather than app readiness. Application log contents can be exported; review logged messages and fields before enabling a remote destination. See Logging for application logging and Inspects for bounded Lighthouse capture.

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.

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.
TEMPO_HTTP_PORT13200Published Tempo query API port.
TEMPO_OTLP_HTTP_PORT14318Published Alloy OTLP HTTP/protobuf receiver port for local traces and logs.
TEMPO_OTLP_GRPC_PORT14317Published Alloy OTLP gRPC receiver port for local traces and logs.
LOKI_HTTP_PORT13100Published Loki query API port.
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.

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.

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.

Generated local services use the App timezone.

Development Service Compose Settings ​

The optional services in generated docker-compose.yml carry these defaults directly. New projects list the available profile names and COMPOSE_PROFILES in .env, but omit the settings below until you need to override a default. DEV_SERVICE_IP_ADDRESS controls the loopback bind used by the catalog services. Redis, Mailpit, VictoriaMetrics, and Grafana retain the IP_ADDRESS compatibility bind described above.

VariableDefaultPurpose
DEV_SERVICE_IP_ADDRESS127.0.0.1Host address used to publish development-service catalog ports.
RUSTFS_API_PORT9000Published RustFS S3 API port.
RUSTFS_CONSOLE_PORT9001Published RustFS console port.
RUSTFS_ACCESS_KEYrustfsadminLocal RustFS access key.
RUSTFS_SECRET_KEYrustfsadminLocal RustFS secret key. Replace it before network exposure.
OPENSEARCH_HTTP_PORT9200Published OpenSearch HTTPS API port.
OPENSEARCH_ANALYZER_PORT9600Published OpenSearch analyzer port.
OPENSEARCH_DASHBOARDS_PORT5601Published OpenSearch Dashboards port.
OPENSEARCH_INITIAL_ADMIN_PASSWORDG0Forj-Local-OpenSearch-2026!Bootstrap password for a fresh OpenSearch data volume.
NATS_CLIENT_PORT4222Published NATS client port.
NATS_MONITORING_PORT8222Published NATS monitoring port.
NATS_USERNAMEgoforjLocal NATS username.
NATS_PASSWORDgoforjLocal NATS password.
RABBITMQ_AMQP_PORT5672Published RabbitMQ AMQP port.
RABBITMQ_MANAGEMENT_PORT15672Published RabbitMQ management UI port.
RABBITMQ_USERNAMEgoforjLocal RabbitMQ username.
RABBITMQ_PASSWORDgoforjLocal RabbitMQ password.
REDPANDA_ADVERTISED_HOSTlocalhostHost advertised by Redpanda for published Kafka and HTTP proxy endpoints.
REDPANDA_SCHEMA_REGISTRY_PORT18081Published Redpanda schema registry port.
REDPANDA_PANDAPROXY_PORT18082Published Redpanda HTTP proxy port.
REDPANDA_KAFKA_PORT19092Published Redpanda Kafka port.
REDPANDA_ADMIN_PORT19644Published Redpanda admin API port.
REDPANDA_CONSOLE_PORT18080Published Redpanda Console port.
DYNAMODB_PORT8000Published DynamoDB Local port.
ELASTICMQ_PORT9324Published ElasticMQ SQS API port.
ELASTICMQ_UI_PORT9325Published ElasticMQ UI port.
PUBSUB_PORT8085Published Google Pub/Sub emulator port.
MEMCACHED_PORT11211Published Memcached port.
MEMCACHED_MEMORY_MB64Memcached memory limit in MiB.
SFTPGO_SFTP_PORT2022Published SFTPGo SFTP port.
SFTPGO_HTTP_PORT8081Published SFTPGo administration port.
SFTPGO_ADMIN_USERNAMEgoforjBootstrap SFTPGo administrator username.
SFTPGO_ADMIN_PASSWORDgoforj-localBootstrap SFTPGo administrator password.
ADMINER_PORT8080Published Adminer HTTP port.
JAEGER_UI_PORT16686Published Jaeger UI port.
JAEGER_OTLP_GRPC_PORT4317Published Jaeger OTLP gRPC port.
JAEGER_OTLP_HTTP_PORT4318Published Jaeger OTLP HTTP port.
QDRANT_HTTP_PORT6333Published Qdrant HTTP port.
QDRANT_GRPC_PORT6334Published Qdrant gRPC port.
TEMPORAL_GRPC_PORT7233Published Temporal gRPC port.
TEMPORAL_UI_PORT8233Published Temporal UI port.
KEYCLOAK_HTTP_PORT8180Published Keycloak HTTP port.
KEYCLOAK_MEMORY_LIMIT1gKeycloak container memory limit.
KEYCLOAK_BOOTSTRAP_ADMIN_USERNAMEadminBootstrap Keycloak administrator username.
KEYCLOAK_BOOTSTRAP_ADMIN_PASSWORDG0Forj-Local-Keycloak!Bootstrap Keycloak administrator password.
MOCKSERVER_PORT1080Published MockServer HTTP port.
MOCKSERVER_MEMORY_LIMIT1gMockServer container memory limit.
MOCKSERVER_LOG_LEVELINFOMockServer log level.
TOXIPROXY_API_PORT8474Published Toxiproxy control API port.
TOXIPROXY_PROXY_PORT8666Published default Toxiproxy listener port. GoForj does not create a proxy automatically.
TOXIPROXY_LOG_LEVELinfoToxiproxy log level.
CLICKHOUSE_HTTP_PORT8123Published ClickHouse HTTP port.
CLICKHOUSE_NATIVE_PORT19000Published ClickHouse native protocol port.
CLICKHOUSE_DATABASEappLocal ClickHouse database.
CLICKHOUSE_USERNAMEgoforjLocal ClickHouse username.
CLICKHOUSE_PASSWORDgoforj-localLocal ClickHouse password.
MEILISEARCH_PORT7700Published Meilisearch HTTP port.

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 Make Command Shared Options and forj dev.

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.