chore: updated init infisical
This commit is contained in:
10
server/src/external/infisical/initInfisical.ts
vendored
10
server/src/external/infisical/initInfisical.ts
vendored
@@ -32,6 +32,7 @@ export const initInfisical = async (params?: { secretPath?: string }) => {
|
||||
environment,
|
||||
projectId,
|
||||
secretPath: params?.secretPath,
|
||||
includeImports: true,
|
||||
});
|
||||
|
||||
// Load secrets into process.env
|
||||
@@ -45,6 +46,15 @@ export const initInfisical = async (params?: { secretPath?: string }) => {
|
||||
}
|
||||
}
|
||||
|
||||
for (const importSecrets of allSecrets?.imports ?? []) {
|
||||
for (const importSecret of importSecrets.secrets) {
|
||||
if (!process.env[importSecret.secretKey]) {
|
||||
process.env[importSecret.secretKey] = importSecret.secretValue;
|
||||
loadedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`✅ Infisical: loaded ${loadedCount} secrets into process.env`);
|
||||
} catch (error) {
|
||||
console.error("❌ Failed to initialize Infisical:", error);
|
||||
|
||||
Reference in New Issue
Block a user