git ssb

2+

mixmix / ticktack



Tree: 9fff2bb9c8cf22a5430644eaf74038867de5071d

Files: 9fff2bb9c8cf22a5430644eaf74038867de5071d / config.js

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

Built with git-ssb-web