git ssb

2+

mixmix / ticktack



Tree: f1e1c0f3aedd176590017f411e2a923155169442

Files: f1e1c0f3aedd176590017f411e2a923155169442 / config.js

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

Built with git-ssb-web