git ssb

2+

mixmix / ticktack



Tree: e57c5f14597311bb19cb42a5208dcf94188919ba

Files: e57c5f14597311bb19cb42a5208dcf94188919ba / config.js

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

Built with git-ssb-web