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