2021-03-23 16:37:11 +01:00
|
|
|
function isDev() {
|
|
|
|
return (
|
|
|
|
!process.env.CLOUD &&
|
|
|
|
process.env.NODE_ENV !== "production" &&
|
|
|
|
process.env.NODE_ENV !== "jest" &&
|
|
|
|
process.env.NODE_ENV !== "cypress" &&
|
|
|
|
process.env.JEST_WORKER_ID == null
|
|
|
|
)
|
|
|
|
}
|
2020-10-26 18:49:33 +01:00
|
|
|
|
|
|
|
let LOADED = false
|
2021-03-23 16:37:11 +01:00
|
|
|
if (!LOADED && isDev()) {
|
|
|
|
require("dotenv").config()
|
2020-10-26 18:49:33 +01:00
|
|
|
LOADED = true
|
|
|
|
}
|
|
|
|
|
2020-05-14 16:12:30 +02:00
|
|
|
module.exports = {
|
2021-03-23 16:37:11 +01:00
|
|
|
// important
|
2020-05-14 16:12:30 +02:00
|
|
|
PORT: process.env.PORT,
|
2021-03-23 16:37:11 +01:00
|
|
|
JWT_SECRET: process.env.JWT_SECRET,
|
2020-05-14 16:12:30 +02:00
|
|
|
COUCH_DB_URL: process.env.COUCH_DB_URL,
|
2021-03-23 16:37:11 +01:00
|
|
|
MINIO_URL: process.env.MINIO_URL,
|
|
|
|
WORKER_URL: process.env.WORKER_URL,
|
|
|
|
CLOUD: process.env.CLOUD,
|
|
|
|
SELF_HOSTED: process.env.SELF_HOSTED,
|
|
|
|
AWS_REGION: process.env.AWS_REGION,
|
|
|
|
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
2021-03-24 13:54:59 +01:00
|
|
|
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
|
|
|
|
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
|
2021-03-23 16:37:11 +01:00
|
|
|
// environment
|
|
|
|
NODE_ENV: process.env.NODE_ENV,
|
|
|
|
JEST_WORKER_ID: process.env.JEST_WORKER_ID,
|
|
|
|
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
|
|
|
|
// minor
|
2020-05-14 16:12:30 +02:00
|
|
|
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
|
|
|
LOGGER: process.env.LOGGER,
|
2020-10-28 21:35:06 +01:00
|
|
|
LOG_LEVEL: process.env.LOG_LEVEL,
|
2020-09-18 17:50:52 +02:00
|
|
|
AUTOMATION_DIRECTORY: process.env.AUTOMATION_DIRECTORY,
|
|
|
|
AUTOMATION_BUCKET: process.env.AUTOMATION_BUCKET,
|
2020-09-18 14:51:56 +02:00
|
|
|
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
2020-10-06 20:13:41 +02:00
|
|
|
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
2021-03-23 16:37:11 +01:00
|
|
|
// old - to remove
|
|
|
|
CLIENT_ID: process.env.CLIENT_ID,
|
|
|
|
BUDIBASE_DIR: process.env.BUDIBASE_DIR,
|
2020-10-28 21:35:06 +01:00
|
|
|
DEPLOYMENT_DB_URL: process.env.DEPLOYMENT_DB_URL,
|
2021-03-22 17:39:11 +01:00
|
|
|
BUDIBASE_API_KEY: process.env.BUDIBASE_API_KEY,
|
|
|
|
USERID_API_KEY: process.env.USERID_API_KEY,
|
|
|
|
DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL,
|
|
|
|
HOSTING_KEY: process.env.HOSTING_KEY,
|
2020-10-28 21:35:06 +01:00
|
|
|
_set(key, value) {
|
|
|
|
process.env[key] = value
|
2020-10-28 23:24:44 +01:00
|
|
|
module.exports[key] = value
|
2020-10-28 21:35:06 +01:00
|
|
|
},
|
2021-03-23 16:37:11 +01:00
|
|
|
isDev,
|
2020-05-14 16:12:30 +02:00
|
|
|
}
|