Skip to content
Environment Variables

Environment Variables

An environment variable is a named value the operating system hands to a program when it starts. Bridge uses them to receive settings without writing them into the config file, which matters most for secrets and for values that differ between deployments.

Every setting has a variable, named after its path

You do not need a list. The variable name is the setting’s position in the config file, upper-cased, with each level joined by an underscore and prefixed with BRIDGE_:

Setting in the config fileEnvironment variable
server.listenBRIDGE_SERVER_LISTEN
server.auth.britive.tenantBRIDGE_SERVER_AUTH_BRITIVE_TENANT
server.telemetry.disabledBRIDGE_SERVER_TELEMETRY_DISABLED
server.checkout_api_tokens.enabledBRIDGE_SERVER_CHECKOUT_API_TOKENS_ENABLED
server.checkout_api_tokens.max_token_daysBRIDGE_SERVER_CHECKOUT_API_TOKENS_MAX_TOKEN_DAYS
ssh.native.host_key_pathBRIDGE_SSH_NATIVE_HOST_KEY_PATH
redis.native.enabledBRIDGE_REDIS_NATIVE_ENABLED
vnc.native.enabledBRIDGE_VNC_NATIVE_ENABLED
vnc.browser.enabledBRIDGE_VNC_BROWSER_ENABLED
cluster.orchestrator.provisioner.k8s.namespaceBRIDGE_CLUSTER_ORCHESTRATOR_PROVISIONER_K8S_NAMESPACE

Every setting documented in bridge.reference.yaml is reachable this way. The names come from Bridge’s own configuration structure rather than a maintained list, so a setting added in a later release is settable as soon as it exists.

Write values the way the config file writes them

TypeFormatExample
TextAs-isBRIDGE_SERVER_LOG_LEVEL=debug
NumberDigitsBRIDGE_SERVER_DATASTORE_PORT=5432
Booleantrue or falseBRIDGE_SERVER_TLS_ENABLED=false
DurationA number and a unitBRIDGE_SSH_IDLE_TIMEOUT=30m
ListComma-separatedBRIDGE_SERVER_AUTH_TYPES=britive,ldap

Lists are comma-separated because an environment variable holds a single string. Spaces around a comma are ignored.

Listen addresses accept a bare port. BRIDGE_SSH_NATIVE_LISTEN=2222 binds every interface on port 2222, the same as writing listen: 2222 in the file. To bind one interface, give a host and a port: BRIDGE_SSH_NATIVE_LISTEN=127.0.0.1:2222.

An override completes the config file

Bridge reads the config file, applies environment variables over it, then validates the result once. A file that is missing a required value is completed by an override rather than rejected because of one.

An environment variable takes precedence over the same setting in the file. Nothing in the file overrides an environment variable.

A malformed value stops the process and names the variable. BRIDGE_SERVER_TLS_ENABLED=yes-please fails at startup and says which variable was wrong, rather than being ignored and leaving TLS in a state you did not choose.

Variables with no configuration setting

Bridge reads these from the environment only. The secrets are kept out of every config file deliberately. The identity values differ per process, so a file shared by several processes cannot carry them.

VariablePurpose
BRIDGE_CONFIGPath of the config file to read. The published image sets it per deployment model.
BRIDGE_ENCRYPTION_KEY_B64The key that encrypts checkout credentials at rest. Required in every deployment.
BRIDGE_ENCRYPTION_KEY_FILEThe same key, read from a file instead of the environment.
BRIDGE_ENCRYPTION_ALLOW_GENERATEDDevelopment only. Accepts a generated ephemeral key, which makes stored credentials unreadable after a restart.
BRIDGE_CLUSTER_TOKENShared cluster secret. It is not the credential for broker checkout or check-in requests in v3.
BRIDGE_INSTANCE_IDIdentity of this process.
BRIDGE_WORKER_IDIdentity of a session or proxy worker. The orchestrator sets it.
BRIDGE_WORKER_ADDRAddress a worker advertises to the rest of the cluster.
BRIDGE_CLUSTER_ADDRAddress a worker reaches the orchestrator on.
BRIDGE_BROKER_API_URLCheckout API used by broker scripts. Defaults to http://127.0.0.1:8081 for the colocated broker. External brokers use the Bridge HTTPS URL.
BRIDGE_BROKER_API_TOKEN_FILEBroker credential file. Defaults to /data/keys/bridge-broker-api.token for the colocated broker. External brokers use a protected file containing a checkout token created in the admin panel.
BRIDGE_TLS_INSECUREtrue skips certificate verification for broker API HTTPS requests. Default false. The default loopback API uses HTTP.
BRIDGE_CA_CERTOptional CA bundle for broker API HTTPS requests. Unset by default.
BRIDGE_DEV_LDAP_ADMINDevelopment only. A true value grants Bridge administrator privileges to the LDAP user named admin. Never set it outside a local test harness.
BRITIVE_BROKER_AUTH_TOKENBroker-pool credential. Bridge also uses it for automatic license retrieval and explicitly enabled telemetry.
BRITIVE_BROKER_TENANT_SUBDOMAINTenant subdomain used by the broker and Bridge platform integrations.
BRITIVE_BROKER_AUTO_UPDATEtrue fetches the newest Britive Broker from download.britive.com when the container starts and runs it. If the repository is unreachable or the package does not verify, the broker bundled in the image runs instead. Default false. Needs HTTPS egress to download.britive.com from the orchestrator or single role.
BRITIVE_BROKER_APK_SUITEPackage suite that update reads: stable (default) or next.

