Diagnostic tool: testing API communication from Prosody to Peertube.
This commit is contained in:
@ -85,6 +85,7 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
|
||||
'api/'
|
||||
const authApiUrl = baseApiUrl + 'user' // FIXME: should be protected by apikey, but mod_auth_http cant handle params
|
||||
const roomApiUrl = baseApiUrl + 'room?apikey=' + apikey + '&jid={room.jid|jid_node}'
|
||||
const testApiUrl = baseApiUrl + 'test?apikey=' + apikey
|
||||
|
||||
const config = new ProsodyConfigContent(paths, prosodyDomain)
|
||||
config.useHttpAuthentication(authApiUrl)
|
||||
@ -96,7 +97,7 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
|
||||
// TODO: add a settings to choose?
|
||||
config.useDefaultPersistent()
|
||||
|
||||
config.useTestModule(apikey)
|
||||
config.useTestModule(apikey, testApiUrl)
|
||||
|
||||
let logLevel: ProsodyLogLevel | undefined
|
||||
if (logger.level && (typeof logger.level === 'string')) {
|
||||
|
@ -236,9 +236,10 @@ class ProsodyConfigContent {
|
||||
this.muc.set('muc_room_default_persistent', true)
|
||||
}
|
||||
|
||||
useTestModule (apikey: string): void {
|
||||
useTestModule (prosodyApikey: string, apiurl: string): void {
|
||||
this.global.add('modules_enabled', 'http_peertubelivechat_test')
|
||||
this.global.set('peertubelivechat_test_apikey', apikey)
|
||||
this.global.set('peertubelivechat_test_apikey', prosodyApikey)
|
||||
this.global.set('peertubelivechat_test_peertube_api_url', apiurl)
|
||||
}
|
||||
|
||||
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
|
||||
|
Reference in New Issue
Block a user