Commit 66eee2b2a45a2671daed5adf10e776d7394e644c
fix config (again .. sorry)
mixmix committed on 11/10/2018, 6:48:36 AMParent: 512c51cb66cc1ca1080a041399f4495e5009dece
Files changed
config.js | changed |
package-lock.json | changed |
config.js | ||
---|---|---|
@@ -12,26 +12,30 @@ | ||
12 | 12 … | exports.gives = nest('config.sync.load') |
13 | 13 … | exports.create = (api) => { |
14 | 14 … | var config |
15 | 15 … | return nest('config.sync.load', () => { |
16 | - if (!config) { | |
17 | - console.log('LOADING config') | |
18 | - config = Config(appName, opts) | |
16 … | + if (config) return config | |
19 | 17 … | |
20 | - const keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) | |
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}` | |
18 … | + console.log('LOADING config') | |
19 … | + config = Config(appName, opts) | |
20 … | + config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) | |
21 … | + config.remote = buildRemote(config) | |
22 … | + | |
23 … | + if (process.platform !== 'win32') { | |
24 … | + config = merge(config, { | |
25 … | + connections: { | |
26 … | + incoming: { unix: [{ 'scope': 'local', 'transform': 'noauth' }] } | |
31 | 27 … | } |
28 … | + }) | |
29 … | + } | |
32 | 30 … | |
33 | - merge(config, { keys }, socketSettings) | |
34 | - } | |
35 | 31 … | return config |
36 | 32 … | }) |
37 | 33 … | } |
34 … | + | |
35 … | +function buildRemote (config) { | |
36 … | + const pubkey = config.keys.id.slice(1).replace(`.${config.keys.curve}`, '') | |
37 … | + | |
38 … | + return process.platform !== 'win32' | |
39 … | + ? `net:127.0.0.1:${config.port}~shs:${pubkey}` | |
40 … | + : `unix:${Path.join(config.path, 'socket')}:~noauth:${pubkey}` | |
41 … | +} |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 374439 bytes New file size: 374831 bytes |
Built with git-ssb-web