Files: 0f5f9e807fb3a5d6443be8feb5b7c37d511ac125 / config.js
787 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 = 'ssb' //'ticktack-ssb' |
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