diff --git a/src/config/config.ts b/src/config/config.ts index dac6f892d..34e59c82a 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -24,12 +24,13 @@ export function GetConfig(): Configuration { } // Reads the live LND TLS certificate from the file pointed to by LIGHTNING_API_CERTIFICATE_PATH. -// If the path is unset, returns undefined (environments without Lightning, e.g. tests, still boot). +// If the path is unset, falls back to the LIGHTNING_API_CERTIFICATE env var (hosts without the +// LND volume, e.g. prod hosted off DFX servers; tests and non-Lightning envs still boot). // If the path is set but the file is missing/unreadable, readFileSync throws so a broken mount // surfaces immediately instead of being masked by a stale fallback. function readCert(): string | undefined { const path = process.env.LIGHTNING_API_CERTIFICATE_PATH; - if (!path) return undefined; + if (!path) return process.env.LIGHTNING_API_CERTIFICATE?.split('
').join('\n'); return readFileSync(path, 'utf8'); }