Skip to content

feat(config): make credential and cert paths configurable#3727

Open
djwhitt wants to merge 1 commit into
mainfrom
davidwhittington/configurable-credential-paths
Open

feat(config): make credential and cert paths configurable#3727
djwhitt wants to merge 1 commit into
mainfrom
davidwhittington/configurable-credential-paths

Conversation

@djwhitt

@djwhitt djwhitt commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Part of O11Y-2137.

What

Makes Logflare's file-based credentials and certificates locatable via environment variables, and lets the BigQuery service account key be supplied inline as JSON.

New environment variables (all with backward-compatible defaults):

Variable Default Purpose
GOOGLE_APPLICATION_CREDENTIALS gcloud.json Path to the BigQuery service account key file
GOOGLE_APPLICATION_CREDENTIALS_JSON (unset) Service account key JSON provided inline; takes precedence over the file when set
LOGFLARE_TLS_CERT_PATH cert.pem gRPC TLS certificate path
LOGFLARE_TLS_KEY_PATH cert.key gRPC TLS key path
DB_SSL_CA_CERT_PATH db-server-ca.pem Internal DB SSL server CA cert path
DB_SSL_CLIENT_CERT_PATH db-client-cert.pem Internal DB SSL client cert path
DB_SSL_CLIENT_KEY_PATH db-client-key.pem Internal DB SSL client key path

Why

Today config/runtime.exs reads these secrets as fixed filenames in the working directory (gcloud.json, cert.pem, db-*.pem). That assumes secrets are baked into the image at a known path, which is how the current GCE deployment works but does not fit environments that inject secrets as environment variables or mounted secret volumes (e.g. Kubernetes / Helm).

These changes decouple credential loading from a fixed working directory:

  • Configurable paths let a deployment mount a secret volume anywhere and point Logflare at it.
  • Inline JSON credentials let the BigQuery key ride the same env-var/secret injection path as every other secret, with no file mount at all.

All defaults preserve the existing filenames, so current deployments are unaffected.

Changes

  • config/runtime.exs: resolve credential/cert locations from env vars with the existing filenames as defaults; support inline GOOGLE_APPLICATION_CREDENTIALS_JSON.
  • docs/docs.logflare.com/docs/self-hosting/index.md: document the new variables under the Database SSL and BigQuery setup sections.

Notes

Backward compatible — no behavior change when the new variables are unset.

Related PRs

Part of the Logflare-on-Kubernetes secrets migration:

Allow the BigQuery service account key, gRPC TLS cert/key, and internal
database SSL certificates to be located via environment variables, each
falling back to the existing working-directory filename so current
deployments are unaffected:

- GOOGLE_APPLICATION_CREDENTIALS (default gcloud.json)
- LOGFLARE_TLS_CERT_PATH / LOGFLARE_TLS_KEY_PATH (default cert.pem / cert.key)
- DB_SSL_CA_CERT_PATH / DB_SSL_CLIENT_CERT_PATH / DB_SSL_CLIENT_KEY_PATH

Also allow the service account key to be supplied inline via
GOOGLE_APPLICATION_CREDENTIALS_JSON, which takes precedence over the file
when set.

This decouples credential loading from a fixed working directory, enabling
deployments that inject secrets as environment variables or mounted volumes
(e.g. Kubernetes) rather than baking them into the container image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants