git ssb

16+

Dominic / patchbay



Commit 66eee2b2a45a2671daed5adf10e776d7394e644c

fix config (again .. sorry)

mixmix committed on 11/10/2018, 6:48:36 AM
Parent: 512c51cb66cc1ca1080a041399f4495e5009dece

Files changed

config.jschanged
package-lock.jsonchanged
config.jsView
@@ -12,26 +12,30 @@
1212 exports.gives = nest('config.sync.load')
1313 exports.create = (api) => {
1414 var config
1515 return nest('config.sync.load', () => {
16- if (!config) {
17- console.log('LOADING config')
18- config = Config(appName, opts)
16 + if (config) return config
1917
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' }] }
3127 }
28 + })
29 + }
3230
33- merge(config, { keys }, socketSettings)
34- }
3531 return config
3632 })
3733 }
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.jsonView
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