diff --git a/CHANGELOG.md b/CHANGELOG.md index c096e11b..cd10dd40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## ??? (Not Released Yet) + +### Minor changes and fixes + +* Diagnostic tool: add the result of `prosodyctl check` in the debug section. + ## 6.2.3 ### Minor changes and fixes diff --git a/server/lib/diagnostic/prosody.ts b/server/lib/diagnostic/prosody.ts index 00ad225c..28039e68 100644 --- a/server/lib/diagnostic/prosody.ts +++ b/server/lib/diagnostic/prosody.ts @@ -1,6 +1,6 @@ import type { RegisterServerOptions } from '@peertube/peertube-types' import { getProsodyConfig, getProsodyConfigContentForDiagnostic, getWorkingDir } from '../prosody/config' -import { getProsodyAbout, testProsodyCorrectlyRunning } from '../prosody/ctl' +import { checkProsody, getProsodyAbout, testProsodyCorrectlyRunning } from '../prosody/ctl' import { newResult, TestResult } from './utils' import { getAPIKey } from '../apikey' import * as fs from 'fs' @@ -190,6 +190,12 @@ export async function diagProsody (test: string, options: RegisterServerOptions) return result } + const check = await checkProsody(options) + result.debug.push({ + title: 'Prosody check', + message: check + }) + // Checking if there is a Prosody error log, and returning last lines. try { await fs.promises.access(prosodyErrorLogPath, fs.constants.R_OK) // throw an error if file does not exist. diff --git a/server/lib/prosody/ctl.ts b/server/lib/prosody/ctl.ts index 351d4d22..eded6fd1 100644 --- a/server/lib/prosody/ctl.ts +++ b/server/lib/prosody/ctl.ts @@ -158,6 +158,11 @@ async function reloadProsody (options: RegisterServerOptions): Promise return true } +async function checkProsody (options: RegisterServerOptions): Promise { + const ctl = await prosodyCtl(options, 'check') + return ctl.message +} + interface ProsodyRunning { ok: boolean messages: string[] @@ -341,6 +346,7 @@ async function ensureProsodyNotRunning (options: RegisterServerOptions): Promise export { getProsodyAbout, + checkProsody, testProsodyRunning, testProsodyCorrectlyRunning, prepareProsody,