-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
77 lines (75 loc) · 2.64 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var session = require('express-session');
var MongoStore = require('connect-mongo')(session);
var config = {
production: {
session: {
secret: "ewjdasnkqwiluyrfgbcnxaiureyfhbca",
saveUninitialized: false,
resave: false,
proxy : true,
store: new MongoStore({ url: process.env.MONGODB_URI, ttl: 12 * 60 * 60 }),
cookie: {
path: "/",
httpOnly: true,
sameSite: 'strict',
secure: true, //uncomment for PRO
maxAge: 28800000 //8 hours
},
name: "id"
},
limiter: {
windowMs: 15*60*1000, // 15 minutes
max: 30, // limit each IP to 30 requests per windowMs
delayMs: 0 // disable delaying - full speed until the max limit is reached
},
cloudinary: {
cloud_name: 'hxxbdvyzc',
api_key: '971837284457376',
api_secret: process.env.CLOUDNARY_API_SECRET
},
loginLimiter: {
windowMs: 60*60*1000, // 1 hour window
delayAfter: 3, // begin slowing down responses after the first request
delayMs: 3*1000, // slow down subsequent responses by 3 seconds per request
max: 5, // start blocking after 5 requests
message: "You have tried to login more than 5 times, please try again after an hour"
}
},
development: {
session: {
secret: "ewjdasnkqwiluyrfgbcnxaiureyfhbca",
saveUninitialized: false,
resave: false,
proxy : true,
store: new MongoStore({ url: process.env.MONGODB_URI, ttl: 12 * 60 * 60 }),
cookie: {
path: "/",
httpOnly: true,
sameSite: 'strict',
//secure: true, //uncomment for PRO
maxAge: 28800000 //8 hours
},
name: "id"
},
limiter: {
windowMs: 15*60*1000, // 15 minutes
max: 30, // limit each IP to 30 requests per windowMs
delayMs: 0 // disable delaying - full speed until the max limit is reached
},
cloudinary: {
cloud_name: 'hxxbdvyzc',
api_key: '971837284457376',
api_secret: process.env.CLOUDNARY_API_SECRET
},
loginLimiter: {
windowMs: 60*60*1000, // 1 hour window
delayAfter: 3, // begin slowing down responses after the first request
delayMs: 3*1000, // slow down subsequent responses by 3 seconds per request
max: 5, // start blocking after 5 requests
message: "You have tried to login more than 5 times, please try again after an hour"
}
}
}
exports.get = function get(env) {
return config[env] || config.production;
}