From 499ecffe624c0fa1db0bf095fb0a4b3dbd005424 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 23 Jun 2021 12:01:01 +0200 Subject: [PATCH 1/5] Roadmap update. --- ROADMAP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ROADMAP.md b/ROADMAP.md index 8820d081..68241fbb 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -36,3 +36,4 @@ This roadmap is given as an indication. It will be updated as we go along accord [ ] | Builtin Prosody | Add a settings to enable the server to be accessed with XMPP clients. [ ] | ConverseJS | For anonymous user, automatically log in with a random nickname (and allow to change afterward) [ ] | Common | There should be a settings to add terms & conditions in the Peertube's about page (for example if the webchat is hosted anywhere else). +[ ] | Builtin Prosody | Add on option to limit webchat to registered users. From 3b51bf29468adcf6df2c986a7cbb5450525ac3ec Mon Sep 17 00:00:00 2001 From: tytan652 Date: Tue, 13 Jul 2021 17:40:29 +0200 Subject: [PATCH 2/5] Add localhost c2s connections --- client/admin-plugin-client-plugin.ts | 4 ++++ documentation/prosody.md | 16 ++++++++++++++ server/lib/prosody/config.ts | 7 +++++- server/lib/prosody/config/content.ts | 8 +++++-- server/lib/settings.ts | 32 ++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 3 deletions(-) diff --git a/client/admin-plugin-client-plugin.ts b/client/admin-plugin-client-plugin.ts index c86b7eeb..d9f34a70 100644 --- a/client/admin-plugin-client-plugin.ts +++ b/client/admin-plugin-client-plugin.ts @@ -42,7 +42,11 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re case 'prosody-port': case 'prosody-peertube-uri': case 'chat-type-help-builtin-prosody': + case 'prosody-advanced': + case 'prosody-c2s': return options.formValues['chat-type'] !== ('builtin-prosody' as ChatType) + case 'prosody-c2s-port': + return options.formValues['chat-type'] !== ('builtin-prosody' as ChatType) || options.formValues['prosody-c2s'] === false case 'chat-server': case 'chat-room': case 'chat-bosh-uri': diff --git a/documentation/prosody.md b/documentation/prosody.md index 10dc4656..18277ed0 100644 --- a/documentation/prosody.md +++ b/documentation/prosody.md @@ -68,3 +68,19 @@ If the video is local (not from a remote Peertube), the video owner will be admi You can use [ConverseJS moderation commands](https://conversejs.org/docs/html/features.html#moderating-chatrooms) to moderate the room. When you open the chat room in full screen, there will also be a menu with dedicated commands on the top right. + + +### Prosody advanced settings + +#### Enable client to server connections + +This setting enable XMPP clients to connect to the builtin Prosody server. +This option alone **only allows connections from localhost clients**. + +As example, this option can allow an instance of Matterbridge (once it could use anonymous login) *on the same machine* to bridge your chat with another services like a Matrix room. + +##### Prosody client to server port + +The port that will be used by the c2s module of the builtin Prosody server. +XMPP clients shall use this port to connect. +Change it if this port is already in use on your server. \ No newline at end of file diff --git a/server/lib/prosody/config.ts b/server/lib/prosody/config.ts index cf37a8a0..96d60bdf 100644 --- a/server/lib/prosody/config.ts +++ b/server/lib/prosody/config.ts @@ -77,6 +77,11 @@ async function getProsodyConfig (options: RegisterServerOptions): PromiseProsody advanced settings' + }) + + registerSetting({ + name: 'prosody-c2s', + label: 'Enable client to server connections', + type: 'input-checkbox', + default: false, + private: true, + descriptionHTML: +`Enable XMPP clients to connect to the builtin Prosody server.
+This option alone only allows connections from localhost clients.` + }) + + registerSetting({ + name: 'prosody-c2s-port', + label: 'Prosody client to server port', + type: 'input', + default: '52822', + private: true, + descriptionHTML: +`The port that will be used by the c2s module of the builtin Prosody server.
+XMPP clients shall use this port to connect.
+Change it if this port is already in use on your server.
+Keep it close this port on your firewall for now, it will not be accessed from the outer world.` + }) + // ********** settings changes management settingsManager.onSettingsChange(async (settings: any) => { if ('chat-type' in settings) { From fbf9ef3eacbaa603e923a9576658325c09567ffc Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 14 Jul 2021 18:35:46 +0200 Subject: [PATCH 3/5] Rearrange documentation. --- documentation/prosody.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/documentation/prosody.md b/documentation/prosody.md index 18277ed0..c48d15fa 100644 --- a/documentation/prosody.md +++ b/documentation/prosody.md @@ -61,21 +61,12 @@ This is the port that the Prosody server will use. By default it is set to 52800 These settings are common with other chat modes. Here is the documentation: [common settings](./common.md). -## Notes - -All instance moderators and admins will be owner for created chat rooms. -If the video is local (not from a remote Peertube), the video owner will be admin in the chat room. - -You can use [ConverseJS moderation commands](https://conversejs.org/docs/html/features.html#moderating-chatrooms) to moderate the room. -When you open the chat room in full screen, there will also be a menu with dedicated commands on the top right. - - ### Prosody advanced settings #### Enable client to server connections This setting enable XMPP clients to connect to the builtin Prosody server. -This option alone **only allows connections from localhost clients**. +For now, this option **only allows connections from localhost clients**. As example, this option can allow an instance of Matterbridge (once it could use anonymous login) *on the same machine* to bridge your chat with another services like a Matrix room. @@ -83,4 +74,12 @@ As example, this option can allow an instance of Matterbridge (once it could use The port that will be used by the c2s module of the builtin Prosody server. XMPP clients shall use this port to connect. -Change it if this port is already in use on your server. \ No newline at end of file +Change it if this port is already in use on your server. + +## Notes + +All instance moderators and admins will be owner for created chat rooms. +If the video is local (not from a remote Peertube), the video owner will be admin in the chat room. + +You can use [ConverseJS moderation commands](https://conversejs.org/docs/html/features.html#moderating-chatrooms) to moderate the room. +When you open the chat room in full screen, there will also be a menu with dedicated commands on the top right. From ed718d7d276d502d78c0bc9c837530428207e44c Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 14 Jul 2021 18:46:08 +0200 Subject: [PATCH 4/5] Rewriting some c2s code. --- server/lib/prosody/config.ts | 14 +++++++++----- server/lib/prosody/config/content.ts | 12 ++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/server/lib/prosody/config.ts b/server/lib/prosody/config.ts index 96d60bdf..35f44fd0 100644 --- a/server/lib/prosody/config.ts +++ b/server/lib/prosody/config.ts @@ -78,10 +78,6 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise Date: Wed, 14 Jul 2021 18:48:24 +0200 Subject: [PATCH 5/5] Changelog. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc4f09d..9add2665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## v3.2.0 -... +### Features + +* Builtin Prosody: new settings to enable local C2S. For example, can be used with Matterbridge (thanks https://github.com/tytan652) ## v3.1.0