git ssb

2+

mixmix / ticktack



Tree: 0074af959f89d219d5c3aa451d487d1fa0131309

Files: 0074af959f89d219d5c3aa451d487d1fa0131309 / config / index.js

896 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('./config-ssb.json') : require('./config-custom.json')
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