git ssb

2+

mixmix / ticktack



Tree: 354bcc491180e33154ea042ff61d5912ae2d95ab

Files: 354bcc491180e33154ea042ff61d5912ae2d95ab / config.js

851 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 = 'ssb'
8const opts = appName == 'ssb'
9 ? null
10 : require('./default-config.json')
11
12exports.gives = nest('config.sync.load')
13exports.create = (api) => {
14 var config
15 return nest('config.sync.load', () => {
16 if (!config) {
17 config = Config(appName, opts)
18 config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret'))
19
20 // HACK: fix offline on windows by specifying 127.0.0.1 instead of localhost (default)
21 config.remote = `net:127.0.0.1:${config.port}~shs:${config.keys.id.slice(1).replace('.ed25519', '')}`
22 }
23 return config
24 })
25}
26

Built with git-ssb-web