2020-10-26 18:49:33 +01:00
|
|
|
const { resolve, join } = require("./utilities/centralPath")
|
|
|
|
const { homedir } = require("os")
|
|
|
|
const { app } = require("electron")
|
|
|
|
|
|
|
|
let LOADED = false
|
|
|
|
|
|
|
|
if (!LOADED) {
|
|
|
|
const homeDir = app ? app.getPath("home") : homedir()
|
|
|
|
const budibaseDir = join(homeDir, ".budibase")
|
|
|
|
process.env.BUDIBASE_DIR = budibaseDir
|
|
|
|
require("dotenv").config({ path: resolve(budibaseDir, ".env") })
|
|
|
|
LOADED = true
|
|
|
|
}
|
|
|
|
|
2020-05-14 16:12:30 +02:00
|
|
|
module.exports = {
|
|
|
|
CLIENT_ID: process.env.CLIENT_ID,
|
|
|
|
NODE_ENV: process.env.NODE_ENV,
|
|
|
|
JWT_SECRET: process.env.JWT_SECRET,
|
|
|
|
BUDIBASE_DIR: process.env.BUDIBASE_DIR,
|
|
|
|
PORT: process.env.PORT,
|
|
|
|
COUCH_DB_URL: process.env.COUCH_DB_URL,
|
|
|
|
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-14 15:32:20 +02:00
|
|
|
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
|
2020-09-18 14:51:56 +02:00
|
|
|
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
2020-10-06 20:13:41 +02:00
|
|
|
CLOUD: process.env.CLOUD,
|
|
|
|
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
|
|
|
AWS_REGION: process.env.AWS_REGION,
|
2020-10-09 18:07:46 +02:00
|
|
|
DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL,
|
2020-10-21 16:28:30 +02:00
|
|
|
BUDIBASE_API_KEY: process.env.BUDIBASE_API_KEY,
|
2020-10-28 21:35:06 +01:00
|
|
|
USERID_API_KEY: process.env.USERID_API_KEY,
|
|
|
|
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
|
|
|
DEPLOYMENT_DB_URL: process.env.DEPLOYMENT_DB_URL,
|
2020-11-06 13:30:30 +01:00
|
|
|
LOCAL_TEMPLATES: process.env.LOCAL_TEMPLATES,
|
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
|
|
|
},
|
2020-05-14 16:12:30 +02:00
|
|
|
}
|