Commit 3b8af4cbe35ccf838eead48bbab57bb35ac00709
revert config to use merge
mixmix committed on 11/8/2018, 11:00:40 PMParent: 557f4b880701243b85fff447aa30939faf97a997
Files changed
config.js | changed |
config.js | |||
---|---|---|---|
@@ -1,8 +1,9 @@ | |||
1 | 1 … | const nest = require('depnest') | |
2 | 2 … | const Config = require('ssb-config/inject') | |
3 | 3 … | const ssbKeys = require('ssb-keys') | |
4 | 4 … | const Path = require('path') | |
5 … | +const merge = require('lodash/merge') | ||
5 | 6 … | ||
6 | 7 … | const appName = process.env.ssb_appname || 'ssb' | |
7 | 8 … | const opts = appName === 'ssb' | |
8 | 9 … | ? null | |
@@ -17,18 +18,20 @@ | |||
17 | 18 … | config = Config(appName, opts) | |
18 | 19 … | ||
19 | 20 … | const keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) | |
20 | 21 … | const pubkey = keys.id.slice(1).replace(`.${keys.curve}`, '') | |
22 … | + const socketSettings = (process.platform.startsWith('win')) | ||
23 … | + ? {} | ||
24 … | + : { | ||
25 … | + connections: { | ||
26 … | + incoming: { | ||
27 … | + unix: [{ 'scope': 'local', 'transform': 'noauth' }] | ||
28 … | + } | ||
29 … | + }, | ||
30 … | + remote: `unix:${Path.join(config.path, 'socket')}:~noauth:${pubkey}` | ||
31 … | + } | ||
21 | 32 … | ||
22 | - config.key = keys | ||
23 | - if (!process.platform.startsWith('win')) { | ||
24 | - config.connections = { | ||
25 | - incoming: { | ||
26 | - unix: [{ 'scope': 'local', 'transform': 'noauth' }] | ||
27 | - } | ||
28 | - } | ||
29 | - config.remote = `unix:${Path.join(config.path, 'socket')}:~noauth:${pubkey}` | ||
30 | - } | ||
33 … | + merge(config, { keys }, socketSettings) | ||
31 | 34 … | } | |
32 | 35 … | return config | |
33 | 36 … | }) | |
34 | 37 … | } |
Built with git-ssb-web