This commit is contained in:
parent
6003c2436a
commit
30e7158b7e
@ -1,3 +1,4 @@
|
|||||||
|
import { GetOptions } from "infisical-node/lib/types/InfisicalClient";
|
||||||
import { createInfisicalClient } from "utils";
|
import { createInfisicalClient } from "utils";
|
||||||
|
|
||||||
export let PROXY_SECRET: string;
|
export let PROXY_SECRET: string;
|
||||||
@ -18,22 +19,30 @@ export async function initSecrets(token: string) {
|
|||||||
console.log("Initializing secrets...");
|
console.log("Initializing secrets...");
|
||||||
|
|
||||||
const infisicalClient = createInfisicalClient(token);
|
const infisicalClient = createInfisicalClient(token);
|
||||||
|
const options: GetOptions = {
|
||||||
|
environment: process.env.NODE_ENV || "development",
|
||||||
|
path: "/",
|
||||||
|
type: "shared",
|
||||||
|
};
|
||||||
|
|
||||||
const proxySecret = (await infisicalClient.getSecret("PROXY_SECRET"))
|
const proxySecret = (await infisicalClient.getSecret("PROXY_SECRET", options))
|
||||||
.secretValue;
|
.secretValue;
|
||||||
|
|
||||||
// InfluxDB
|
// InfluxDB
|
||||||
const influxDBUrl = (await infisicalClient.getSecret("INFLUXDB_URL"))
|
const influxDBUrl = (await infisicalClient.getSecret("INFLUXDB_URL", options))
|
||||||
.secretValue;
|
.secretValue;
|
||||||
const influxDBOrg = (await infisicalClient.getSecret("INFLUXDB_ORG"))
|
const influxDBOrg = (await infisicalClient.getSecret("INFLUXDB_ORG", options))
|
||||||
.secretValue;
|
|
||||||
const influxDBBucket = (await infisicalClient.getSecret("INFLUXDB_BUCKET"))
|
|
||||||
.secretValue;
|
|
||||||
const influxDBToken = (await infisicalClient.getSecret("INFLUXDB_TOKEN"))
|
|
||||||
.secretValue;
|
.secretValue;
|
||||||
|
const influxDBBucket = (
|
||||||
|
await infisicalClient.getSecret("INFLUXDB_BUCKET", options)
|
||||||
|
).secretValue;
|
||||||
|
const influxDBToken = (
|
||||||
|
await infisicalClient.getSecret("INFLUXDB_TOKEN", options)
|
||||||
|
).secretValue;
|
||||||
|
|
||||||
// Mongo
|
// Mongo
|
||||||
const mongoUri = (await infisicalClient.getSecret("MONGO_URI")).secretValue;
|
const mongoUri = (await infisicalClient.getSecret("MONGO_URI", options))
|
||||||
|
.secretValue;
|
||||||
|
|
||||||
if (!proxySecret) {
|
if (!proxySecret) {
|
||||||
throw new Error("PROXY_SECRET not set in Infisical");
|
throw new Error("PROXY_SECRET not set in Infisical");
|
||||||
|
Loading…
Reference in New Issue
Block a user