git ssb

2+

mixmix / ticktack



Tree: ec7545f42881ca25d5d62a67b797b7ca4104ad11

Files: ec7545f42881ca25d5d62a67b797b7ca4104ad11 / 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