Files: 626eee95a35f216215f604c646c666097ef64c50 / config.js
826 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 opts = appName == 'ssb' |
8 | ? null |
9 | : require('./default-config.json') |
10 | |
11 | exports.gives = nest('config.sync.load') |
12 | exports.create = (api) => { |
13 | var config |
14 | return nest('config.sync.load', () => { |
15 | if (!config) { |
16 | config = Config(appName, opts) |
17 | config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) |
18 | |
19 | // HACK: fix offline on windows by specifying 127.0.0.1 instead of localhost (default) |
20 | config.remote = `net:127.0.0.1:${config.port}~shs:${config.keys.id.slice(1).replace('.ed25519', '')}` |
21 | } |
22 | return config |
23 | }) |
24 | } |
25 |
Built with git-ssb-web