-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-example.js
104 lines (78 loc) · 2.85 KB
/
config-example.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
var config = {};
config.trustscore = {};
config.db = {};
config.user = {};
config.email = {};
// General:
config.fqdn = "http://localhost";
config.backend_fqdn = "https://api.relatedtechnetwork.com";
config.servicename = "User Account System";
config.usingproxy = false;
config.port = 80;
// Rate Limiting:
config.ratelimits = [];
config.ratelimits[0] = {
route: "/auth/",
window: 10 * 60 * 1000,
maxrequests: 20,
};
config.ratelimits[1] = {
route: "/user/",
window: 10 * 60 * 1000,
maxrequests: 5,
};
// CAPTCHA:
config.captcha_secret_bypass_key_enabled = false;
config.captcha_secret_bypass_key = "";
config.hcaptcha = {};
config.hcaptcha.enabled = false;
config.hcaptcha.secret = "";
config.recaptcha = {};
config.recaptcha.enabled = false;
config.recaptcha.secret = "";
// DB
config.db.connection_string = "";
// User
config.user.id_length = 10;
config.user.id_alphabet = "0123456789";
config.user.bcrypt_salt_rounds = 10;
config.user.jwt_auth_secret = "";
config.user.jwt_email_verification_secret = "";
config.user.jwt_password_reset_secret = "";
config.user.jwt_new_ip_secret = "";
config.user.jwt_access_token_expiration = 3600; // In seconds (3600 = 1 hour)
config.user.jwt_refresh_token_expiration = 2678400; // In seconds (2678400 = 31 days)
config.user.google_client_id = "";
config.user.google_client_secret = "";
config.user.github_client_id = "";
config.user.github_client_secret = "";
config.user.discord_client_id = "";
config.user.discord_client_secret = "";
config.user.facebook_client_id = "";
config.user.facebook_client_secret = "";
config.user.email_regex =
/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
config.user.username_regex =
/^(?=.{6,18}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$/;
config.user.password_regex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).*$/;
// Avatar
config.user.avatar = {};
config.user.avatar.size = 250;
config.user.avatar.quality = 90;
config.user.avatar.store_gravatar = true;
config.user.avatar.max_size = 150 * 1024;
config.user.avatar.storage_location = "local";
config.user.avatar.s3 = {};
config.user.avatar.s3.access_key = "";
config.user.avatar.s3.secret_access_key = "";
config.user.avatar.s3.bucket = "";
// Email:
config.email.smtp = {};
config.email.smtp.hostname = "";
config.email.smtp.port = "";
config.email.smtp.secure = "";
config.email.from = '"[Cheese]" <cheese@example.com>';
config.email.smtp.auth = {};
config.email.smtp.auth.user = "";
config.email.smtp.auth.password = "";
module.exports = config;