git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit d12d51a61f5085da816cef02fbd79c5e406125ba

Serve ACME challenges

cel committed on 7/25/2017, 6:43:50 AM
Parent: d9737b8da7935049dc1e0bfb9b0147eada9f7843

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -65,8 +65,9 @@
6565 }
6666
6767 var getMsg = memo({cache: lru(100)}, getMsgWithValue, sbot)
6868 var getAbout = memo({cache: lru(100)}, require('./lib/about'), sbot)
69+ var serveAcmeChallenge = require('ssb-acme-validator')(sbot)
6970
7071 http.createServer(serve).listen(port, host, function () {
7172 console.log('[viewer] Listening on http://' + host + ':' + port)
7273 })
@@ -79,8 +80,9 @@
7980 var m = urlIdRegex.exec(req.url)
8081
8182 if (req.url.startsWith('/user-feed/')) return serveUserFeed(req, res, m[4])
8283 else if (req.url.startsWith('/channel/')) return serveChannel(req, res, m[4])
84+ else if (req.url.startsWith('/.well-known/acme-challenge')) return serveAcmeChallenge(req, res)
8385
8486 if (m[2] && m[2].length === 3) {
8587 m[1] = decodeURIComponent(m[1])
8688 m[2] = m[1][0]
package.jsonView
@@ -13,8 +13,9 @@
1313 "lrucache": "^1.0.2",
1414 "pull-cat": "^1.1.11",
1515 "pull-paramap": "^1.2.1",
1616 "pull-stream": "^3.5.0",
17+ "ssb-acme-validator": "http://localhost:8989/blobs/get/&gB8wJuZROfFYWv+vxXaX4dBRG/U0W7eBNtFkkyN7A60=.sha256",
1718 "ssb-client": "^4.4.0",
1819 "ssb-marked": "^0.7.2",
1920 "ssb-ref": "^2.6.2",
2021 "ssb-sort": "^1.0.0",

Built with git-ssb-web