git ssb

2+

mixmix / ticktack



Tree: f86b6960484fc0d6810893b57c1d3dbaf5de46aa

Files: f86b6960484fc0d6810893b57c1d3dbaf5de46aa / config.js

892 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

Built with git-ssb-web