This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.js
134 lines (114 loc) · 3.57 KB
/
default.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
* @fileoverview Production Cloud CNC Core Config
* This config file uses sain defaults
*/
//Export
module.exports = {
//Settings for this core instance
core: {
//Access Control List (Controls what permissions each role has)
acl: {
//List of roles
roles: {
//Role name
admin: {
//What permissions this role inherits
inherits: 'user',
//What permissions this role gains
rules: [
'accounts:all',
'accounts:create',
'accounts:impersonate:start',
'controllers:all',
'controllers:create',
'controllers:key',
'controllers:get',
'controllers:update',
'controllers:remove',
'machines:create',
'machines:update',
'machines:remove'
]
},
//Role name
user: {
//What permissions this role gains
rules: [
'accounts:roles',
'accounts:impersonate:stop',
'accounts:get',
'accounts:update',
'accounts:remove',
'files:all',
'files:create',
'files:get',
'files:raw',
'files:update',
'files:remove',
'trash:all',
'trash:recover',
'trash:remove',
'machines:all',
'machines:get',
'machines:command',
'machines:execute',
'machines:startOutput',
'machines:stopOutput'
]
}
}
},
//Cryptography options
cryptography: {
//TLS certificate and key location (PEM encoded)
cert: './config/cert.cer',
key: './config/key.pem',
//Self signed (Temporarily trust certificate when running healthcheck and tests)
selfSigned: false,
//Session secret location (Used to generate session cookies, should be at least 512 bytes long)
secret: './config/secret.txt',
//[ADVANCED USERS ONLY] Length of OTP/MFA secret (Bytes)
otpSecretLength: 32,
//[ADVANCED USERS ONLY] OTP/MFA window forgiveness (30 second units)
otpWindows: 1
},
//Persistant data storage
data: {
//Filesystem (Used for storing user files)
filesystem: './files/',
//MongoDB URI (Used to store entities)
mongodb: 'mongodb://localhost:27017/cloud-cnc',
//RedisDB URI (Used to store sessions and for socket sharing)
redisdb: 'redis://localhost:6379'
},
//Logging settings
logger: {
//Logging directory (Only used when mode = file)
directory: './logs/',
//Logging mode (file = log to file, console = log to console, silent = don't log)
mode: 'file'
},
//HTTP/Socket server options
server: {
//Allowed CORS domains/addresses
cors: [],
//Listening port
port: 443,
//Session expire time (How long a login is good for) (Milliseconds)
sessionExpire: 1000 * 60 * 30,
//Rate limit window (Milliseconds)
rateLimitWindow: 1000 * 60 * 15,
//Maximum requests per rate limit window (0 to disable)
rateLimitRequests: 100,
//Max upload size (How big are your files going to be)
uploadLimit: '100mb'
}
},
//Settings for connecting to controller(s)
controller: {
//How long to wait after pinging a controller before declaring it offline (Milliseconds)
timeout: 1000 * 3,
//[ADVANCED USERS ONLY] Controller symmetric key length (Used to authenticate controllers with the core) (Bytes)
keyLength: 512
}
};