feat(config): make credential and cert paths configurable#3727
Open
djwhitt wants to merge 1 commit into
Open
Conversation
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.
djwhitt
requested review from
Ziinc and
stigglor
and removed request for
stigglor
July 23, 2026 21:13
stigglor
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
GOOGLE_APPLICATION_CREDENTIALSgcloud.jsonGOOGLE_APPLICATION_CREDENTIALS_JSONLOGFLARE_TLS_CERT_PATHcert.pemLOGFLARE_TLS_KEY_PATHcert.keyDB_SSL_CA_CERT_PATHdb-server-ca.pemDB_SSL_CLIENT_CERT_PATHdb-client-cert.pemDB_SSL_CLIENT_KEY_PATHdb-client-key.pemWhy
Today
config/runtime.exsreads 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:
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 inlineGOOGLE_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:
LogflareSecretsChart)