aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 186bb9f..0359a1f 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -256,6 +256,7 @@ RenderMsg.prototype.message = function (cb) {
case 'npm-publish': return this.npmPublish(cb)
case 'npm-packages': return this.npmPackages(cb)
case 'npm-prebuilds': return this.npmPrebuilds(cb)
+ case 'acme-challenges-http-01': return this.acmeChallengesHttp01(cb)
default: return this.object(cb)
}
}
@@ -873,9 +874,9 @@ RenderMsg.prototype.micro = function (cb) {
this.wrapMini(el, cb)
}
-function hJoin(els, seperator) {
+function hJoin(els, seperator, lastSeparator) {
return els.map(function (el, i) {
- return [i === 0 ? '' : separator, el]
+ return [i === 0 ? '' : i === els.length-1 ? lastSeparator : seperator, el]
})
}
@@ -1174,3 +1175,17 @@ RenderMsg.prototype.chessMove = function (cb) {
], cb)
})
}
+
+RenderMsg.prototype.acmeChallengesHttp01 = function (cb) {
+ var self = this
+ self.wrapMini(h('span',
+ 'serves ',
+ hJoin(u.toArray(self.c.challenges).map(function (challenge) {
+ return h('a', {
+ href: 'http://' + challenge.domain +
+ '/.well-known/acme-challenge/' + challenge.token,
+ title: challenge.keyAuthorization,
+ }, challenge.domain)
+ }), ', ', ', and ')
+ ), cb)
+}