This repository was archived by the owner on Jul 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.docker.js
More file actions
60 lines (56 loc) · 1.49 KB
/
config.docker.js
File metadata and controls
60 lines (56 loc) · 1.49 KB
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
/* This config file is used to build the docker image */
/** DETAILED CONFIG TYPINGS CAN BE FOUND IN src/types/config.ts! */
const fs = require('fs')
function secret(name) {
try {
return fs.readFileSync('/run/secrets/' + name).toString()
} catch (ex) {
return process.env[name]
}
}
module.exports = {
bot: {
token: secret('FSB_DBOT_TOKEN'),
mode: 'regular',
clientId: secret('FSB_DBOT_ID') || '672822334641537041'
},
mode: secret('FSB_MODE') === 'single'
? { name: 'single' }
: secret('FSB_MODE') === 'shard'
? {
name: 'shard',
shardIds: secret('FSB_SHARD_IDS')?.split(',').map(parseInt) ?? [],
shardCount: secret('FSB_SHARD_COUNT')
}
: {
name: 'worker',
master: { host: secret('FSB_WORKER_HOST') }
},
mongoDB: {
url: secret('FSB_MONGO_URL'),
dbName: 'freestuffbot'
},
apiSettings: {
key: secret('FSB_FSAPI_KEY'),
type: secret('FSB_FSAPI_TYPE') || 'partner',
baseUrl: secret('FSB_FSAPI_HOST'),
webhookSecret: secret('FSB_WEBHOOK_SECRET')
},
server: {
enable: secret('FSB_SERVER_ENABLE') !== 'false',
port: parseInt(secret('FSB_SERVER_PORT')),
endpoints: {
apiWebhook: secret('FSB_WEBHOOK_ENDPOINT') ?? false,
metrics: secret('FSB_METRICS_ENDPOINT') ?? false
}
},
redis: {
host: secret('FSB_REDIS_HOST'),
port: secret('FSB_REDIS_PORT') || 6379
},
thirdParty: {
sentry: {
dsn: secret('FSB_SENTRY_DSN')
}
}
}