Skip to content

Commit

Permalink
read from /sercrets in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario-SO committed Dec 19, 2024
1 parent 3367e38 commit b808c0e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/reel-creator/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ console.log('AWS_SECRET_ACCESS_KEY:', process.env.AWS_SECRET_ACCESS_KEY);
* Use autocomplete to get a list of available regions.
* @type {import('@remotion/lambda').AwsRegion}
*/

const readSecretFile = (path) => {
if (process.env.NODE_ENV === 'development') {
return path;
}
try {
return fs.readFileSync(path, 'utf8').trim();
} catch (error) {
console.error(`Error reading secret file ${path}:`, error);
throw error;
}
};

export const REGION = "us-east-2";

export const SITE_NAME = 'rendering-engine';
Expand All @@ -18,6 +31,7 @@ export const DISK = 10240;
export const TIMEOUT = 900;

export const WEBHOOK_URL = process.env.SERVER_WEBHOOK_URL;
export const WEBHOOK_SECRET = process.env.SERVER_WEBHOOK_SECRET_FILE;
export const AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
export const AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
export const WEBHOOK_SECRET = readSecretFile(process.env.SERVER_WEBHOOK_SECRET_FILE);
export const AWS_ACCESS_KEY_ID = readSecretFile(process.env.AWS_ACCESS_KEY_ID_FILE);
export const AWS_SECRET_ACCESS_KEY = readSecretFile(process.env.AWS_SECRET_ACCESS_KEY_FILE);

0 comments on commit b808c0e

Please sign in to comment.