-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.js
executable file
·49 lines (45 loc) · 1.05 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
// Copyright (C) 2016 Philipp Henkel
// Licensed under the MIT License (MIT). See LICENSE file for more details.
var convict = require('convict');
// Configuration schema
var config = convict({
http: {
doc: "Enable HTTP server.",
format: Boolean,
default: true,
env: "HTTP",
},
udp: {
doc: "Enable UDF server.",
format: Boolean,
default: true,
env: "UDP"
},
websocket: {
doc: "Enable websocket server.",
format: Boolean,
default: true,
env: "WEBSOCKET"
},
torrentWhitelist: {
doc: "List of allowed info hashes. If this option is omitted, all torrents are allowed.",
format: Array,
default: [],
env: "TORRENT_WHITELIST"
},
stats: {
doc: "Provide tracker statistics via web interface at /stats.",
format: Boolean,
default: true,
env: "STATS"
},
trustProxy: {
doc: "Trust x-forwarded-for header from reverse proxy",
format: Boolean,
default: true,
env: "TRUST_PROXY"
}
});
// Perform validation
config.validate({strict: true});
module.exports = config;