Diagnostic tool: testing API communication between Peertube and Prosody.

This commit is contained in:
John Livingston
2021-06-22 10:26:45 +02:00
parent 350a9fa833
commit 7279761c66
8 changed files with 323 additions and 9 deletions

View File

@ -96,6 +96,8 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
// TODO: add a settings to choose?
config.useDefaultPersistent()
config.useTestModule(apikey)
let logLevel: ProsodyLogLevel | undefined
if (logger.level && (typeof logger.level === 'string')) {
if (logger.level === 'error' || logger.level === 'info' || logger.level === 'debug') {

View File

@ -236,6 +236,11 @@ class ProsodyConfigContent {
this.muc.set('muc_room_default_persistent', true)
}
useTestModule (apikey: string): void {
this.global.add('modules_enabled', 'http_peertubelivechat_test')
this.global.set('peertubelivechat_test_apikey', apikey)
}
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
let log = ''
log += 'log = {\n'