git ssb

2+

mixmix / ticktack



Tree: 94527b097121d2903dc3709ec79709a5804d13c9

Files: 94527b097121d2903dc3709ec79709a5804d13c9 / background-process.js

1365 bytesRaw
1const fs = require('fs')
2const Path = require('path')
3const electron = require('electron')
4const Client = require('ssb-client')
5
6// pull config options out of depject
7const config = require('./config').create().config.sync.load()
8
9var createSbot = require('scuttlebot')
10 .use(require('scuttlebot/plugins/master'))
11 .use(require('scuttlebot/plugins/gossip'))
12 .use(require('scuttlebot/plugins/replicate'))
13 .use(require('ssb-friends'))
14 .use(require('ssb-blobs'))
15 .use(require('ssb-backlinks'))
16 .use(require('ssb-private'))
17 .use(require('scuttlebot/plugins/invite'))
18 .use(require('scuttlebot/plugins/local'))
19 .use(require('scuttlebot/plugins/logging'))
20 .use(require('ssb-query'))
21 .use(require('ssb-about'))
22 // .use(require('ssb-ebt'))
23 .use(require('ssb-ws'))
24 .use(require('ssb-server-channel'))
25
26Client(config.keys, config, (err, ssbServer) => {
27 if (ssbServer === undefined) {
28 console.log('> starting sbot')
29 var sbot = createSbot(config)
30
31 console.log(' > updating updating manifest.json')
32 var manifest = sbot.getManifest()
33 fs.writeFileSync(Path.join(config.path, 'manifest.json'), JSON.stringify(manifest))
34 electron.ipcRenderer.send('server-started')
35 }
36 else {
37 console.log('> sbot running elsewhere')
38 electron.ipcRenderer.send('server-started')
39 // TODO send some warning to the client side
40 }
41})
42
43
44

Built with git-ssb-web