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
ssh.native.host_key_pathBRIDGE_SSH_NATIVE_HOST_KEY_PATH
redis.native.enabledBRIDGE_REDIS_NATIVE_ENABLED
cluster.orchestrator.provisioner.k8s.namespaceBRIDGE_CLUSTER_ORCHESTRATOR_PROVISIONER_K8S_NAMESPACE

148 settings are reachable this way, which is every setting bridge.reference.yaml documents. 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_TOKENThe shared secret cluster members authenticate to each other with. It also derives the signing secret for web sessions.
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_API_URLBase URL the co-located Britive Broker calls Bridge’s admin API on.
BRIDGE_TLS_INSECUREWhether the broker’s scripts verify Bridge’s certificate.
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_TOKENBritive Broker pool token. The broker consumes it, not Bridge. Setting it also enables automatic license retrieval. See Licensing.
BRITIVE_BROKER_TENANT_SUBDOMAINTenant the broker registers with. The broker consumes it, not Bridge.

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, the path-derived name 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

Service tokens are not set here

Create and revoke read-only credentials for the metrics and cluster endpoints in the Admin console. Bridge stores them in the datastore; they are not configuration settings or environment variables. See Metrics and service tokens.

Last updated on