git ssb

2+

mixmix / ticktack



Tree: 7cf0304bc911d7894179eec462e0b37166f9535c

Files: 7cf0304bc911d7894179eec462e0b37166f9535c / config.js

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

Built with git-ssb-web