In v3.0.1, the container entrypoint exports defaults for BRIDGE_BROKER_API_URL, BRIDGE_BROKER_API_TOKEN_FILE, and BRIDGE_TLS_INSECURE to broker scripts. It preserves nonempty overrides. Bridge creates the credential file at startup. bsh reads that file. BSH_BRIDGE_BROKER_API_TOKEN can instead supply the token or a secret-manager reference. See bsh’s connection overrides.

Platform telemetry defaults to disabled in v3.0.1 and later. Set BRIDGE_SERVER_TELEMETRY_DISABLED=false only after your tenant supports telemetry ingestion, then restart the publisher. See Platform Telemetry.

BRIDGE_ENCRYPTION_KEY_B64 is required, and it must stay constant. It is a 32-byte key, base64-encoded. Bridge encrypts the credentials held for each checkout with it before writing them to the database, so database access alone does not reveal them. Changing the key makes existing encrypted data unreadable. See Operations for what rotating it involves.

Generate one with openssl rand -base64 32.

BRIDGE_NAMESPACE is not a configuration override. The orchestrator passes it through to the workers it creates. The Kubernetes namespace itself is cluster.orchestrator.provisioner.k8s.namespace.

Older variable names still work

Bridge recognised a small number of variables before names were derived from setting paths. Each one remains valid and sets exactly what it always did. Where both forms are set, a nonempty path-derived value wins.

Older nameSettingPath-derived name
BRIDGE_ROLEcluster.roleBRIDGE_CLUSTER_ROLE
BRIDGE_DATASTORE_HOSTserver.datastore.hostBRIDGE_SERVER_DATASTORE_HOST
BRIDGE_DATASTORE_PORTserver.datastore.portBRIDGE_SERVER_DATASTORE_PORT
BRIDGE_DATASTORE_USERserver.datastore.userBRIDGE_SERVER_DATASTORE_USER
BRIDGE_DATASTORE_PASSWORDserver.datastore.passwordBRIDGE_SERVER_DATASTORE_PASSWORD
BRIDGE_DATASTORE_NAMEserver.datastore.nameBRIDGE_SERVER_DATASTORE_NAME
BRIDGE_DATASTORE_SSLMODEserver.datastore.sslmodeBRIDGE_SERVER_DATASTORE_SSLMODE
BRIDGE_TLS_ENABLEDserver.tls.enabledBRIDGE_SERVER_TLS_ENABLED
BRIDGE_HOST_KEY_SEEDssh.native.host_key_seedBRIDGE_SSH_NATIVE_HOST_KEY_SEED
BRIDGE_LDAP_BIND_PASSWORDserver.auth.ldap.bind_passwordBRIDGE_SERVER_AUTH_LDAP_BIND_PASSWORD
BRIDGE_LICENSEserver.license.keyBRIDGE_SERVER_LICENSE_KEY
BRIDGE_LICENSE_PATHserver.license.pathBRIDGE_SERVER_LICENSE_PATH
BRITIVE_TENANTserver.auth.britive.tenantBRIDGE_SERVER_AUTH_BRITIVE_TENANT
BRITIVE_REDIRECT_URLserver.auth.britive.redirect_urlBRIDGE_SERVER_AUTH_BRITIVE_REDIRECT_URL

Create API tokens in the admin panel

In v3.0.2 and later, Admin > API Tokens contains read-only service tokens for monitoring and checkout tokens for external brokers. Bridge stores token hashes in the datastore. Token values are not Bridge configuration settings.

See Metrics and service tokens or Connect an external broker. External broker support defaults to disabled. Its maximum token lifetime defaults to 90 days.

Last updated on