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 file | Environment variable |
|---|---|
server.listen | BRIDGE_SERVER_LISTEN |
server.auth.britive.tenant | BRIDGE_SERVER_AUTH_BRITIVE_TENANT |
ssh.native.host_key_path | BRIDGE_SSH_NATIVE_HOST_KEY_PATH |
redis.native.enabled | BRIDGE_REDIS_NATIVE_ENABLED |
cluster.orchestrator.provisioner.k8s.namespace | BRIDGE_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
| Type | Format | Example |
|---|---|---|
| Text | As-is | BRIDGE_SERVER_LOG_LEVEL=debug |
| Number | Digits | BRIDGE_SERVER_DATASTORE_PORT=5432 |
| Boolean | true or false | BRIDGE_SERVER_TLS_ENABLED=false |
| Duration | A number and a unit | BRIDGE_SSH_IDLE_TIMEOUT=30m |
| List | Comma-separated | BRIDGE_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.
| Variable | Purpose |
|---|---|
BRIDGE_CONFIG | Path of the config file to read. The published image sets it per deployment model. |
BRIDGE_ENCRYPTION_KEY_B64 | The key that encrypts checkout credentials at rest. Required in every deployment. |
BRIDGE_ENCRYPTION_KEY_FILE | The same key, read from a file instead of the environment. |
BRIDGE_ENCRYPTION_ALLOW_GENERATED | Development only. Accepts a generated ephemeral key, which makes stored credentials unreadable after a restart. |
BRIDGE_CLUSTER_TOKEN | The shared secret cluster members authenticate to each other with. It also derives the signing secret for web sessions. |
BRIDGE_INSTANCE_ID | Identity of this process. |
BRIDGE_WORKER_ID | Identity of a session or proxy worker. The orchestrator sets it. |
BRIDGE_WORKER_ADDR | Address a worker advertises to the rest of the cluster. |
BRIDGE_CLUSTER_ADDR | Address a worker reaches the orchestrator on. |
BRIDGE_API_URL | Base URL the co-located Britive Broker calls Bridge’s admin API on. |
BRIDGE_TLS_INSECURE | Whether the broker’s scripts verify Bridge’s certificate. |
BRIDGE_DEV_LDAP_ADMIN | Development 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_TOKEN | Britive Broker pool token. The broker consumes it, not Bridge. Setting it also enables automatic license retrieval. See Licensing. |
BRITIVE_BROKER_TENANT_SUBDOMAIN | Tenant 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 name | Setting | Path-derived name |
|---|---|---|
BRIDGE_ROLE | cluster.role | BRIDGE_CLUSTER_ROLE |
BRIDGE_DATASTORE_HOST | server.datastore.host | BRIDGE_SERVER_DATASTORE_HOST |
BRIDGE_DATASTORE_PORT | server.datastore.port | BRIDGE_SERVER_DATASTORE_PORT |
BRIDGE_DATASTORE_USER | server.datastore.user | BRIDGE_SERVER_DATASTORE_USER |
BRIDGE_DATASTORE_PASSWORD | server.datastore.password | BRIDGE_SERVER_DATASTORE_PASSWORD |
BRIDGE_DATASTORE_NAME | server.datastore.name | BRIDGE_SERVER_DATASTORE_NAME |
BRIDGE_DATASTORE_SSLMODE | server.datastore.sslmode | BRIDGE_SERVER_DATASTORE_SSLMODE |
BRIDGE_TLS_ENABLED | server.tls.enabled | BRIDGE_SERVER_TLS_ENABLED |
BRIDGE_HOST_KEY_SEED | ssh.native.host_key_seed | BRIDGE_SSH_NATIVE_HOST_KEY_SEED |
BRIDGE_LDAP_BIND_PASSWORD | server.auth.ldap.bind_password | BRIDGE_SERVER_AUTH_LDAP_BIND_PASSWORD |
BRIDGE_LICENSE | server.license.key | BRIDGE_SERVER_LICENSE_KEY |
BRIDGE_LICENSE_PATH | server.license.path | BRIDGE_SERVER_LICENSE_PATH |
BRITIVE_TENANT | server.auth.britive.tenant | BRIDGE_SERVER_AUTH_BRITIVE_TENANT |
BRITIVE_REDIRECT_URL | server.auth.britive.redirect_url | BRIDGE_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.