fix: mount referentiel ia token as docker secret

This commit is contained in:
Manus
2026-09-30 16:25:53 +00:00
parent e9d25d9270
commit 5eb8c8b3ac
4 changed files with 40 additions and 1 deletions

View File

@@ -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),
};