git ssb

2+

mixmix / ticktack



Tree: 9b05eee01a12392729755fabfccef269c4748684

Files: 9b05eee01a12392729755fabfccef269c4748684 / config.js

775 bytesRaw
1const Config = require('ssb-config/inject')
2const nest = require('depnest')
3const ssbKeys = require('ssb-keys')
4const Path = require('path')
5
6const appName = 'ticktack'
7const opts = process.env.ssb_appname== 'ssb' ? {} : require('./default-config.json')
8
9exports.gives = nest('config.sync.load')
10exports.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