mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
✨(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:
parent
31e8ed3a00
commit
6c3850b22b
2 changed files with 10 additions and 4 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in a new issue