Fix broken API diagnostic.
* Moving http_peertubelivechat_test module in muc component, as the global config has no http_host. * Adding Host HTTP Header to API call from Peertube to Prosody
This commit is contained in:
@ -66,6 +66,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
|
||||
interface ProsodyConfig {
|
||||
content: string
|
||||
paths: ProsodyFilePaths
|
||||
host: string
|
||||
port: string
|
||||
baseApiUrl: string
|
||||
}
|
||||
@ -137,7 +138,8 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
|
||||
content,
|
||||
paths,
|
||||
port,
|
||||
baseApiUrl
|
||||
baseApiUrl,
|
||||
host: prosodyDomain
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,9 +248,9 @@ class ProsodyConfigContent {
|
||||
}
|
||||
|
||||
useTestModule (prosodyApikey: string, apiurl: string): void {
|
||||
this.global.add('modules_enabled', 'http_peertubelivechat_test')
|
||||
this.global.set('peertubelivechat_test_apikey', prosodyApikey)
|
||||
this.global.set('peertubelivechat_test_peertube_api_url', apiurl)
|
||||
this.muc.add('modules_enabled', 'http_peertubelivechat_test')
|
||||
this.muc.set('peertubelivechat_test_apikey', prosodyApikey)
|
||||
this.muc.set('peertubelivechat_test_peertube_api_url', apiurl)
|
||||
}
|
||||
|
||||
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
|
||||
|
@ -195,7 +195,10 @@ async function ensureProsodyRunning (options: RegisterServerOptions): Promise<vo
|
||||
})
|
||||
|
||||
// Set the http-bind route.
|
||||
changeHttpBindRoute(options, config.port)
|
||||
changeHttpBindRoute(options, {
|
||||
host: config.host,
|
||||
port: config.port
|
||||
})
|
||||
|
||||
async function sleep (ms: number): Promise<any> {
|
||||
return new Promise((resolve) => {
|
||||
|
Reference in New Issue
Block a user