✨(frontend) support _FILE environment variables for secrets
Allow configuration variables that handles secrets to be read from a file given in an environment variable.
This commit is contained in:
@@ -34,6 +34,7 @@ and this project adheres to
|
||||
- 🔧(git) set LF line endings for all text files #1032
|
||||
- 📝(docs) minor fixes to docs/env.md
|
||||
- ✨(backend) support `_FILE` environment variables for secrets #912
|
||||
- ✨(frontend) support `_FILE` environment variables for secrets #912
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
export const COLLABORATION_LOGGING =
|
||||
process.env.COLLABORATION_LOGGING || 'false';
|
||||
export const COLLABORATION_SERVER_ORIGIN =
|
||||
process.env.COLLABORATION_SERVER_ORIGIN || 'http://localhost:3000';
|
||||
export const COLLABORATION_SERVER_SECRET =
|
||||
process.env.COLLABORATION_SERVER_SECRET || 'secret-api-key';
|
||||
export const Y_PROVIDER_API_KEY =
|
||||
process.env.Y_PROVIDER_API_KEY || 'yprovider-api-key';
|
||||
export const COLLABORATION_SERVER_SECRET = process.env
|
||||
.COLLABORATION_SERVER_SECRET_FILE
|
||||
? readFileSync(process.env.COLLABORATION_SERVER_SECRET_FILE, 'utf-8')
|
||||
: process.env.COLLABORATION_SERVER_SECRET || 'secret-api-key';
|
||||
export const Y_PROVIDER_API_KEY = process.env.Y_PROVIDER_API_KEY_FILE
|
||||
? readFileSync(process.env.Y_PROVIDER_API_KEY_FILE, 'utf-8')
|
||||
: process.env.Y_PROVIDER_API_KEY || 'yprovider-api-key';
|
||||
export const PORT = Number(process.env.PORT || 4444);
|
||||
export const SENTRY_DSN = process.env.SENTRY_DSN || '';
|
||||
export const COLLABORATION_BACKEND_BASE_URL =
|
||||
|
||||
Reference in New Issue
Block a user