Files: adca29179dee2177af6fefa725c91581ffef5395 / config.js
892 bytesRaw
1 | const Config = require('ssb-config/inject') |
2 | const nest = require('depnest') |
3 | const ssbKeys = require('ssb-keys') |
4 | const Path = require('path') |
5 | |
6 | // const appName = process.env.ssb_appname || 'ticktack' //'ticktack' TEMP: this is for the windowsSSB installer only |
7 | const appName = process.env.ssb_appname || 'ssb' |
8 | var opts = appName === 'ssb' ? require('./ssb-config.json') : require('./default-config') |
9 | |
10 | exports.gives = nest('config.sync.load') |
11 | exports.create = (api) => { |
12 | var config |
13 | return nest('config.sync.load', () => { |
14 | if (!config) { |
15 | config = Config(appName, opts) |
16 | config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) |
17 | |
18 | // HACK: fix offline on windows by specifying 127.0.0.1 instead of localhost (default) |
19 | config.remote = `net:127.0.0.1:${config.port}~shs:${config.keys.id.slice(1).replace('.ed25519', '')}` |
20 | } |
21 | return config |
22 | }) |
23 | } |
24 |
Built with git-ssb-web