git ssb

30+

cel / git-ssb-web



Tree: 93eb7d1f5a8e13d37fb5015a48122af34f5f5f5c

Files: 93eb7d1f5a8e13d37fb5015a48122af34f5f5f5c / server.js

750 bytesRaw
1#!/bin/sh
2':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
3// http://unix.stackexchange.com/questions/65235/universal-node-js-shebang
4// vi: ft=javascript
5
6var appName = process.env.ssb_appname ||
7 require('child_process').spawnSync('git', ['config', 'ssb.appname'],
8 {encoding: 'utf8'}).stdout.trim()
9var ssbConfig = require('ssb-config/inject')(appName)
10var ssbClient = require('ssb-client')
11var keys = require('ssb-keys')
12 .loadOrCreateSync(require('path').join(ssbConfig.path, 'secret'))
13
14require('.')(process.argv[3], function (err, server) {
15 require('ssb-reconnect')(function (cb) {
16 ssbClient(keys, ssbConfig, cb)
17 }, function (err, ssb, reconnect) {
18 if (err) throw err
19 server.setSSB(ssb, reconnect)
20 })
21})
22

Built with git-ssb-web