fix: mount referentiel ia token as docker secret
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
/** Lit un secret monté par Docker, sans jamais exposer son contenu aux logs. */
|
||||
export function readSecretFile(path: string | undefined): string {
|
||||
if (!path) return "";
|
||||
try {
|
||||
return readFileSync(path, "utf8").trim();
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export const ENV = {
|
||||
appId: process.env.VITE_APP_ID ?? "",
|
||||
cookieSecret: process.env.JWT_SECRET ?? "",
|
||||
@@ -10,5 +22,5 @@ export const ENV = {
|
||||
mistralApiKey: process.env.MISTRAL_API_KEY ?? "",
|
||||
geminiApiKey: process.env.GEMINI_API_KEY ?? "",
|
||||
referentielIaUrl: process.env.REFERENTIEL_IA_URL ?? "",
|
||||
referentielIaToken: process.env.REFERENTIEL_IA_TOKEN ?? "",
|
||||
referentielIaToken: process.env.REFERENTIEL_IA_TOKEN ?? readSecretFile(process.env.REFERENTIEL_IA_TOKEN_FILE),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user