git ssb

2+

mixmix / ticktack



Commit 1d5204eb5cf8d3b7004c01b71b184796a5582121

Merge pull request #28 from ticktackim/autopubs

implement an auto connecting pub
mix irving authored on 8/21/2017, 4:37:54 AM
GitHub committed on 8/21/2017, 4:37:54 AM
Parent: 8f396ed5f324462779aad3261565e61d9d1156b0
Parent: 0f5f9e807fb3a5d6443be8feb5b7c37d511ac125

Files changed

config.jschanged
main.jschanged
default-config.jsonadded
config.jsView
@@ -3,15 +3,9 @@
33 const ssbKeys = require('ssb-keys')
44 const Path = require('path')
55
66 const appName = 'ssb' //'ticktack-ssb'
7-const opts = process.env.ssb_appname== 'ssb' ? {} :{
8- port: 43750,
9- blobsPort: 43751,
10- ws: {
11- port: 43751
12- }
13-}
7+const opts = process.env.ssb_appname== 'ssb' ? {} : require('./default-config.json')
148
159 exports.gives = nest('config.sync.load')
1610 exports.create = (api) => {
1711 var config
@@ -25,4 +19,5 @@
2519 }
2620 return config
2721 })
2822 }
23+
main.jsView
@@ -30,22 +30,19 @@
3030 )
3131
3232 const api = entry(sockets, nest({
3333 'app.html.app': 'first',
34- 'invite.async.autofollow': 'first'
34+ 'invite.async.autofollow': 'first',
35+ 'config.sync.load': 'first'
3536 }))
3637
3738 document.body.appendChild(api.app.html.app())
3839
39-api.invite.async.autofollow(
40- 'wx.larpa.net:8008:@DTNmX+4SjsgZ7xyDh5xxmNtFqa6pWi5Qtw7cE8aR9TQ=.ed25519~YIRnryeLBhtBa2il9fCWDlAIFWR37Uh63Vep0L6tk6c=',
41- function (err, follows) {
42- console.log('autofollowed', err, follows);
43-})
44-
45-
46-
47-
48-
49-
50-
51-
40+var invite = api.config.sync.load().autoinvite
41+if(invite)
42+ api.invite.async.autofollow(
43+ invite,
44+ function (err, follows) {
45+ console.log('autofollowed', err, follows);
46+ })
47+else
48+ console.log('no invite')
default-config.jsonView
@@ -1,0 +1,9 @@
1+{
2+ "port": 43750,
3+ "blobsPort": 43751,
4+ "ws": { "port": 43751 },
5+ "caps": {"shs": "ErgQF85hFQpUXp69IXtLW+nXDgFIOKKDOWFX/st2aWk="},
6+ "autoinvite": "128.199.132.182:43750:@7xMrWP8708+LDvaJrRMRQJEixWYp4Oipa9ohqY7+NyQ=.ed25519~YC4ZnjHH8qzsyHe2sihW8WDlhxSUH33IthOi4EsldwQ="
7+}
8+
9+

Built with git-ssb-web