aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-29 00:11:45 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-29 00:20:15 -1000
commit9b7c66e9644594fa04a5b88ee37583093b9b84dd (patch)
tree3b7fff9492a058a023cd466806470aec99eef390
parent6cf5e1b999c6e59b1f8092a99d6b0a462a016b34 (diff)
downloadpatchfoo-9b7c66e9644594fa04a5b88ee37583093b9b84dd.tar.gz
patchfoo-9b7c66e9644594fa04a5b88ee37583093b9b84dd.zip
Omit default ssb-server port
-rw-r--r--lib/app.js1
-rw-r--r--lib/render-msg.js2
-rw-r--r--lib/serve.js3
3 files changed, 4 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index 031077f..cb5075d 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -39,6 +39,7 @@ function App(sbot, config) {
this.previewVotes = conf.previewVotes == null ? false : conf.previewVotes
this.previewContacts = conf.previewContacts == null ? false : conf.previewContacts
this.useOoo = conf.ooo == null ? false : conf.ooo
+ this.ssbPort = 8008
var host1 = /:/.test(this.host) ? '[' + this.host + ']' : this.host
this.baseUrl = 'http://' + host1 + ':' + this.port
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 9e33be6..2f265b9 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -751,7 +751,7 @@ RenderMsg.prototype.pub = function (cb) {
if (err) return cb(err)
self.wrapMini([
'connects to ', pubLink, ' at ',
- h('code', addr.host + ':' + addr.port)], cb)
+ h('code', addr.host + (addr.port === self.app.ssbPort ? '' : ':' + addr.port))], cb)
})
}
diff --git a/lib/serve.js b/lib/serve.js
index 61e34da..11e451a 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -4129,6 +4129,7 @@ Serve.prototype.pub = function (path) {
var id = String(path).substr(1)
try { id = decodeURIComponent(id) }
catch(e) {}
+ var portRegexp = new RegExp(':' + self.app.ssbPort + '$')
pull(
ph('section', [
ph('h3', ['Pub addresses: ', self.phIdLink(id)]),
@@ -4136,7 +4137,7 @@ Serve.prototype.pub = function (path) {
self.app.getAddresses(id),
pull.map(function (address) {
return ph('div', [
- ph('code', address)
+ ph('code', address.replace(portRegexp, ''))
])
})
)