|
| 1 | +module.exports = { |
| 2 | + injectify: { |
| 3 | + /** |
| 4 | + * WARNING: Anyone in the below array |
| 5 | + * will have full access to all the projects |
| 6 | + * along with the ability to execute server-side |
| 7 | + * Javascript in the superuser control panel |
| 8 | + * |
| 9 | + * http://caius.github.io/github_id/ |
| 10 | + */ |
| 11 | + superusers: [ |
| 12 | + 13242392 // @samdenty99 |
| 13 | + ], |
| 14 | + |
| 15 | + /** |
| 16 | + * Your GitHub application configuration |
| 17 | + */ |
| 18 | + github: { |
| 19 | + client_id: 'MY_APP_ID', |
| 20 | + client_secret: 'MY_APP_SECRET', |
| 21 | + scope: 'read:user gist' |
| 22 | + }, |
| 23 | + |
| 24 | + /** |
| 25 | + * MongoDB configuration |
| 26 | + * Passed directly to node-mongodb-native |
| 27 | + */ |
| 28 | + mongodb: 'mongodb://localhost:27017', |
| 29 | + |
| 30 | + /** |
| 31 | + * The port on which to host the website |
| 32 | + */ |
| 33 | + express: 3000, |
| 34 | + |
| 35 | + /** |
| 36 | + * Make it available over the internet without port forwarding |
| 37 | + */ |
| 38 | + localtunnel: { |
| 39 | + enable: false, |
| 40 | + /** |
| 41 | + * Set the below variable to use a custom fixed domain |
| 42 | + * Subdomains must be lowercase and between 4 and 63 alphanumeric characters. |
| 43 | + * |
| 44 | + * Set to false to default to random domain |
| 45 | + */ |
| 46 | + subdomain: false |
| 47 | + }, |
| 48 | + |
| 49 | + /** |
| 50 | + * Enable compression - can be disabled to reduce cpu usage |
| 51 | + */ |
| 52 | + compression: true, |
| 53 | + |
| 54 | + /** |
| 55 | + * Server-side code execution in modules |
| 56 | + */ |
| 57 | + serverExecution: { |
| 58 | + /** |
| 59 | + * Commands to enable, comment out to disable them |
| 60 | + */ |
| 61 | + enabledCommands: [ |
| 62 | + '_', |
| 63 | + 'SHELL', |
| 64 | + 'FUNCTION', |
| 65 | + 'OBJECT', |
| 66 | + 'NUMBER', |
| 67 | + 'STRING', |
| 68 | + 'WRITE', |
| 69 | + 'BOOLEAN', |
| 70 | + 'ARRAY', |
| 71 | + ] |
| 72 | + }, |
| 73 | + |
| 74 | + /** |
| 75 | + * Rate limiting |
| 76 | + */ |
| 77 | + rateLimiting: { |
| 78 | + /** |
| 79 | + * Injectify project API aka 'View JSON' |
| 80 | + * |
| 81 | + * This requires a lot of CPU to perform (database side) |
| 82 | + */ |
| 83 | + api: { |
| 84 | + windowMs: 2 * 60 * 1000, |
| 85 | + max: 70, |
| 86 | + delayAfter: 10, |
| 87 | + delayMs: 300, |
| 88 | + message: JSON.stringify({ |
| 89 | + success: false, |
| 90 | + reason: 'Too many requests, please try again later' |
| 91 | + }, null, ' ') |
| 92 | + }, |
| 93 | + inject: { |
| 94 | + /** |
| 95 | + * The Inject client auth API |
| 96 | + * |
| 97 | + * Every time a client loads / reloads the page the |
| 98 | + * auth API is called by the client from the websocket. |
| 99 | + */ |
| 100 | + auth: { |
| 101 | + windowMs: 2 * 60 * 1000, |
| 102 | + max: 100, |
| 103 | + headers: false, // As little as possible information should be sent to target |
| 104 | + statusCode: 204, // URL will be displayed in targets console if an error code is returned |
| 105 | + message: '', |
| 106 | + delayAfter: 30, |
| 107 | + delayMs: 100 |
| 108 | + }, |
| 109 | + /** |
| 110 | + * The Inject websocket data limiter |
| 111 | + * |
| 112 | + * Prevents the client from flooding the server with |
| 113 | + * websocket messages, this can often happen due to an |
| 114 | + * infinite loop. |
| 115 | + */ |
| 116 | + websocket: { |
| 117 | + windowMs: 2 * 1000, |
| 118 | + max: 30 // tokens |
| 119 | + }, |
| 120 | + /** |
| 121 | + * The amount of tokens each request should subtract, |
| 122 | + * from the max value above. Defaults to 1 |
| 123 | + */ |
| 124 | + tokens: { |
| 125 | + pageGhost: 0.05, // Reducing will make mouse stutter |
| 126 | + logger: 0.9, |
| 127 | + modules: 1, |
| 128 | + clientInfo: 1, |
| 129 | + } |
| 130 | + } |
| 131 | + }, |
| 132 | + |
| 133 | + /** |
| 134 | + * Shows / hides detailed log output |
| 135 | + */ |
| 136 | + debug: true, |
| 137 | + verbose: true, |
| 138 | + |
| 139 | + /** |
| 140 | + * Whether to run the server in development mode or not |
| 141 | + * If set to yes |
| 142 | + * - Website is proxied to http://localhost:8080 (Webpack dev server) |
| 143 | + * If set to no |
| 144 | + * - Website is loaded from ./interface/ |
| 145 | + */ |
| 146 | + dev: process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() === 'development', |
| 147 | + |
| 148 | + /** |
| 149 | + * Discord notifications |
| 150 | + */ |
| 151 | + discord: { |
| 152 | + webhook: 'INSERT_WEBHOOK_URL', |
| 153 | + /** |
| 154 | + * WidgetBot discord widgets |
| 155 | + * |
| 156 | + * Sign up at https://widgetbot.io, invite it to your server, make |
| 157 | + * sure you enable the appropriate channel and replace the below values |
| 158 | + * |
| 159 | + * Crate documentation: https://docs.widgetbot.io |
| 160 | + */ |
| 161 | + widgetbot: { |
| 162 | + server: '335836376031428618', |
| 163 | + channel: '377173106940182529', |
| 164 | + options: '0002', |
| 165 | + colors: { |
| 166 | + toggle: '#3F51B5' |
| 167 | + }, |
| 168 | + position: { |
| 169 | + x: 'left', |
| 170 | + y: 'bottom' |
| 171 | + }, |
| 172 | + style: 'material', |
| 173 | + beta: false |
| 174 | + } |
| 175 | + }, |
| 176 | + |
| 177 | + /** |
| 178 | + * GitHub auto-follow a user |
| 179 | + */ |
| 180 | + follow: { |
| 181 | + enable: false, |
| 182 | + username: 'samdenty99' |
| 183 | + } |
| 184 | + }, |
| 185 | + /** |
| 186 | + * PM2 configuration |
| 187 | + */ |
| 188 | + apps: [{ |
| 189 | + // PM2 process name |
| 190 | + name: 'injectify', |
| 191 | + // injectify server script |
| 192 | + script: './src/main.js', |
| 193 | + log_date_format: 'DD/MM/YY hh:mm', |
| 194 | + // enable the NodeJS debugger |
| 195 | + node_args: [ |
| 196 | + // '--inspect-port=0.0.0.0:18999' |
| 197 | + ], |
| 198 | + // show color in pm2 logs |
| 199 | + args: [ |
| 200 | + '--color' |
| 201 | + ], |
| 202 | + // don't autoreload the server on changes |
| 203 | + watch: false, |
| 204 | + // set to production |
| 205 | + env: { |
| 206 | + 'NODE_ENV': 'production' |
| 207 | + } |
| 208 | + }] |
| 209 | +} |
0 commit comments