-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
server.config.example.js
209 lines (198 loc) · 4.86 KB
/
server.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
module.exports = {
injectify: {
/**
* WARNING: Anyone in the below array
* will have full access to all the projects
* along with the ability to execute server-side
* Javascript in the superuser control panel
*
* http://caius.github.io/github_id/
*/
superusers: [
13242392 // @samdenty99
],
/**
* Your GitHub application configuration
*/
github: {
client_id: 'MY_APP_ID',
client_secret: 'MY_APP_SECRET',
scope: 'read:user gist'
},
/**
* MongoDB configuration
* Passed directly to node-mongodb-native
*/
mongodb: 'mongodb://localhost:19000/injectify',
/**
* The port on which to host the website
*/
express: 3000,
/**
* Make it available over the internet without port forwarding
*/
localtunnel: {
enable: false,
/**
* Set the below variable to use a custom fixed domain
* Subdomains must be lowercase and between 4 and 63 alphanumeric characters.
*
* Set to false to default to random domain
*/
subdomain: false
},
/**
* Enable compression - can be disabled to reduce cpu usage
*/
compression: true,
/**
* Server-side code execution in modules
*/
serverExecution: {
/**
* Commands to enable, comment out to disable them
*/
enabledCommands: [
'_',
'SHELL',
'FUNCTION',
'OBJECT',
'NUMBER',
'STRING',
'WRITE',
'BOOLEAN',
'ARRAY',
]
},
/**
* Rate limiting
*/
rateLimiting: {
/**
* Injectify project API aka 'View JSON'
*
* This requires a lot of CPU to perform (database side)
*/
api: {
windowMs: 2 * 60 * 1000,
max: 70,
delayAfter: 10,
delayMs: 300,
message: JSON.stringify({
success: false,
reason: 'Too many requests, please try again later'
}, null, ' ')
},
inject: {
/**
* The Inject client auth API
*
* Every time a client loads / reloads the page the
* auth API is called by the client from the websocket.
*/
auth: {
windowMs: 2 * 60 * 1000,
max: 100,
headers: false, // As little as possible information should be sent to target
statusCode: 204, // URL will be displayed in targets console if an error code is returned
message: '',
delayAfter: 30,
delayMs: 100
},
/**
* The Inject websocket data limiter
*
* Prevents the client from flooding the server with
* websocket messages, this can often happen due to an
* infinite loop.
*/
websocket: {
windowMs: 2 * 1000,
max: 30 // tokens
},
/**
* The amount of tokens each request should subtract,
* from the max value above. Defaults to 1
*/
tokens: {
pageGhost: 0.05, // Reducing will make mouse stutter
logger: 0.9,
modules: 1,
clientInfo: 1,
}
}
},
/**
* Shows / hides detailed log output
*/
debug: true,
verbose: true,
/**
* Whether to run the server in development mode or not
* If set to yes
* - Website is proxied to http://localhost:8080 (Webpack dev server)
* If set to no
* - Website is loaded from ./interface/
*/
dev: process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() === 'development',
/**
* Discord notifications
*/
discord: {
webhook: 'INSERT_WEBHOOK_URL',
/**
* WidgetBot discord widgets
*
* Sign up at https://widgetbot.io, invite it to your server, make
* sure you enable the appropriate channel and replace the below values
*
* Crate documentation: https://docs.widgetbot.io
*/
widgetbot: {
server: '335836376031428618',
channel: '377173106940182529',
options: '0002',
colors: {
toggle: '#3F51B5'
},
position: {
x: 'left',
y: 'bottom'
},
style: 'material',
beta: false
}
},
/**
* GitHub auto-follow a user
*/
follow: {
enable: false,
username: 'samdenty99'
}
},
/**
* PM2 configuration
*/
apps: [{
// PM2 process name
name: 'injectify',
// injectify server script
script: './src/main.js',
log_date_format: 'DD/MM/YY hh:mm',
// enable the NodeJS debugger
node_args: [
// '--inspect-port=0.0.0.0:18999'
],
// show color in pm2 logs
args: [
'--color'
],
// don't autoreload the server on changes
watch: false,
// set to production
env: {
'NODE_ENV': 'production'
}
}]
}