git ssb

16+

Dominic / patchbay



Tree: 51e9066a0702c78e11bebb57dd35daea32b5523b

Files: 51e9066a0702c78e11bebb57dd35daea32b5523b / config.js

805 bytesRaw
1const nest = require('depnest')
2const Config = require('ssb-config/inject')
3const ssbKeys = require('ssb-keys')
4const Path = require('path')
5
6const appName = process.env.ssb_appname || 'ssb'
7const opts = appName == 'ssb'
8 ? null
9 : null // 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 console.log('LOADING 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
27

Built with git-ssb-web