git ssb

2+

mixmix / ticktack



Tree: 3b696465a61e9284103137f873a8fb04c40ab1d2

Files: 3b696465a61e9284103137f873a8fb04c40ab1d2 / 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