diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbc3715..8671b130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features +* Builtin Prosody: optional settings to change the url for Prosody's API calls. * Diagnostic tool: testing API communication from Peertube to Prosody. * Diagnostic tool: testing API communication from Prosody to Peertube. diff --git a/client/admin-plugin-client-plugin.ts b/client/admin-plugin-client-plugin.ts index 163b5c0d..c86b7eeb 100644 --- a/client/admin-plugin-client-plugin.ts +++ b/client/admin-plugin-client-plugin.ts @@ -40,6 +40,7 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re case 'chat-type-help-disabled': return options.formValues['chat-type'] !== ('disabled' as ChatType) case 'prosody-port': + case 'prosody-peertube-uri': case 'chat-type-help-builtin-prosody': return options.formValues['chat-type'] !== ('builtin-prosody' as ChatType) case 'chat-server': diff --git a/server/lib/diagnostic/prosody.ts b/server/lib/diagnostic/prosody.ts index 1cb2bea3..4fb84785 100644 --- a/server/lib/diagnostic/prosody.ts +++ b/server/lib/diagnostic/prosody.ts @@ -28,6 +28,8 @@ export async function diagProsody (test: string, options: RegisterServerOptions) result.messages.push(`Prosody will run on port '${wantedConfig.port}'`) prosodyPort = wantedConfig.port + result.messages.push(`Prosody will use ${wantedConfig.baseApiUrl} as base uri from api calls`) + result.messages.push(`Prosody modules path will be '${wantedConfig.paths.modules}'`) await fs.promises.access(filePath, fs.constants.R_OK) // throw an error if file does not exist. diff --git a/server/lib/prosody/config.ts b/server/lib/prosody/config.ts index 5ee2afc1..cf37a8a0 100644 --- a/server/lib/prosody/config.ts +++ b/server/lib/prosody/config.ts @@ -67,6 +67,7 @@ interface ProsodyConfig { content: string paths: ProsodyFilePaths port: string + baseApiUrl: string } async function getProsodyConfig (options: RegisterServerOptions): Promise { const logger = options.peertubeHelpers.logger @@ -80,9 +81,15 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise +In some rare case, Prosody can't call Peertube's API from its public URI. +You can use this field to customise Peertube's URI for Prosody modules (for example with «http://localhost:9000»).` + }) + registerSetting({ name: 'chat-server', label: 'XMPP service server',