Files: 9fff2bb9c8cf22a5430644eaf74038867de5071d / 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