Fix muc component http_host.

This commit is contained in:
John Livingston 2021-07-06 11:26:37 +02:00
parent 9a65da50e5
commit 98c5518059
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 3 additions and 4 deletions

View File

@ -190,6 +190,8 @@ class ProsodyConfigContent {
this.anon.set('http_external_url', 'http://' + prosodyDomain) this.anon.set('http_external_url', 'http://' + prosodyDomain)
this.muc.set('restrict_room_creation', 'local') this.muc.set('restrict_room_creation', 'local')
this.muc.set('http_host', prosodyDomain)
this.muc.set('http_external_url', 'http://' + prosodyDomain)
if (this.authenticated) { if (this.authenticated) {
this.authenticated.set('trusted_proxies', ['127.0.0.1', '::1']) this.authenticated.set('trusted_proxies', ['127.0.0.1', '::1'])

View File

@ -127,10 +127,7 @@ async function initWebchatRouter (options: RegisterServerOptions): Promise<Route
if (!prosodyPort) { if (!prosodyPort) {
throw new Error('It seems that prosody is not binded... Cant list rooms.') throw new Error('It seems that prosody is not binded... Cant list rooms.')
} }
// FIXME: can the api be on http://localhost instead of http://room.localhost? const apiUrl = `http://localhost:${prosodyPort}/peertubelivechat_list_rooms/list-rooms`
// This won't work on production servers.
peertubeHelpers.logger.error('FIXME: the prosody url should be fixed before releasing this.')
const apiUrl = `http://room.localhost:${prosodyPort}/peertubelivechat_list_rooms/list-rooms`
peertubeHelpers.logger.debug('Calling list rooms API on url: ' + apiUrl) peertubeHelpers.logger.debug('Calling list rooms API on url: ' + apiUrl)
const rooms = await got(apiUrl, { const rooms = await got(apiUrl, {
method: 'GET', method: 'GET',