git ssb

2+

mixmix / ticktack



Tree: 9b94074d61d35f88c4ec4ab4129e90a491c17a4e

Files: 9b94074d61d35f88c4ec4ab4129e90a491c17a4e / config.js

891 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 //{ "port": 43750, "blobsPort": 43751, "ws": { "port": 43751 } }
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