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