Commit Graph

409 Commits

Author SHA1 Message Date
John Livingston 19fca3891a
New avatars:
* moving files in better directory structure
* new bot avatar
2024-02-09 11:16:29 +01:00
John Livingston b9b0eb41d9
New avatars set WIP:
* adding new avatars by David Revoy
* replacing old avatars to test

TODO: add a settings to choose between legacy and new avatars.
TODO: generate a bot avatar.
2024-02-08 18:49:49 +01:00
John Livingston c008e84da7
Fix #295: Prosody: disabling message carbons for anonymous users.
Anonymous users can't use carbons, as they cannot connect with multiple
tabs on the same anonymous account.
So we disable carbons on the anonymous virtualhost, to improve
performances.

See here for some performances tests: https://github.com/JohnXLivingston/livechat-perf-test/tree/main/tests/50-anonymous-carbons
2024-02-01 15:20:52 +01:00
John Livingston 5d4bfceb73
Hidden force_default_hide_muc_participants query parameter, for testing
purpose.
2024-01-31 18:12:53 +01:00
John Livingston 5614987901
Fix self-signed certificates on ubuntu + v8.0.2:
* On some Ubuntu server, the self-signed certificates generation fails:
  * See [issue #268](https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/268)
  * This prevents the bot to connect to the server
  * As a fallback, we directly call openssl to generate the certificates
2023-09-27 14:29:17 +02:00
John Livingston 353f2d03f3
Fix disabling bot 2023-09-26 14:37:56 +02:00
John Livingston 6705cd9e3d
Fix multiline. 2023-09-25 15:37:58 +02:00
John Livingston b8aef07182
Forbidden words comment field. 2023-09-25 13:16:15 +02:00
John Livingston 06b9417650
Channel configuration UI: form validation. 2023-09-25 12:51:15 +02:00
John Livingston e2c85af001
Bot avatar:
* For now, only one avatar possible,
* uses mod_random_vcard_peertubelivechat,
* mod_random_vcard_peertubelivechat has a new option with the avatar
  list (instead of a hardcoded avatar number)
* Peertube lists available avatars files, and pass it to mod_random_vcard_peertubelivechat
2023-09-25 11:20:46 +02:00
John Livingston d80cedfee5
Auto ban anonymous IP:
* New settings: "Ban anonymous user's IP when user is banned from a chatroom":
  * if enabled, every time a streamer bans an anonymous user, it will ban its IP on the chat server,
  * banned IPs are logged on disk, so server's admin can use them to feed fail2ban (for example),
  * option disabled by default, because could be used to create trapped-rooms on public servers
2023-09-22 18:17:54 +02:00
John Livingston 562073fc09
Channel conf UI WIP 2023-09-22 16:45:09 +02:00
John Livingston aa71a302f6
Channel Configuration UI WIP 2023-09-22 16:45:08 +02:00
John Livingston cc673bd3cb
Refactoring. 2023-09-22 16:45:08 +02:00
John Livingston eed88e9339
UI WIP. 2023-09-22 16:45:08 +02:00
John Livingston f00bac5eb1
Channel configuration UI + disabling bannedJIDs (for now) 2023-09-22 16:45:07 +02:00
John Livingston 6c966f608b
Stronger password. 2023-09-22 16:45:07 +02:00
John Livingston 852221d232
Moderation. 2023-09-22 16:45:07 +02:00
John Livingston 4fe972dc10
Configure bot name + refactoring. 2023-09-22 16:45:07 +02:00
John Livingston 9e7d9c6069
Bot must be admin on the MUC component. 2023-09-22 16:45:07 +02:00
John Livingston e0c31f09aa
Fix bot authentication. 2023-09-22 16:45:06 +02:00
John Livingston de9de8e358
wip 2023-09-22 16:45:06 +02:00
John Livingston 8b9da417b3
Fix bot spawning, avoiding extra npm process. 2023-09-22 16:45:06 +02:00
John Livingston 437fa4c17b
log level. 2023-09-22 16:45:06 +02:00
John Livingston 2289d79c28
Various fix and wip 2023-09-22 16:45:06 +02:00
John Livingston f97e54d499
Moderation Bot integration WIP:
* Start and stop the bot WIP
* Prosody: removing the BOSH module from the global scope (must only be present on relevant virtualhosts)
* Some refactoring
2023-09-22 16:45:06 +02:00
John Livingston 65fd49a81c
Fix rebuild 2023-09-22 16:45:05 +02:00
John Livingston 55fa6c0623
Fix rebuild 2023-09-22 16:45:05 +02:00
John Livingston 59c0c0c89b
removing unecessary await 2023-09-22 16:45:05 +02:00
John Livingston 260a25f411
Updating room-channel when prosody-room-type is changed 2023-09-22 16:45:05 +02:00
John Livingston 0e201d4e43
Fix muc domain 2023-09-22 16:45:05 +02:00
John Livingston de243bdc01
Fix. 2023-09-22 16:45:05 +02:00
John Livingston 065b6f0ed3
Fix 2023-09-22 16:45:05 +02:00
John Livingston a8c71fbadf
Store Bot configuration 2023-09-22 16:45:04 +02:00
John Livingston 35c9494ed7
Store bot configuration WIP 2023-09-22 16:45:04 +02:00
John Livingston 231ca3d177
Fix video updated action. 2023-09-22 16:45:04 +02:00
John Livingston 28faad6bbe
WIP: store and get relation between rooms and channels:
* fix rebuildData
* write data to disk
2023-09-22 16:45:04 +02:00
John Livingston e4683cf282
WIP: store and get relation between rooms and channels:
* rebuildData
* handling video update (to check for channel changes)
2023-09-22 16:45:04 +02:00
John Livingston ea1c008ded
Fix: readData must have an atomic part. 2023-09-22 16:45:04 +02:00
John Livingston c900d2d1d4
WIP: store and get relation between rooms and channels (refactoring) 2023-09-22 16:45:04 +02:00
John Livingston 32b52adebb
WIP: store and get relation between rooms and channels 2023-09-22 16:45:03 +02:00
John Livingston 1a1b246d45
refactoring. 2023-09-22 16:45:03 +02:00
John Livingston d410d4e08e
Settings to disable the bot and the advances channel configuration 2023-09-22 16:45:02 +02:00
John Livingston 5373fb1570
Renaming 'moderation' pages to 'configuration'. 2023-09-22 16:45:02 +02:00
John Livingston d0ba7d017d
External Components interface configuration:
You can now configure on which network interfaces Prosody will listen for external components.
2023-09-22 16:45:02 +02:00
John Livingston 7e89e430d0
Moderation configuration screen: store options. 2023-09-22 16:45:02 +02:00
John Livingston 0987a036a0
Moderation configuration screen: WIP. 2023-09-22 16:45:01 +02:00
John Livingston cb6decfa84
Fix: only local channels. 2023-09-22 16:45:01 +02:00
John Livingston a25c4822fa
Moderation configuration screen: WIP. 2023-09-22 16:45:01 +02:00
John Livingston 02728bb38d
Moderation configuration screen: WIP. 2023-09-22 16:45:01 +02:00
John Livingston 64668733c8
Code refactoring:
Splitting API code in several files.
2023-09-07 17:20:01 +02:00
John Livingston 9f8a9ae5ae
Fix typo. 2023-08-07 10:19:42 +02:00
John Livingston 609b9e99ec Fix #100: API endpoint enhancement
Bypassing Nginx for API call originated from Prosody (if Peertube >=5.1).
Can also fix some Docker setup, which needed to set the prosody-peertube-uri settings.
2023-08-02 17:08:42 +02:00
John Livingston f7a32e95d4
Code refactoring:
Cleaning some backend code, for a better readability.
2023-08-01 18:42:24 +02:00
John Livingston d33795f7a1
Code refactoring WIP:
Cleaning the way ConverseJS parameters are given to the full page.
2023-08-01 17:01:09 +02:00
John Livingston 3fd6b9b563
Links to online documentation:
* Adding a help button on top of the chat, that links to the online documentation on frama.io.
* Replaced github.io documentation links by frama.io documentation.
* Adding links to the documentation in the diagnostic tool.
2023-07-26 18:16:30 +02:00
John Livingston ad8b71b582
New debug modes for AP/RSS publishing. 2023-07-06 16:39:32 +02:00
John Livingston 995dfa4dff Some refactoring. 2023-07-06 14:10:05 +02:00
Alecks Gates e4d6626d6e Remove "room." from from podcast:chat server 2023-07-06 14:10:05 +02:00
Alecks Gates 97a5d4b408 Initial WIP commit to add <podcast:chat> tag to Podcast RSS feeds 2023-07-06 14:10:05 +02:00
John Livingston 3627ef25f6
FEP-1970: name attribute.
Related to #113.
2023-07-05 12:10:27 +02:00
John Livingston f7e7cddf72
FEP-1970: implementation WIP:
Adding the data on outgoing objects.

Related to #113.
2023-07-04 18:09:50 +02:00
John Livingston f73ccbbf7e
Localization refactoring:
* the front-end now use global constants, based on the translation key
* build-client.js use the ESBuild "define" directive to replace these
  globals at compile time, by the english value
* build:client must now be called after build:languages
* moving the loadLoc and loc backend functions in a separate lib
2023-06-12 19:36:14 +02:00
John Livingston 89a11cd3d6
Changing the way the translations are handled:
To make the Weblate integration simplier, this commit merge all
translations in yml files (there is no more distinction between
standards and settings strings)

This yml files will be handled by Weblate.

TODO: document the new translation process.
2023-06-09 17:08:39 +02:00
John Livingston 8f66ea4032
Fix #180: Letsencrypt import not working
Letsencrypt certificate import procedure was not working on server that had never installed Prosody.
Adding `prosody_user` in the Prosody configuration file to fix this.
Updating the procedure: the `chown` is no more needed in `/etc/letsencrypt/renewal-hooks/deploy/prosody.sh`.
2023-06-08 10:22:43 +02:00
John Livingston 472caf9f5b
Fix: direct s2s connection not always possible
Trying to connect to a remote instance using direct s2s won't work if local instance has not the feature enabled, and if the remote instance does not know the local one.
So using Websocket S2S in such case (that embed a discovery mecanism).
2023-06-01 13:06:59 +02:00
John Livingston f644ad0d88
Fix #124 (dirty hack):
This commit is a dirty hack to fix issue with ARM64 Prosody AppImage.
The fixed appimagebuild tool is not released by the dev team.
So i patch it in my build script. This is not a good solution, but it
works, and let me go forward.
2023-05-31 18:13:35 +02:00
John Livingston 0185b56cab
Some comments. 2023-05-31 17:08:17 +02:00
John Livingston dbf43ae016
Prosody recommended version is 0.12.x. 2023-05-31 16:52:55 +02:00
John Livingston 743c4eabd9
Chat Federation, avoid spoofing:
When sanitizing remote informations, we check that urls and hosts are on
the correct domain or subdomain.
2023-05-31 16:52:54 +02:00
John Livingston b3582e6bfa
Fix missing self signed certificates is some conditions. 2023-05-31 16:52:53 +02:00
John Livingston 2de38661d6
Websocket S2S: ping every 55s to keep alive. 2023-05-31 16:52:52 +02:00
John Livingston 92d92e3350
Fix: i misunderstood the parameter s2s_close_timeout. And removing a duplicate hook. 2023-05-31 16:52:52 +02:00
John Livingston efdf01cef2
Fix condition. 2023-05-31 16:52:50 +02:00
John Livingston 2961513d22
Refresh remote server infos when outdated. 2023-05-31 16:52:50 +02:00
John Livingston e719dc3079
Chat Federation: fetch remote server information when missing. 2023-05-31 16:52:50 +02:00
John Livingston 6ed69d2c2f
Chat Federation: refactoring ActivityPub data:
The data format used by plugin v6.3.0 was not well suited.
Here comes a new data format, with S2S informations.
The plugin can automatically upgrade old format.
It also continues to provide the old format, so than remote instance
that did not update the plugin will still work.
2023-05-31 16:52:50 +02:00
John Livingston b38d9a6426
Cleaning an aborted PoC 2023-05-31 16:52:49 +02:00
John Livingston 8fe48a068f
Refactoring the debug mode code, and adding some options. 2023-05-31 16:52:49 +02:00
John Livingston b525c203da
Chat Federation: first working PoC! 2023-05-31 16:52:49 +02:00
John Livingston 5a945a0cb7
Chat Federation WIP:
Found that net.websocket is not appropriate.
This commit is a proof of concept. It has to be cleaned.
Still not working, but close!
2023-05-31 16:52:48 +02:00
John Livingston 9a2da60b7d
Chat Federation (and a lot more) WIP:
Note: websocket s2s is not working yet, still WIP.

New Features

* Chat Federation:
  * You can now connect to a remote chat with your local account.
  * This remote connection is done using a custom implementation of [XEP-0468: WebSocket S2S](https://xmpp.org/extensions/xep-0468.html), using some specific discovering method (so that it will work without any DNS configuration).

Minor changes and fixes

* Possibility to debug Prosody in development environments.
* Using process.spawn instead of process.exec to launch Prosody (safer, and more optimal).
* Prosody AppImage: fix path mapping: we only map necessary /etc/ subdir, so that the AppImage can access to /etc/resolv.conf, /etc/hosts, ...
* Prosody AppImage: hidden debug mode to disable lua-unbound, that seems broken in some docker dev environments.
2023-05-31 16:52:47 +02:00
John Livingston 3bc05d88df
Chat Federation: using S2S if available.
* if both local and remote instance have external XMPP connections enabled, the user joins the remote room with his local account
* some code refactoring (builtin.ts)

Note: documentation and settings descriptions are to do.

Related to #112
2023-05-31 16:52:47 +02:00
John Livingston cf0b14d382
Fix import. Seems i am tired... 2023-04-21 19:28:43 +02:00
John Livingston 1a5989d9a9
Fix. 2023-04-21 19:24:55 +02:00
John Livingston 5a4eb7fc33
Fix: wrong usage of URL.protocol, again 2023-04-21 18:57:18 +02:00
John Livingston 4a02f74563
Fix cross domain BOSH. 2023-04-21 18:49:15 +02:00
John Livingston ba573c1211
Fix protocol detection. 2023-04-21 18:38:43 +02:00
John Livingston 0ce95d4a39
Chat Federation: don't display chat when anonymous connections are disabled 2023-04-21 17:24:16 +02:00
John Livingston 5d323b2dfd
Chat Federation, connection to remote chat:
Front-end connect using BOSH or WS directly on the remote server.
If use is logged-in, his nickname is use as default nickname.
2023-04-21 16:56:48 +02:00
John Livingston b85a1dc90a
Fix: wrong usage of URL.protocol 2023-04-21 16:33:17 +02:00
John Livingston 732138e745
Chat Federation: some data caching to reduce disk load. 2023-04-21 12:25:00 +02:00
John Livingston 333590defd
Chat Federation: send the information to the frontend. 2023-04-21 12:02:52 +02:00
John Livingston b1f1271389
Fix missing case. 2023-04-20 18:32:13 +02:00
John Livingston 5028d37c18
Chat federation: storing chat information 2023-04-20 18:28:08 +02:00
John Livingston 850ea3e61f
Chat federation: refactoring code + fix case when video has no chat 2023-04-20 16:07:00 +02:00
John Livingston 01e7fdc9b6
Chat federation: new settings to disable the feature. 2023-04-20 12:13:22 +02:00
John Livingston 4c138f3f5b
Chat federation metadata fix, and code refactoring. 2023-04-20 11:10:23 +02:00
John Livingston 115fcd8484
Chat federation: add metadata in ActivityPub. WIP 2023-04-19 19:07:08 +02:00
John Livingston 310419ad66
Fix Peertube crash:
Peertube could crash when someone attemps to connect to Websocket endpoint during plugin initialization.
2023-04-17 11:14:41 +02:00
John Livingston d359d3ad99 Fix Prosody room topic:
Due to a bug in mod_muc_http_defaults (https://hg.prosody.im/prosody-modules/rev/6d99ddd99694),
room topics were badly configured. The plugin will fix them at startup, and stops trying to set the subject.
2023-04-14 11:33:41 +02:00
John Livingston cf0e4d8061 Fix settings read. 2023-04-14 11:33:41 +02:00
John Livingston 801798852c Prosody: new settings to provide a custom certificates dir 2023-04-14 11:33:41 +02:00
John Livingston a87a622cba Prosody: renew self signed certificates periodically 2023-04-14 11:33:41 +02:00
John Livingston b4dabfeeb9 New debug mode:
Debug mode is no more triggered by the NODE_ENV value, but by testing
the existance of a file in the plugin data directory.
2023-04-14 11:33:41 +02:00
John Livingston f8b83defb5 Fix Prosody configuration. 2023-04-14 11:33:41 +02:00
John Livingston 772689f9ce Prosody: Generating self-signed certificates for s2s connections. 2023-04-14 11:33:41 +02:00
John Livingston 38023df6be XMPP clients connections WIP + fix mod_muc_http_defaults 2023-04-14 11:33:41 +02:00
John Livingston d544a53b38 XMPP clients connections WIP 2023-04-14 11:33:41 +02:00
John Livingston 4a28991497 XMPP client connection WIP:
Adding an option in the «share chat» dialog to display the XMPP room
address.
2023-04-14 11:33:41 +02:00
John Livingston 4d9d9d39b0 XMPP clients connections WIP:
* new option to allow external xmpp account s2s connections
* settings to setup the port and network interfaces
* documentation WIP

Related to issue #114
2023-04-14 11:33:41 +02:00
John Livingston c81c2eb9bb Diagnostic tool: add the result of `prosodyctl check` in the debug section. 2023-04-14 11:33:41 +02:00
John Livingston 9d18e401a7
Implements #153: Settings translations (#155)
Implementing a new translating system, so we can more easily translate
settings strings. Indeed, these strings are difficult to embed in
JSON format.

We still use JSON files for standard strings, but in addition we have
dedicated YAML files to translate settings strings.

There is a new build-languages.js script that merge all translations in JSON files.

Other modifications:
* Eslint: ignoring documentation and build scripts.
* french settings translations.
2023-02-15 11:54:48 +01:00
John Livingston 2950fdeddf
link to the new documentation. 2023-02-13 18:03:23 +01:00
John Livingston 3f47c3c65a
Refactoring and simplification (#122) 2023-01-11 18:05:18 +01:00
John Livingston c178213e19
Use ESBuild for frontend build.
Replacing webpack by ESBuild for client code compilation (as in the
official quickstart plugin).

So we can remove deprecated webpack dependencies.

Note: webpack is still used for ConverseJS build.
This may be removed soon.

Related to issue #122.
2022-12-12 19:31:29 +01:00
John Livingston 901d1e96ab
Update @peertube/peertube-types to 4.2.2:
* using a stable version (4.2.2)
* minimum Peertube version is now 4.2.0
* removing some type customizations

Related to issue #122.

Note: there are still some quirks. See: https://github.com/Chocobozzz/PeerTube/issues/5446
2022-12-12 19:31:17 +01:00
John Livingston ed3f236120
Prosody Appimage: supports only x86_64:
* stop trying to generated an ARM64 AppImage (as it is buggy)
* display a warning in the settings if incompatible CPU detected
* documentation for a workaround

Implements #120.
2022-12-12 19:17:43 +01:00
John Livingston ae5860e537
Implements #123: «disable websocket» settings». 2022-12-08 11:25:57 +01:00
John Livingston 24696acdbe
#120: adding a certs directory to avoid Prosody error logs. 2022-12-06 17:19:53 +01:00
John Livingston e6da0a879f
Prosody AppImage: aarch64 architecture. 2022-11-22 11:35:38 +01:00
John Livingston 059c6522b6
Implements #37: diagnostic tools includes last lines from prosody error log files. 2022-11-18 17:48:20 +01:00
John Livingston 6f47ffe19d
Comment update. 2022-11-18 17:06:53 +01:00
John Livingston 174b996b74
Updating comment. 2022-11-18 12:36:14 +01:00
John Livingston 187d8be87f
Documentation update + remove docker build:
* Update documentation and removed deprecated parts
* removed Docker image build files, as it is no more needed
2022-11-15 18:04:51 +01:00
John Livingston 3ba64d3732
Re-ordering the settings page. 2022-11-15 17:19:49 +01:00
John Livingston 8f5b2ae565
Prosody AppImage: extract in a dedicated folder 2022-11-15 16:30:24 +01:00
John Livingston 27e8fbf05f
Fix: creating working directories before extracting Prosody AppImage 2022-11-15 16:07:12 +01:00
John Livingston 459d92cef9
Embedding Prosody using AppImage:
Thanks to this commit, there is no more need to manually install Prosody
on the server.
The plugin now build and embed an AppImage of Prosody.

In this commit:
* building and using a Prosody AppImage.
* Adding a launcher in the AppImage: the first command argument tells if
  we want to run prosody or prosodyctl
* prosodyCtl functions now uses the AppImage.
* Prosody AppImage: extract once at the startup, then run the squashfs
2022-11-15 15:20:10 +01:00
John Livingston 91ea442ce6
Fix «autocolor» mecanism when no color provided (raised an error) 2022-11-01 15:17:21 +01:00
John Livingston a25cdb44ef
Fix WS timeouts:
Nginx as also a timeout. Seems to be 30s. So we ping every 25s, and set an intermediate timeout for Prosody.
2022-11-01 11:58:02 +01:00
John Livingston 90e86a130a
Fix Websocket timeouts:
* defining a ping_interval in ConverseJS
* defining a longer c2s_close_timeout in Prosody configuration
2022-11-01 11:37:24 +01:00
John Livingston 6a54f4d747
Disco: hide external components. 2022-11-01 11:23:34 +01:00
John Livingston ab89351f42
Prosody server: enabling mod_disco. 2022-11-01 10:35:42 +01:00
John Livingston 9e06e32351
Websocket: only activate on Prosody if the feature is available. 2022-10-13 18:56:00 +02:00
John Livingston 0be08c7b57
Using Peertube v5.0.0 websocket capacities. 2022-10-13 18:34:41 +02:00
John Livingston e7eca75736
Fix Prosody WS configuration. 2022-10-13 10:47:36 +02:00
John Livingston 67062aac62
Better implementation. 2022-10-13 10:47:36 +02:00
John Livingston 6f8c7b8a93
Websocket for builtin Prosody. WIP 2022-10-13 10:47:33 +02:00
John Livingston 507da6e042
Fix Peertube crash when stopping the BOSH proxy. 2022-10-13 10:44:02 +02:00
John Livingston de179e90d3
Promisify proxy close. 2022-10-13 10:44:01 +02:00
John Livingston 1bb202d9d3
Replacing express-http-proxy by http-proxy + code refactoring. 2022-10-13 10:43:59 +02:00
John Livingston 2b7174eb96
Comment. 2022-10-13 10:41:09 +02:00
John Livingston 7259ae59a2
Builtin Prosody: BOSH path without plugin version, so it can be optimized in the nginx configuration. 2022-10-13 10:40:06 +02:00
John Livingston 7906ddf625
Prosody mode only:
Removing old modes (ConverseJS and External URI).
Work in progress.
2022-10-10 18:08:20 +02:00
John Livingston 01a052d380
Fix #97 #54: Settings to hide the chat for anonymous users 2022-04-11 18:12:12 +02:00
John Livingston 01bb6bdc67
Fix links. 2022-04-07 10:57:39 +02:00
John Livingston d0762362e0
Deprecation warning. 2022-04-07 10:55:31 +02:00
John Livingston 80ac08bd18
Transparent background + fix
* Builtin Prosody, Share chat url: option to have a transparent background (for streaming integration).
* Builtin Prosody, Share chat url: fixed new day hidding when no scrollbar in readonly mode.
2022-01-16 17:50:11 +01:00
John Livingston 7db856ce0f
Using types declarations from the official @peertube/peertube-types package. 2022-01-11 01:29:33 +01:00