-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconfig.js
55 lines (48 loc) · 1.76 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module.exports = {
origin: process.env.ORIGIN || "http://localhost:8080",
httpPort: process.env.PORT || 8080,
sessionSecret: process.env.SESSION_SECRET || "octocat",
// Timezone offset used for all datetime outputs (by moment.js)
// Defaults to CEST (Central European Summer Time)
timezone: "Europe/Berlin",
// Set to true if the node runs behind a proxy that sets X-Forwarded-* headers
trustProxy: process.env.TRUST_PROXY === "1",
};
if (process.env.FACEBOOK_APP_ID && process.env.FACEBOOK_APP_SECRET) {
module.exports.facebook = {
clientID: process.env.FACEBOOK_APP_ID,
clientSecret: process.env.FACEBOOK_APP_SECRET,
};
}
if (process.env.GOOGLE_APP_ID && process.env.GOOGLE_APP_SECRET) {
module.exports.google = {
clientID: process.env.GOOGLE_APP_ID,
clientSecret: process.env.GOOGLE_APP_SECRET,
};
}
module.exports.mail = process.env.MAIL_SOLUTION;
module.exports.mailFrom = process.env.MAIL_FROM;
if (process.env.MAIL_SOLUTION === "smtp") {
module.exports.mailParams = {
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT),
// secure: true,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
};
} else if (process.env.MAIL_SOLUTION === "mailgun") {
module.exports.mailParams = {
domain: process.env.MAILGUN_DOMAIN,
apiKey: process.env.MAILGUN_API_KEY,
host: process.env.MAILGUN_HOST,
};
} else if (process.env.MAIL_SOLUTION === "mailjet") {
module.exports.mailParams = {
apiKey: process.env.MAILJET_API_KEY,
apiSecret: process.env.MAILJET_API_SECRET,
};
}
module.exports.disableUserRegistration =
process.env.DISABLE_USER_REGISTRATION === "1";