diff --git a/config/config.beta.json b/config/config.beta.json index 9d0f106634..0f01897207 100644 --- a/config/config.beta.json +++ b/config/config.beta.json @@ -51,6 +51,9 @@ }, "matrix": { "wellKnownServer": "gitter-beta.ems.host:443", + "wellKnownClient": { + "homeserverBaseUrl": "https://gitter-beta.ems.host" + }, "bridge": { "homeserverUrl": "https://gitter-beta.ems.host", "serverName": "beta.gitter.im", diff --git a/config/config.prod.json b/config/config.prod.json index 8991a9d2cd..e3ccb7485f 100644 --- a/config/config.prod.json +++ b/config/config.prod.json @@ -48,6 +48,9 @@ }, "matrix": { "wellKnownServer": "gitter.ems.host:443", + "wellKnownClient": { + "homeserverBaseUrl": "https://gitter.ems.host" + }, "bridge": { "homeserverUrl": "https://gitter.ems.host", "serverName": "gitter.im", @@ -56,9 +59,7 @@ "gitterBridgeBackingUsername": "matrixbot", "gitterBridgeProfileUsername": "gitter-badger", "gitterLogoMxc": "mxc://gitter.im/5ca06a9ec041815b7bfe089ec2733507753aa43c", - "extraPowerLevelUserList": [ - ["@moderation:gitter.im", 100] - ] + "extraPowerLevelUserList": [["@moderation:gitter.im", 100]] } }, "virtualUsers": { @@ -67,10 +68,7 @@ } }, "spam-detection": { - "ethereum-dirty-group-list": [ - "57542c12c43b8c601976fa66", - "57542beec43b8c601976e3c5" - ] + "ethereum-dirty-group-list": ["57542c12c43b8c601976fa66", "57542beec43b8c601976e3c5"] }, "notifications": { "notificationsSender": "support@gitter.im", diff --git a/public/templates/wellknown-matrix-client.hbs b/public/templates/wellknown-matrix-client.hbs new file mode 100644 index 0000000000..56012c1268 --- /dev/null +++ b/public/templates/wellknown-matrix-client.hbs @@ -0,0 +1,5 @@ +{ + "m.homeserver": { + "base_url": "{{ matrixWellKnownClient.homeserverBaseUrl }}" + } +} diff --git a/public/templates/wellknown-matrix.hbs b/public/templates/wellknown-matrix-server.hbs similarity index 100% rename from public/templates/wellknown-matrix.hbs rename to public/templates/wellknown-matrix-server.hbs diff --git a/server/handlers/root.js b/server/handlers/root.js index 8236bc8f01..edfc89e1e3 100644 --- a/server/handlers/root.js +++ b/server/handlers/root.js @@ -121,17 +121,31 @@ router.get( if (nconf.get('matrix:wellKnownServer')) { router.get( '/.well-known/matrix/server', - identifyRoute('well-known-matrix'), + identifyRoute('well-known-matrix-server'), preventClickjackingMiddleware, function(req, res) { res.set('Content-Type', 'application/manifest+json'); - res.render('wellknown-matrix', { + res.render('wellknown-matrix-server', { matrixWellKnownServer: nconf.get('matrix:wellKnownServer') }); } ); } +if (nconf.get('matrix:wellKnownClient')) { + router.get( + '/.well-known/matrix/client', + identifyRoute('well-known-matrix-client'), + preventClickjackingMiddleware, + function(req, res) { + res.set('Content-Type', 'application/manifest+json'); + res.render('wellknown-matrix-client', { + matrixWellKnownClient: nconf.get('matrix:wellKnownClient') + }); + } + ); +} + router.get('/robots.txt', identifyRoute('homepage-robots'), preventClickjackingMiddleware, function( req, res