-
Notifications
You must be signed in to change notification settings - Fork 8
/
config.js
70 lines (63 loc) · 2.93 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
Copyright (C) 2020 Bleskomat s.r.o.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const path = require('path');
let config = {
// Configuration options passed to lnurl-node's createServer function; see:
// https://github.com/chill117/lnurl-node#options-for-createserver-method
lnurl: {
host: process.env.BLESKOMAT_SERVER_HOST || '0.0.0.0',
port: parseInt(process.env.BLESKOMAT_SERVER_PORT || 3000),
url: process.env.BLESKOMAT_SERVER_URL || null,
endpoint: process.env.BLESKOMAT_SERVER_ENDPOINT || '/u',
auth: {
apiKeys: JSON.parse(process.env.BLESKOMAT_SERVER_AUTH_API_KEYS || '[]'),
},
lightning: JSON.parse(process.env.BLESKOMAT_SERVER_LIGHTNING || '{"backend":"dummy","config":{}}'),
store: JSON.parse(process.env.BLESKOMAT_SERVER_STORE || '{"backend":"memory","config":{}}'),
},
coinRates: {
defaults: {
provider: process.env.BLESKOMAT_SERVER_COINRATES_DEFAULTS_PROVIDER || 'coinbase',
},
},
admin: {
// Whether or not to enable the web-based admin interface:
web: process.env.BLESKOMAT_SERVER_ADMIN_WEB === '1' || process.env.BLESKOMAT_SERVER_ADMIN_WEB === 'true',
// The hashed password to access the admin interface:
password: process.env.BLESKOMAT_SERVER_ADMIN_PASSWORD || null,
// Plaintext password:
passwordPlaintext: process.env.BLESKOMAT_SERVER_ADMIN_PASSWORD_PLAINTEXT || null,
// Configuration options to pass to express-session instance:
// https://github.com/expressjs/session#api
session: JSON.parse(process.env.BLESKOMAT_SERVER_ADMIN_SESSION || '{"secret":null,"resave":true,"saveUninitialized":false,"cookie":{"httpOnly":true,"expires":false,"path":"/","sameSite":true}}'),
scrypt: JSON.parse(process.env.BLESKOMAT_SERVER_ADMIN_SCRYPT || '{"keylen":32,"saltBytes":20,"options":{"cost":16384}}'),
},
// The hostname of the TOR socks proxy.
// Used when connecting to an LN backend behind TOR hidden service.
torSocksProxy: process.env.BLESKOMAT_SERVER_TORSOCKSPROXY || '127.0.0.1:9050',
env: {
filePath: process.env.BLESKOMAT_SERVER_ENV_FILEPATH || path.join(__dirname, '.env'),
},
tlsCheck: {
timeout: 5000,
},
lnurlpos: {
enabled: typeof process.env.BLESKOMAT_LNURLPOS_ENABLED === 'undefined' || process.env.BLESKOMAT_LNURLPOS_ENABLED === 'true',
},
};
if (!config.lnurl.url) {
const { endpoint, host, port } = config.lnurl;
config.lnurl.url = `http://${host}:${port}`;
}
module.exports = config;