Documentation translation (#199)
Documentation translation using weblate. * Use po4a to generate .po files from the english markdowns, then to generate translated files * Some pages can be marked as «english only» (for technical documentation for example) * New Hugo shortcode to use application strings in documentation (for example for settings names) * The code of conduct is no more translated, but there is a link to official Contributor Covenant translations * Adding all plugin's supported languages Related to https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/117
This commit is contained in:
12
support/documentation/content/en/_index.md
Normal file
12
support/documentation/content/en/_index.md
Normal file
@ -0,0 +1,12 @@
|
||||
# PeerTube plugin livechat
|
||||
|
||||
{{% notice tip %}}
|
||||
You can use the language selector in the left menu to view this documentation in different languages.
|
||||
Some translations are missing or incomplete. In this case, you'll see the English version of the text.
|
||||
{{% /notice %}}
|
||||
|
||||
{{% notice info %}}
|
||||
Before updating to a major release, please read the release notes and breaking changes list : [CHANGELOG](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/CHANGELOG.md).
|
||||
{{% /notice %}}
|
||||
|
||||
{{% children style="li" depth="3" description="true" %}}
|
10
support/documentation/content/en/contact/_index.md
Normal file
10
support/documentation/content/en/contact/_index.md
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "Contact me"
|
||||
description: "Contact the author"
|
||||
weight: 80
|
||||
chapter: false
|
||||
---
|
||||
|
||||
If you have any question, or if you want to talk about this plugin, you can join this XMPP room with any Jabber client: [plugin-livechat-support@room.im.yiny.org](xmpp:plugin-livechat-support@room.im.yiny.org?join).
|
||||
|
||||
If you want to support the project financially, you can contact me by mail at git.[at].john-livingston.fr, or check my [Liberapay profile](https://liberapay.com/JohnLivingston/).
|
10
support/documentation/content/en/contributing/_index.md
Normal file
10
support/documentation/content/en/contributing/_index.md
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "Contributing"
|
||||
description: "Contributing"
|
||||
weight: 60
|
||||
chapter: false
|
||||
---
|
||||
|
||||
Interested in contributing? Awesome!
|
||||
|
||||
{{% children style="li" depth="3" description="true" %}}
|
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "Code of Conduct"
|
||||
description: "Contributor Covenant Code of Conduct"
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% notice tip %}}
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
|
||||
Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement by mail at git.[at].john-livingston.fr.
|
||||
{{% /notice %}}
|
||||
|
||||
{{% livechat_codeofconduct %}}
|
140
support/documentation/content/en/contributing/develop/_index.md
Normal file
140
support/documentation/content/en/contributing/develop/_index.md
Normal file
@ -0,0 +1,140 @@
|
||||
---
|
||||
title: "Develop"
|
||||
description: "Develop"
|
||||
weight: 40
|
||||
chapter: false
|
||||
---
|
||||
|
||||
Always talk about features you want to develop by creating/finding and commenting the issue tackling your problem
|
||||
before you start working on it, and inform the community that you begin coding by claiming the issue.
|
||||
|
||||
Pull Request must be done on the `main` branch.
|
||||
|
||||
{{% notice note %}}
|
||||
Until march 2023, contribution were made on the `develop` branch. This procedure is now deprecated.
|
||||
{{% /notice %}}
|
||||
|
||||
Prerequisite for building this plugin:
|
||||
|
||||
- you must have `npm` installed
|
||||
- you must have python venv installed (`python3-venv` package on Debian for example)
|
||||
- you must have `build-essential` installed
|
||||
|
||||
To clone the repository:
|
||||
|
||||
```bash
|
||||
# Clone the repository. Dont forget the --recursive to clone submodules.
|
||||
git clone https://github.com/JohnXLivingston/peertube-plugin-livechat.git --recursive
|
||||
|
||||
# Install NPM dependencies and build the module for the first time:
|
||||
npm install
|
||||
|
||||
# Build the plugin after a modification:
|
||||
npm run build
|
||||
|
||||
# If you have a fork from the repository, add it as remote (example):
|
||||
git remote add me git@github.com:MY_GITHUB_ACCOUNT/peertube-plugin-livechat.git
|
||||
|
||||
# Create a local branch for you developments, and checkout it (example):
|
||||
git checkout my_development # Note: if an issue is associated, use fix_1234 as your branch name (where 1234 is the issue's number)
|
||||
# To propose your modifications, push your branch to your repository (example):
|
||||
git push --set-upstream me my_development
|
||||
# Then go to your github repository with your web browser to propose the Pull Request (see additional instructions below)
|
||||
```
|
||||
|
||||
Once you are ready to show your code to ask for feedback, submit a *draft* Pull Request.
|
||||
Once you are ready for a code review before merge, submit a Pull Request. In any case, please
|
||||
link your PR to the issues it solves by using the GitHub syntax: "fixes #issue_number".
|
||||
|
||||
The front-end code is in the `client` folder, the back-end code in `server`. There are some shared code in `shared` folder.
|
||||
|
||||
For general instructions (developping plugins, building, installation, ...), please refer to the [Peertube documentation](https://docs.joinpeertube.org/contribute-plugins?id=write-a-plugintheme).
|
||||
|
||||
You can build the plugin with extra debug features simply by using:
|
||||
|
||||
```bash
|
||||
NODE_ENV=dev npm run build
|
||||
```
|
||||
|
||||
## ESBuild vs Typescript
|
||||
|
||||
This plugin uses ESBuild for frontend code generation, as the official `peertube-plugin-quickstart` plugin.
|
||||
ESBuild can handle Typescript, but does not check types
|
||||
(see [ESBuild documentation](https://esbuild.github.io/content-types/#typescript)).
|
||||
That's why we first compile Typescript with the `-noEmit` option, just to check types (`check:client:ts` in package.json file).
|
||||
Then, if everything is okay, we run ESBuild to generate the compiled javascript.
|
||||
|
||||
## Debug Mode
|
||||
|
||||
There is a debug mode for this plugin, that shorten some delay.
|
||||
For example, some log files will rotate every two minutes, instead of once per day.
|
||||
This permit to test more easily certain actions, for which it could normally take hours or days to wait.
|
||||
|
||||
To enable this mode, you juste have to create the
|
||||
`/var/www/peertube/storage/plugins/data/peertube-plugin-livechat/debug_mode` file
|
||||
(replacing `/var/www/peertube/storage/` by the correct path on your installation).
|
||||
|
||||
The simple existence of this file is sufficient to trigger the debug mode.
|
||||
To make sure it's taken into account, you can restart your Peertube instance.
|
||||
|
||||
This file can contain some JSON to enable more advanced options.
|
||||
To have a list of existing parameters, check `server/lib/debug.ts`.
|
||||
Restart Peertube after each content modification.
|
||||
|
||||
{{% notice warning %}}
|
||||
Don't enable this mode on a production server, neither on a public server.
|
||||
This could cause security issues.
|
||||
{{% /notice %}}
|
||||
|
||||
### Restart Prosody
|
||||
|
||||
When debug mode is enabled, you can restart Prosody using this API call:
|
||||
`http://your_instance.tld/plugins/livechat/router/api/restart_prosody`.
|
||||
This call don't need any authentificaiton.
|
||||
It can be done from a command line, for example using
|
||||
`curl http://your_instance.tld/plugins/livechat/router/api/restart_prosody`.
|
||||
|
||||
### Prosody debugger
|
||||
|
||||
It is possible to connect the Prosody AppImage to a remote debugger using [MobDebug](https://luarocks.org/modules/paulclinger/mobdebug).
|
||||
|
||||
To do so, you have to setup MobDebug in a folder that can be accessed by the `peertube` user.
|
||||
Then, add this in the `debub_mode` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"debug_prosody": {
|
||||
"debugger_path": "/the_path_to_mobdebug/src",
|
||||
"host": "localhost",
|
||||
"port": "8172"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`host` and `port` are optional. `debugger_path` must point to the folder where the `MobDebug` `.lua` file is.
|
||||
|
||||
Restart Peertube.
|
||||
|
||||
Start your debugger server.
|
||||
|
||||
For Prosody to connect to the debugger, call the API
|
||||
`http://your_instance.tld/plugins/livechat/router/api/restart_prosody?debugger=true`.
|
||||
This call does not need any authentication.
|
||||
It can be done from a command line, for example with
|
||||
`curl http://your_instance.tld/plugins/livechat/router/api/restart_prosody?debugger=true`.
|
||||
You can even configure your debug server to launch this request automatically.
|
||||
|
||||
Prosody will then restart, connecting to the debugger.
|
||||
|
||||
## Quick dev environment using Docker
|
||||
|
||||
There is a tutorial, in french, on the
|
||||
[le Peertube forum](https://framacolibri.org/t/tutoriel-creer-un-environnement-de-developpement-de-plugin-peertube-rapidement-en-utilisant-docker-et-qui-permet-de-tester-la-federation/17631)
|
||||
that explains how to quickly build a dev env using Docker.
|
||||
|
||||
A repo was made out of it, check out [pt-plugin-dev](https://codeberg.org/mose/pt-plugin-dev).
|
||||
|
||||
Note: for an unknown reason, Prosody can't resolve containers DNS address when using the lua-unbound library.
|
||||
There is a dirty hack in the plugin: just create a
|
||||
`/data/plugins/data/peertube-plugin-livechat/no_lua_unbound` file in your docker-volumes,
|
||||
then restart containers.
|
@ -0,0 +1,98 @@
|
||||
---
|
||||
title: "Documentation"
|
||||
description: "Document the plugin, or translate the documentation."
|
||||
weight: 50
|
||||
chapter: false
|
||||
---
|
||||
|
||||
## General information
|
||||
|
||||
Always inform the community before working (by creating a new issue, or commenting an existing one).
|
||||
This is to avoid that two persons are working on the same thing, and prevent conflicts.
|
||||
|
||||
Documentation work has to be merged in the `main` branch.
|
||||
|
||||
The documentation source code is in the `support/documentation/content` folder.
|
||||
|
||||
The documentation is generated using [Hugo](https://gohugo.io/).
|
||||
You have to install it on your computer if you want to preview your work.
|
||||
|
||||
The used theme is [hugo-theme-learn](https://learn.netlify.app/).
|
||||
You should read its documentation before starting editing the documentation.
|
||||
|
||||
When a new plugin version is released, or when documentation is updated, plugin maintainers will merge the `main` branch to the `documentation` branch.
|
||||
This will trigger github and gitlab pipelines, and update published documentation.
|
||||
|
||||
## Translations
|
||||
|
||||
The principal language is english (`en` code).
|
||||
|
||||
The `support/documentation/content/en` folder contains only english documentation files.
|
||||
|
||||
Documentation is translated using Weblate (see the [translation documentation](/peertube-plugin-livechat/contributing/translate/)).
|
||||
To do so, we use the [po4a tool](https://po4a.org/), as we will se later in this page.
|
||||
|
||||
## Add a new language
|
||||
|
||||
In the `support/documentation/config.toml` file, please copy and modify the `[Languages.fr]` section.
|
||||
|
||||
If the translations are not complete, it does not matter, english will be used for missing strings.
|
||||
|
||||
## Preview
|
||||
|
||||
To preview your modifications, just run:
|
||||
|
||||
```bash
|
||||
hugo serve -s support/documentation/
|
||||
```
|
||||
|
||||
Then open your browser on the address [http://localhost:1313/peertube-plugin-livechat/](http://localhost:1313/peertube-plugin-livechat/).
|
||||
This page will automatically refresh on each modification.
|
||||
|
||||
## Update localization files and generate documentation translations
|
||||
|
||||
For now, you only have the english version.
|
||||
To update documentation strings, and generate translations, you have to run the `doc-translate.sh` script.
|
||||
|
||||
To do so, make sure you have `po4a` (version >= 0.66) installed on your computer.
|
||||
|
||||
{{% notice warning %}}
|
||||
Some linux distro (like Debian Bullseye for example) have too old version of `po4a`.
|
||||
Please make sure to install a compatible version.
|
||||
If you are using Debian Bullseye for example, you can download the Bookwork po4a.deb file from https://packages.debian.org, and install it manually.
|
||||
{{% /notice %}}
|
||||
|
||||
To handle translations, just do:
|
||||
|
||||
```bash
|
||||
npm run doc:translate
|
||||
```
|
||||
|
||||
You can then preview the result using `hugo serve -s support/documentation/`, and using the language selector.
|
||||
|
||||
## Write documentation
|
||||
|
||||
Just edit the english files in `support/documentation/content/en`.
|
||||
|
||||
Then, before commiting, always run `npm run doc:translate`, so that changes in english files can be propagated to the `support/documentation/po/livechat.en.pot` file.
|
||||
|
||||
You can use the `livechat_label` short code to use application strings.
|
||||
See here: [Documentation translation](/peertube-plugin-livechat/contributing/translate/#documentation-translation).
|
||||
|
||||
It is possible to prevent a file from beeing translating, using `livechatnotranslation: true` in the Yaml Font Matter section.
|
||||
See here: [Documentation translation](/peertube-plugin-livechat/contributing/translate/#documentation-translation).
|
||||
|
||||
Please use the `livechatnotranslation` option for technical documentation.
|
||||
We don't want technical documentation to be translated, to avoid issues because of a wrong translation.
|
||||
|
||||
Avoid adding line breaks in middle of a sentence.
|
||||
But add a line break after each sentence in a paragraph.
|
||||
This is to facilitate the work for translators: so then can easily check that they don't miss a sentence when translating a parapraph.
|
||||
|
||||
### What if I can't use hugo and/or po4a?
|
||||
|
||||
Just edit english markdown files, and specify that you can't build translations when you make your Pull Request.
|
||||
|
||||
## Publication
|
||||
|
||||
Publishing the documentation is automatic, as soon as the changes are merged into the `documentation` branch.
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
title: "Give your feedback"
|
||||
description: "Give your feedback"
|
||||
weight: 30
|
||||
chapter: false
|
||||
---
|
||||
|
||||
You don't need to know how to code to start contributing to this plugin!
|
||||
Other contributions are very valuable too, among which: you can test the software and report bugs, you can give feedback, features that you are interested in, user interface, design, ...
|
@ -0,0 +1,112 @@
|
||||
---
|
||||
title: "Translate"
|
||||
description: "Translate the plugin"
|
||||
weight: 20
|
||||
chapter: false
|
||||
---
|
||||
|
||||
You can contribute to this plugin translation.
|
||||
Translations are handled using the [Weblate](https://weblate.org/) software,
|
||||
using [Framasoft Weblate instance](https://weblate.framasoft.org/).
|
||||
|
||||
{{% notice warning %}}
|
||||
Never modify directly files in the `languages` folder, this could lead to conflicts.
|
||||
{{% /notice %}}
|
||||
|
||||
## How to
|
||||
|
||||
* Create an account: https://weblate.framasoft.org/accounts/register/
|
||||
* Validate your email and follow the link sent
|
||||
* Create your password and setup your account
|
||||
* Go to the plugin project page: https://weblate.framasoft.org/projects/peertube-livechat/peertube-plugin-livechat/
|
||||
* Choose the locale you want to translate
|
||||
* Just translate missing sentences, or correct the ones that seems incorrect to you.
|
||||
|
||||
{{% notice warning %}}
|
||||
There might be some «very technical» strings. If you are not 100% sure of
|
||||
the meaning, or of your translation, you better not translate it,
|
||||
so it will display in english.
|
||||
{{% /notice %}}
|
||||
|
||||
## Adding a new locale
|
||||
|
||||
If you think there is a missing locale, please check first if it is handled in Peertube.
|
||||
If so, you can [open an issue](https://github.com/JohnXLivingston/peertube-plugin-livechat/issues) to ask for it.
|
||||
|
||||
## Adding new strings / use translations in the code
|
||||
|
||||
If you are working on new features, and need new strings, you can create them directly in Weblate.
|
||||
The english version is mandatory. Start with it.
|
||||
|
||||
Each string is linked to a key (for example `use_chat`).
|
||||
Choose an explicit key in english, lower case.
|
||||
|
||||
If you have to test new strings without waiting for a Weblate merge, you can modify `languages/*.yml` files,
|
||||
but avoid to commit these changes (to minimize conflict risks).
|
||||
|
||||
### Use translations in front-end code
|
||||
|
||||
Before using a string in front-end, you need to declare a new constant in `client/@types/global.d.ts`.
|
||||
The constant name must:
|
||||
|
||||
* start with the prefix "LOC_"
|
||||
* use the string key, upper cased
|
||||
* you just have to declare its type, not its value
|
||||
|
||||
For example, to use "use_chat", you have to declare:
|
||||
|
||||
```typescript
|
||||
declare const LOC_USE_CHAT: string
|
||||
```
|
||||
|
||||
The `build-client.js` script will read the `client/@types/global.d.ts`,
|
||||
search for such constants, and load their values from the languages files.
|
||||
|
||||
Now, you can simply call `peertubeHelpers.translate(LOC_USE_CHAT)` in your code.
|
||||
|
||||
### Use translations in back-end code
|
||||
|
||||
In theory, the only parts of the backend code where you need localization is the
|
||||
settings declaration and standardized data (ActivityPub, RSS, ...).
|
||||
Here we need to get english strings from the translation key.
|
||||
|
||||
Note: you should never need another language translation from backend code.
|
||||
Localization must be done on front-end.
|
||||
|
||||
There is a `lib/loc.ts` module providing a `loc()` function.
|
||||
Just pass it the key to have the english string: `loc('diagnostic')`'.
|
||||
|
||||
## Documentation translation
|
||||
|
||||
The documentation translation is done using the corresponding Weblate component.
|
||||
|
||||
There is a specific "Hugo shortcodes" you can use to display an application string.
|
||||
Saying you want to display the name of the button "open_chat_new_window", you can use this in the documentation markdown file:
|
||||
|
||||
```hugo
|
||||
{{%/* livechat_label open_chat_new_window */%}}
|
||||
```
|
||||
|
||||
You can also prevent a whole page from being translating by adding `livechatnotranslation: true` in the Yaml Font Matter section:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Third party"
|
||||
description: "Displaying the livechat with 3rd party software."
|
||||
weight: 20
|
||||
chapter: false
|
||||
livechatnotranslation: true
|
||||
---
|
||||
```
|
||||
|
||||
Never translate a string in the `livechat.en.pot` file, it would be ignored.
|
||||
Instead, edit directly the markdown files.
|
||||
|
||||
If a string contains a link, you can change it for the correct link in the translated language.
|
||||
For example, for a link to this documentation, you can add the language code in the url.
|
||||
|
||||
Some strings are block of code.
|
||||
Don't translate code.
|
||||
But you can translate comments, or parameters if relevant.
|
||||
|
||||
If you are not sure, just don't translate, and ask what to do.
|
21
support/documentation/content/en/credits/_index.md
Normal file
21
support/documentation/content/en/credits/_index.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Credits"
|
||||
description: "Plugin Credits"
|
||||
weight: 90
|
||||
chapter: false
|
||||
---
|
||||
|
||||
[package.json](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/package.json), [COPYRIGHT](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/COPYRIGHT.md) and [LICENSE](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/LICENSE) files contain the license information for this software and its dependencies.
|
||||
|
||||
The plugin is maintained by [John Livingston](https://www.john-livingston.fr/).
|
||||
|
||||
Thanks to David Revoy for his work on Peertube's mascot, [Sepia](https://www.davidrevoy.com/index.php?tag/peertube).
|
||||
The character design is under CC-By licence, and the SVG files used to create some logo and avatars in this plugin are GPLv3.0.
|
||||
|
||||
Thanks to [Framasoft](https://framasoft.org) for making [Peertube](https://joinpeertube.org/) possible, for the financial support, and for hosting the project translations on their [Weblate instance](https://weblate.framasoft.org).
|
||||
|
||||
Thanks to [ritimo](https://www.ritimo.org/) for the financial support.
|
||||
|
||||
Thanks to [Code Lutin](https://www.codelutin.com/) and [Rétribution Copie Publique](https://copiepublique.fr/) for the financial support.
|
||||
|
||||
Thanks to [NlNet](https://nlnet.nl/) and the [NGI0 Entrust fund](https://nlnet.nl/entrust/) for the financial support.
|
8
support/documentation/content/en/documentation/_index.md
Normal file
8
support/documentation/content/en/documentation/_index.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Documentation"
|
||||
description: "Plugin documentation"
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% children depth="3" style="li" description="true" %}}
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Admin documentation"
|
||||
description: "Plugin Peertube Livechat administration"
|
||||
weight: 30
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% children depth="3" style="li" description="true" %}}
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Advanced usage"
|
||||
description: "Some advanced features"
|
||||
weight: 20
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% children depth="3" style="li" description="true" %}}
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Using Matterbridge"
|
||||
description: "Using Matterbridge to bridge with other chats"
|
||||
weight: 50
|
||||
chapter: false
|
||||
---
|
||||
|
||||
Here is a tutorial to use Matterbridge with the plugin: <https://gitlab.com/refrac/obs-matterbridge-overlay/-/blob/master/documentation/peertube.md>
|
@ -0,0 +1,288 @@
|
||||
---
|
||||
title: "XMPP clients"
|
||||
description: "Allow connections using XMPP clients"
|
||||
weight: 30
|
||||
chapter: false
|
||||
---
|
||||
|
||||
This chat module is based on the XMPP protocol, also known as Jabber.
|
||||
It is therefore possible to connect to the chats using [XMPP client software](https://en.wikipedia.org/wiki/XMPP#Clients).
|
||||
This can for example be useful to facilitate moderation operations.
|
||||
|
||||
For the user documentation associated with these features, please refer to the [user documentation page](/peertube-plugin-livechat/documentation/user/xmpp_clients/).
|
||||
|
||||
{{% notice info %}}
|
||||
Enabling these features requires configuration changes on the server, and on the DNS records.
|
||||
It is not possible to configure this only from the Peertube interface, and it requires some basic system some basic system admin skills.
|
||||
{{% /notice %}}
|
||||
|
||||
## Login to your Peertube account
|
||||
|
||||
{{% notice warning %}}
|
||||
This feature is not yet available, and will come in a future version of the plugin.
|
||||
{{% /notice %}}
|
||||
|
||||
## Connection using an external XMPP account
|
||||
|
||||
To enable this feature, you will need to set up your server and DNS records, so that XMPP clients can find and access the
|
||||
[Prosody server](https://prosody.im) that this plugin uses internally.
|
||||
|
||||
### Plugin settings
|
||||
|
||||
Start by going to the livechat plugin settings of your instance, then enable the setting "Enable connection to room using external XMPP accounts".
|
||||
By checking this settings, new settings appear below.
|
||||
|
||||
First of all, the "Prosody server to server port" field.
|
||||
This one defaults to 5269, which is the standard port for this service.
|
||||
You can however change to another port, if this is already in use on your server.
|
||||
|
||||
Next, the field "Server to server network interfaces" field allows you to specify which network interfaces the server should listen on.
|
||||
The default value "*, ::" indicates to listen on all IP addresses.
|
||||
You can change these values, if you wish to listen on only certain IP addresses.
|
||||
The syntax is explained next to the setting.
|
||||
|
||||
For the "Certificate folder" setting, you can leave it empty.
|
||||
In this case, the plugin will automatically generate self-signed certificates.
|
||||
Some XMPP servers may refuse to connect, depending on their configuration.
|
||||
In this case, you can indicate here a path on the server, in which you must place certificates to be used by the module.
|
||||
It is up to you to generate and renew them.
|
||||
See bellow for more information.
|
||||
|
||||
### Firewall
|
||||
|
||||
You must open the configured port (5269 by default) on your firewall.
|
||||
|
||||
If you are using Docker for your Peertube, you need to modify the `docker-compose.yml` file to open port 5269 of the `peertube` container,
|
||||
so that the outer world can connect to it.
|
||||
|
||||
### DNS
|
||||
|
||||
You need to add a [DNS record](https://prosody.im/doc/dns) allowing remote servers to find the "room.your_instance.tld" component.
|
||||
|
||||
The easiest way to do this is to add an SRV record for the "room" [subdomain](https://prosody.im/doc/dns#subdomains):
|
||||
|
||||
* record name: _xmpp-server._tcp.room.your_instance.tld. (replace «your_instance.tld» by your instance uri)
|
||||
* TTL: 3600
|
||||
* class: IN
|
||||
* SRV: 0
|
||||
* priority: 0
|
||||
* weight: 5
|
||||
* port: 5269 (adapt if your changed the default port)
|
||||
* target: your_instance.tld. (replace by your instance uri)
|
||||
|
||||
Be careful to keep the dot after "your_instance.tld".
|
||||
|
||||
Using the `dig` command to check your record, you should get a result similar to this:
|
||||
|
||||
```bash
|
||||
$ dig +short _xmpp-server._tcp.room.videos.john-livingston.fr. SRV
|
||||
0 5 5269 videos.john-livingston.fr.
|
||||
```
|
||||
|
||||
If you are **not using the standard `5269` port**, you must also add a SRV record for `_xmpp-server._tcp.your_instance.tld.` (same as above, just without the `room.` prefix).
|
||||
Of course, you can also add this record if you use the standard port. It will also work.
|
||||
|
||||
### Using trusted certificates
|
||||
|
||||
The self-signed certificates that this plugin uses by default can be rejected by some XMPP servers, for security reasons.
|
||||
|
||||
It is possible to use certificates validated by a certification authority.
|
||||
However, this requires advanced system administration knowledge.
|
||||
Indeed, due to the multitude of possible use cases, it is impossible to document all situations here.
|
||||
This documentation will therefore only explain the goal to be reached, and give an example which will only be suitable for a "basic" situation (manual installation of Peertube, using letsencrypt).
|
||||
If you are in another situation (Docker installation, certificates signed by another authority, etc...), you will have to adapt this approach by yourself.
|
||||
|
||||
#### Basic principle
|
||||
|
||||
It is up to you to generate valid certificates for domains `your_instance.tld` and `room.your_instance.tld`.
|
||||
You can use any [method supported by Prosody](https://prosody.im/doc/certificates).
|
||||
|
||||
You must then place these certificates in a folder that will be accessible to the `peertube` user, and specify this folder in the plugin setting "Certificate folder".
|
||||
|
||||
{{% notice tip %}}
|
||||
If you want to use the ProsodyCtl utility to import certificates, this utility is available (once Peertube is started) using the following command (adapting the path to your Peertube data folder, and replacing "xxx" with the arguments you wish to pass to
|
||||
prosodyctl): `sudo -u peertube /var/www/peertube/storage/plugins/data/peertube-plugin-livechat/prosodyAppImage/squashfs-root/AppRun prosodyctl xxx`
|
||||
{{% /notice %}}
|
||||
|
||||
The plugin will check once a day to see if any files have been modified in this folder, and reload Prosody if necessary.
|
||||
|
||||
#### Method for the simple case
|
||||
|
||||
We assume here that your Peertube installation is "classic" (no use of Docker), and that the certificates are generated by letsencrypt, using the certbot tool.
|
||||
|
||||
First of all, we'll have to create a certificate for the subdomain `room.your_instance.tld` : this is the uri of the MUC (XMPP chat rooms) component.
|
||||
Even if the connections are made on `your_instance.tld`, we will need a valid certificate for this subdomain.
|
||||
|
||||
So start by setting up a DNS entry for `room.your_instance.tld`, which points to your server.
|
||||
You can use a CNAME entry (or an A entry and a AAAA entry).
|
||||
|
||||
Next, we'll use nginx (already installed for your Peertube) to generate the certbot certificate.
|
||||
We will create a new site. In the file `/etc/nginx/site-available/room.peertube`, add:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name room.your_instance.tld;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
default_type "text/plain";
|
||||
root /var/www/certbot;
|
||||
}
|
||||
location / { return 301 https://your_instance.tld; }
|
||||
}
|
||||
```
|
||||
|
||||
Then enable the site:
|
||||
|
||||
```bash
|
||||
ln -s /etc/nginx/sites-available/room.peertube /etc/nginx/sites-enabled/
|
||||
systemc reload nginx
|
||||
```
|
||||
|
||||
Then we prepare the folder in which we will later import the certificates.
|
||||
We assume here that you already have the plugin active. We will create the following folder (if it doesn't already exist), with the user `peertube` to make sure there are no permissions issues:
|
||||
|
||||
```bash
|
||||
sudo -u peertube mkdir /var/www/peertube/storage/plugins/data/peertube-plugin-livechat/prosody/certs
|
||||
```
|
||||
|
||||
Now you have to configure this folder in the plugin settings, for the parameter "Certificate folders".
|
||||
It's important to do this now, otherwise the certificate import script will put the certificates in the wrong folder.
|
||||
|
||||
We will configure certbot to import the generated certificates into the Prosody folder.
|
||||
We can use the ProsodyCtl utility packaged in the plugin.
|
||||
|
||||
Note: for it to be available, the plugin must have been started at least once.
|
||||
|
||||
We will create a file `/etc/letsencrypt/renewal-hooks/deploy/prosody.sh` containing:
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
/var/www/peertube/storage/plugins/data/peertube-plugin-livechat/prosodyAppImage/squashfs-root/AppRun prosodyctl \
|
||||
--root \
|
||||
--config /var/www/peertube/storage/plugins/data/peertube-plugin-livechat/prosody/prosody.cfg.lua \
|
||||
cert import \
|
||||
room.your_instance.tld your_instance.tld /etc/letsencrypt/live
|
||||
```
|
||||
|
||||
Then we ask to generate the certificate:
|
||||
|
||||
```bash
|
||||
certbot -d room.videos.john-livingston.fr
|
||||
```
|
||||
|
||||
If certbot offers you several methods to generate the certificate, choose "nginx".
|
||||
|
||||
Normally you should now find the certificates in the configured folder.
|
||||
|
||||
Note: the first time you do this, you will have to reload Prosody. The easiest way to do this is to restart Peertube.
|
||||
|
||||
#### Method for the Docker case
|
||||
|
||||
This method works with the officially supported [Docker guide](https://docs.joinpeertube.org/install/docker) from PeerTube.
|
||||
|
||||
First, ensure you create a DNS entry for `room.your_instance.tld`, which points to your server.
|
||||
You can use a CNAME entry (or an A entry and a AAAA entry).
|
||||
This is necessary for Let's Encrypt to validate the domain for certificate generation.
|
||||
|
||||
Enter the directory where your `docker-compose.yml` file exists.
|
||||
|
||||
Open a shell in the certbot container:
|
||||
|
||||
```bash
|
||||
docker exec -it certbot /bin/sh
|
||||
```
|
||||
|
||||
Run certbot:
|
||||
|
||||
```bash
|
||||
certbot
|
||||
```
|
||||
|
||||
You will be presented with a series of prompts. Enter `2` for the authentication type:
|
||||
|
||||
```text
|
||||
How would you like to authenticate with the ACME CA?
|
||||
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
|
||||
```
|
||||
|
||||
Enter the domain name `room.your_instance.tld`:
|
||||
|
||||
```text
|
||||
Please enter the domain name(s) you would like on your certificate (comma and/or space separated) (Enter 'c' to cancel): room.your_instance.tld
|
||||
```
|
||||
|
||||
Enter the directory where the PeerTube webserver serves requests for Let's Encrypt, `/var/www/certbot`:
|
||||
|
||||
```text
|
||||
Input the webroot for <room.your_instance.tld>: (Enter 'c' to cancel): /var/www/certbot
|
||||
```
|
||||
|
||||
You should see output like the following:
|
||||
|
||||
```text
|
||||
Successfully received certificate.
|
||||
Certificate is saved at: /etc/letsencrypt/live/room.your_instance.tld/fullchain.pem
|
||||
Key is saved at: /etc/letsencrypt/live/room.your_instance.tld/privkey.pem
|
||||
```
|
||||
|
||||
Run the below command inside the certbot container to give read access to the new certs and private keys to the peertube group.
|
||||
*Note*: This will also make the files readable to the group with id 999 on the host system.
|
||||
Check the groups on your system to assess this as a risk before running this command.
|
||||
|
||||
```bash
|
||||
chown -R root:999 /etc/letsencrypt/live; \
|
||||
chmod 750 /etc/letsencrypt/live; \
|
||||
chown -R root:999 /etc/letsencrypt/archive; \
|
||||
chmod 750 /etc/letsencrypt/archive; \
|
||||
find /etc/letsencrypt/ -name 'privkey*' -exec chmod 0640 {} \;
|
||||
```
|
||||
|
||||
Exit the certbot container:
|
||||
|
||||
```bash
|
||||
exit
|
||||
```
|
||||
|
||||
Modify your `docker-compose.yml` file, changing the `entrypoint` line under the `certbot` service to the following.
|
||||
This is the same as the above, but to be automatically executed after every certificate renewal.
|
||||
|
||||
```text
|
||||
entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot; chown -R root:999 /etc/letsencrypt/live; chmod 750 /etc/letsencrypt/live; chown -R root:999 /etc/letsencrypt/archive; chmod 750 /etc/letsencrypt/archive; find /etc/letsencrypt/ -name 'privkey*' -exec chmod 0640 {} +; sleep 12h & wait $${!}; done;"
|
||||
```
|
||||
|
||||
Continuing to modify `docker-compose.yml`, add the certbot certificate volume into the peertube container.
|
||||
It should look something like this:
|
||||
|
||||
```text
|
||||
volumes:
|
||||
- ./docker-volume/certbot/conf:/etc/letsencrypt
|
||||
```
|
||||
|
||||
Restart your services:
|
||||
|
||||
```bash
|
||||
docker-compose down; docker-comopse up -d
|
||||
```
|
||||
|
||||
In the livechat plugin settings from your PeerTube administration settings, set the certificate directory to the following:
|
||||
|
||||
```text
|
||||
/etc/letsencrypt/live
|
||||
```
|
||||
|
||||
Save the plugin settings and verify Prosody can see the certificates:
|
||||
|
||||
```bash
|
||||
docker-compose exec -u peertube \
|
||||
peertube \
|
||||
/data/plugins/data/peertube-plugin-livechat/prosodyAppImage/squashfs-root/AppRun \
|
||||
prosodyctl \
|
||||
--config /data/plugins/data/peertube-plugin-livechat/prosody/prosody.cfg.lua \
|
||||
check certs
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If you can't make it work, you can use the diagnostic tool (there is a button on top of the plugin settings page), and take a close look on the «Prosody check» section.
|
159
support/documentation/content/en/documentation/admin/settings.md
Normal file
159
support/documentation/content/en/documentation/admin/settings.md
Normal file
@ -0,0 +1,159 @@
|
||||
---
|
||||
title: "Settings"
|
||||
description: "Plugin Peertube Livechat settings"
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
This section describes the plugin settings page.
|
||||
|
||||
## {{% livechat_label "list_rooms_label" %}}
|
||||
|
||||
When pressing the «List rooms» button, all existing chatrooms will be listed.
|
||||
You can then find them and moderated them.
|
||||
|
||||
## Federation
|
||||
|
||||
Following settings concern the federation with other Peertube instances, and other fediverse softwares.
|
||||
|
||||
### {{% livechat_label federation_no_remote_chat_label %}}
|
||||
|
||||
{{% livechat_label federation_no_remote_chat_description %}}
|
||||
|
||||
### {{% livechat_label federation_dont_publish_remotely_label %}}
|
||||
|
||||
{{% livechat_label federation_dont_publish_remotely_description %}}
|
||||
|
||||
## Chat behaviour
|
||||
|
||||
### {{% livechat_label room_type_label %}}
|
||||
|
||||
{{% livechat_label room_type_description %}}
|
||||
|
||||
### {{% livechat_label auto_display_label %}}
|
||||
|
||||
{{% livechat_label auto_display_description %}}
|
||||
|
||||
### {{% livechat_label open_blank_label %}}
|
||||
|
||||
{{% livechat_label open_blank_description %}}
|
||||
|
||||
### {{% livechat_label share_url_label %}}
|
||||
|
||||
This feature enables a «share chat link» modal. With this modal, you can generate URLs to join the chat.
|
||||
The chat can be customized (readonly mode, use the current theme, ...).
|
||||
|
||||
You can for example generate a readonly URL and use it in OBS to integrate the chat in your live stream!
|
||||
|
||||
This settings allows you to choose who can access this modal.
|
||||
|
||||
### {{% livechat_label per_live_video_label %}}
|
||||
|
||||
{{% livechat_label per_live_video_description %}}
|
||||
|
||||
The video owner will be able to activate web chats.
|
||||
|
||||
### {{% livechat_label all_lives_label %}}
|
||||
|
||||
{{% livechat_label all_lives_description %}}
|
||||
|
||||
### {{% livechat_label all_non_lives_label %}}
|
||||
|
||||
{{% livechat_label all_non_lives_label %}}
|
||||
|
||||
### {{% livechat_label videos_list_label %}}
|
||||
|
||||
{{% livechat_label videos_list_label %}}
|
||||
|
||||
### {{% livechat_label no_anonymous_label %}}
|
||||
|
||||
{{% livechat_label no_anonymous_description %}}
|
||||
|
||||
Note: for now this feature simply hide the chat.
|
||||
In a future release, the chat will be replaced by a message saying «please log in to [...]».
|
||||
See [v5.7.0 Release Notes](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/CHANGELOG.md#570) for more information.
|
||||
|
||||
## Theming
|
||||
|
||||
### {{% livechat_label converse_theme_label %}}
|
||||
|
||||
You can choose which theme to use for ConverseJS:
|
||||
|
||||
- Peertube theme: this is a special theme, made especially for peertube's integration.
|
||||
- Default ConverseJS theme: this is the default ConverseJS theme.
|
||||
- ConverseJS concord theme: this is a theme provided by ConverseJS.
|
||||
|
||||
### {{% livechat_label autocolors_label %}}
|
||||
|
||||
{{% livechat_label autocolors_description %}}
|
||||
|
||||
### {{% livechat_label chat_style_label %}}
|
||||
|
||||
{{% livechat_label chat_style_description %}}
|
||||
|
||||
## Chat server advanced settings
|
||||
|
||||
### {{% livechat_label system_prosody_label %}}
|
||||
|
||||
The plugin comes with an AppImage that is used to run the [Prosody XMPP server](https://prosody.im).
|
||||
If this AppImage is not working, you can fallback to the Prosody that is packaged for your server. Just install the `prosody` package.
|
||||
|
||||
This settings should only be used if the plugin is broken, and waiting for a patch.
|
||||
|
||||
### {{% livechat_label disable_websocket_label %}}
|
||||
|
||||
{{% livechat_label disable_websocket_description %}}
|
||||
|
||||
### {{% livechat_label prosody_port_label %}}
|
||||
|
||||
{{% livechat_label prosody_port_description %}}
|
||||
|
||||
### {{% livechat_label prosody_peertube_uri_label %}}
|
||||
|
||||
{{% livechat_label prosody_peertube_uri_description %}}
|
||||
|
||||
### {{% livechat_label prosody_muc_log_by_default_label %}}
|
||||
|
||||
{{% livechat_label prosody_muc_log_by_default_description %}}
|
||||
|
||||
### {{% livechat_label prosody_muc_expiration_label %}}
|
||||
|
||||
{{% livechat_label prosody_muc_expiration_description %}}
|
||||
|
||||
### {{% livechat_label prosody_room_allow_s2s_label %}}
|
||||
|
||||
{{% livechat_label prosody_room_allow_s2s_description %}}
|
||||
|
||||
### {{% livechat_label prosody_s2s_port_label %}}
|
||||
|
||||
{{% livechat_label prosody_s2s_port_description %}}
|
||||
|
||||
### {{% livechat_label prosody_s2s_interfaces_label %}}
|
||||
|
||||
{{% livechat_label prosody_s2s_interfaces_description %}}
|
||||
|
||||
### {{% livechat_label prosody_certificates_dir_label %}}
|
||||
|
||||
{{% livechat_label prosody_certificates_dir_description %}}
|
||||
|
||||
### {{% livechat_label prosody_c2s_label %}}
|
||||
|
||||
{{% livechat_label prosody_c2s_description %}}
|
||||
|
||||
This setting enable XMPP clients to connect to the built-in Prosody server.
|
||||
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.
|
||||
|
||||
#### {{% livechat_label prosody_c2s_port_label %}}
|
||||
|
||||
{{% livechat_label prosody_c2s_port_description %}}
|
||||
|
||||
### {{% livechat_label prosody_components_label %}}
|
||||
|
||||
This settings enable XMPP external components to connect to the server.
|
||||
For now, this option **only allows connections from localhost components**.
|
||||
|
||||
This feature could be used to connect bridges or bots.
|
||||
|
||||
More informations on Prosody external components [here](https://prosody.im/doc/components).
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "Installation guide"
|
||||
description: "Plugin peertube-plugin-livechat installation guide"
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% notice info %}}
|
||||
Before updating to a major release, please read the release notes and breaking changes list : [CHANGELOG](https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/CHANGELOG.md).
|
||||
{{% /notice %}}
|
||||
|
||||
{{% notice tip %}}
|
||||
To install or update the plugin, **just use the Peertube web admin interface**.
|
||||
{{% /notice %}}
|
||||
|
||||
Here are some other more specific instructions:
|
||||
|
||||
{{% children style="li" depth="3" description="true" %}}
|
@ -0,0 +1,59 @@
|
||||
---
|
||||
title: "Known issues: CPU Compatibility"
|
||||
description: "For now, the plugin only works out of the box for x86_64 and arm64 CPU architecture. Here are some instructions for other CPU architectures."
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
The Prosody AppImage included in the plugin will only work on x86_64 and arm64 CPU.
|
||||
It is not compatible with other CPU architectures.
|
||||
|
||||
To use the plugin, you will have to manually install Prosody on your server
|
||||
(see below).
|
||||
|
||||
Note: the plugin requires Prosody >= 0.12.0.
|
||||
If you are using an older version, Chat Federation could be broken, and it could have some unexpected behaviour.
|
||||
|
||||
Once it is done, you have to check `Use system Prosody` in the plugin settings.
|
||||
|
||||
## On non-docker Peertube installation
|
||||
|
||||
For standard installation, you just have to install the official `prosody` package for your linux distribution.
|
||||
|
||||
For example, on Debian/Ubuntu:
|
||||
|
||||
```bash
|
||||
sudo apt install prosody
|
||||
```
|
||||
|
||||
You can then disable the service that starts automatically when you install Prosody (the plugin will launch a Prosody process, there is no need for the service to run).
|
||||
For example, on Debian/Ubuntu (and other Systemd based linux distributions):
|
||||
|
||||
```bash
|
||||
sudo systemctl disable prosody && sudo systemctl stop prosody
|
||||
```
|
||||
|
||||
Warning: do not disable Prosody if it is used for another service on your server, like for example Jitsi.
|
||||
|
||||
## Docker
|
||||
|
||||
You will have to generate a Peertube image that includes Prosody in the same container that Peertube.
|
||||
I know this is not the standard way to do this with Docker, but keep in mind it is a temporary workaround.
|
||||
|
||||
To generate and use such an image, please refer to the Docker documentation.
|
||||
The Docker file to generate the image should be:
|
||||
|
||||
```Docker
|
||||
FROM chocobozzz/peertube:production-bullseye
|
||||
|
||||
RUN apt -y update && apt install -y prosody && apt -y clean
|
||||
```
|
||||
|
||||
## Yunohost
|
||||
|
||||
You have to disable `metronome` (the XMPP server provided by Yunohost), and install `prosody`.
|
||||
|
||||
This is already done by the Yunohost Peertube application, as it was required for the plugin before the v6.0.0.
|
||||
|
||||
But it may be removed in a near feature (to avoid drawbacks of this method).
|
||||
I have to discuss with Yunohost team, to decide how we can do to minimize drawbacks, and maximize compatibility.
|
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "Upgrade from version older than 6.0.0"
|
||||
description: "Important notes when upgrading for an older version."
|
||||
weight: 50
|
||||
chapter: false
|
||||
---
|
||||
|
||||
## IMPORTANT NOTE
|
||||
|
||||
Since version v6.0.0, this plugin does not need any Prosody installation.
|
||||
|
||||
If you were using this plugin before this version, and if you had installed Prosody manually, you can safely uninstall Prosody.
|
||||
|
||||
If you were using the custom Peertube docker image that is embedding Prosody, you can switch back to the official Peertube image.
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "User documentation"
|
||||
description: "Plugin peertube-plugin-livechat user documentation"
|
||||
weight: 40
|
||||
chapter: false
|
||||
---
|
||||
|
||||
{{% children depth="3" style="li" description="true" %}}
|
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Moderation"
|
||||
description: "Plugin peertube-plugin-livechat moderation"
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
You can access room settings and moderation tools by opening the chat in a new window,
|
||||
and using the dropdown menu at the top right.
|
||||
|
||||
You can list all existing chatrooms: in the plugin settings screen, there is a button «List rooms».
|
||||
|
||||
You can delete old rooms: join the room, and use the menu on the top to destroy the room.
|
||||
|
||||
## Notes
|
||||
|
||||
All instance moderators and admins will be owner of 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.
|
34
support/documentation/content/en/documentation/user/obs.md
Normal file
34
support/documentation/content/en/documentation/user/obs.md
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
title: "OBS"
|
||||
description: "Documentation to stream the chat content using OBS."
|
||||
weight: 10
|
||||
chapter: false
|
||||
---
|
||||
|
||||
## OBS Overlay
|
||||
|
||||
If you are using OBS for streaming, you can easily include the chat in your stream.
|
||||
|
||||
You can use the «share chat link» feature to generate an URL to your chat.
|
||||
The button should be near the chat if you are the video owner (unless it was desactivated by your server admins).
|
||||
|
||||
Check the «readonly» checkbox in the modal.
|
||||
Then use this link as a «web browser source» in OBS.
|
||||
|
||||
You can use the «Transparent background» to have a transparent background in OBS.
|
||||
If you want to customize the background transparency, you can add this CSS in your OBS browser source's settings:
|
||||
|
||||
```css
|
||||
:root {
|
||||
--livechat-transparent: rgba(255 255 255 / 90%) !important;
|
||||
}
|
||||
```
|
||||
|
||||
Note: you can customize colors. This is undocumented yet, but you can try this:
|
||||
in the modal, check «use curent theme colors», then you can try to manually change color values in the URL.
|
||||
You must use valid CSS color values, and they must be properly URL encoded.
|
||||
|
||||
## Mixing multiple chats in your live stream
|
||||
|
||||
You can use the [social_stream browser extension](https://github.com/steveseguin/social_stream#readme) to mix multiple chat source (from Peertube, Twitch, Youtube, Facebook, ...) and include their contents in your live stream.
|
||||
The compatibility with this plugin was added in recent versions.
|
@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "XMPP Clients"
|
||||
description: "Connect to chat using a XMPP client"
|
||||
weight: 40
|
||||
chapter: false
|
||||
---
|
||||
|
||||
This chat plugin relies on the XMPP protocol (also known as Jabber).
|
||||
It is therefore possible to connect to the chats using
|
||||
[XMPP client software](https://en.wikipedia.org/wiki/XMPP#Clients).
|
||||
This can be useful for example to facilitate moderation operations.
|
||||
|
||||
{{% notice info %}}
|
||||
The features described on this page must be enabled and configured by
|
||||
your Peertube instance's administrators. You may therefore not have access to them.
|
||||
{{% /notice %}}
|
||||
|
||||
## Login to your Peertube account
|
||||
|
||||
{{% notice warning %}}
|
||||
This feature is not yet available, and will come in a future version of the plugin.
|
||||
{{% /notice %}}
|
||||
|
||||
## Connection using an external XMPP account
|
||||
|
||||
If this feature is enabled on your instance, you can connect to Peertube
|
||||
chats using any XMPP account.
|
||||
|
||||
To get the address of the room you want to join, you can use the "share chat"
|
||||
button that is located above the chat:
|
||||
|
||||

|
||||
|
||||
{{% notice info %}}
|
||||
By default, the share button is only visible to the owner of the video,
|
||||
and the admins/moderators of the instance.
|
||||
However, admins can decide to display this button for everyone.
|
||||
{{% /notice %}}
|
||||
|
||||
Then, choose "Connect using XMPP":
|
||||
|
||||

|
||||
|
||||
Then you just have to click on "open" or copy/paste the address of the chat room into your XMPP client
|
||||
(using the "join a room" feature).
|
BIN
support/documentation/content/en/images/chat.png
Normal file
BIN
support/documentation/content/en/images/chat.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 189 KiB |
BIN
support/documentation/content/en/images/fullscreen.png
Normal file
BIN
support/documentation/content/en/images/fullscreen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
BIN
support/documentation/content/en/images/share_button.png
Normal file
BIN
support/documentation/content/en/images/share_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
BIN
support/documentation/content/en/images/share_xmpp_dialog.png
Normal file
BIN
support/documentation/content/en/images/share_xmpp_dialog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
21
support/documentation/content/en/intro/_index.md
Normal file
21
support/documentation/content/en/intro/_index.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Introduction"
|
||||
description: "Introduction"
|
||||
weight: 5
|
||||
chapter: false
|
||||
---
|
||||
|
||||
This [Peertube](https://joinpeertube.org/) plugin is meant to provide chat system for Peertube videos.
|
||||
|
||||
{{% notice tip %}}
|
||||
You can use the language selector in the left menu to view this documentation in different languages.
|
||||
Some translations are missing or incomplete. In this case, you'll see the English version of the text.
|
||||
{{% /notice %}}
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
{{% notice tip %}}
|
||||
See a [demo](https://www.yiny.org/w/399a8d13-d4cf-4ef2-b843-98530a8ccbae).
|
||||
{{% /notice %}}
|
15
support/documentation/content/en/issues/_index.md
Normal file
15
support/documentation/content/en/issues/_index.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "Bug tracking & new features"
|
||||
description: "Bug tracking / New features requests"
|
||||
weight: 70
|
||||
chapter: false
|
||||
---
|
||||
|
||||
If you have new feature requests, bugs, or difficulties to setup the plugin, you can use the [Github issue tracker](https://github.com/JohnXLivingston/peertube-plugin-livechat/issues). If possible, try using english or french.
|
||||
|
||||
To have a glimpse to the roadmap for upcoming features, please refer to:
|
||||
|
||||
- this [github project](https://github.com/users/JohnXLivingston/projects/1).
|
||||
- the [milestones on github](https://github.com/JohnXLivingston/peertube-plugin-livechat/milestones).
|
||||
|
||||
If you are a webdesigner or a ConverseJS/Prosody/XMPP expert, and want to help improve this plugin, you are welcome.
|
9
support/documentation/content/en/technical/_index.md
Normal file
9
support/documentation/content/en/technical/_index.md
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
title: "Technical documentation"
|
||||
description: "Technical documentation"
|
||||
weight: 75
|
||||
chapter: false
|
||||
livechatnotranslation: true
|
||||
---
|
||||
|
||||
{{% children style="li" depth="3" description="true" %}}
|
260
support/documentation/content/en/technical/thirdparty/_index.md
vendored
Normal file
260
support/documentation/content/en/technical/thirdparty/_index.md
vendored
Normal file
@ -0,0 +1,260 @@
|
||||
---
|
||||
title: "Third party"
|
||||
description: "Displaying the livechat with 3rd party software."
|
||||
weight: 20
|
||||
chapter: false
|
||||
livechatnotranslation: true
|
||||
---
|
||||
|
||||
{{% notice warning %}}
|
||||
This page describes experimental features.
|
||||
These features are available with the plugin version >= 7.2.0.
|
||||
{{% /notice %}}
|
||||
|
||||
## Introduction
|
||||
|
||||
Peertube is part of the Fediverse. So Peertube video can be watched from other Peertube instances,
|
||||
and from various other softwares:
|
||||
|
||||
* from a Mastodon (or other fediverse application) instance,
|
||||
* from a mobile app (Fedilab, Tusky, ...),
|
||||
* from desktop fediverse app,
|
||||
* ...
|
||||
|
||||
This livechat plugin is using well known standards, so it is possible to join chat rooms even when not viewing the video on Peertube.
|
||||
|
||||
There are basically 2 ways to join the chat room associated to a video:
|
||||
|
||||
* opening a web page (with an url like `https://yourinstance.tld/plugins/livechat/router/webchat/room/8df24108-6e70-4fc8-b1cc-f2db7fcdd535`),
|
||||
* using a XMPP client (and joining a room like `xmpp://8df24108-6e70-4fc8-b1cc-f2db7fcdd535@room.yourinstance.tld?join`)
|
||||
|
||||
{{% notice warning %}}
|
||||
Joining the chat using a XMPP client is not always possible. It requires some DNS and server configuration.
|
||||
It will only be possible if instance's admins have correctly setup the
|
||||
[external XMPP clients connection](/peertube-plugin-livechat/documentation/admin/advanced/xmpp_clients/) feature.
|
||||
{{% /notice %}}
|
||||
|
||||
{{% notice warning %}}
|
||||
Don't try to gues these url and connection methods yourself. Please report to next chapters.
|
||||
{{% /notice %}}
|
||||
|
||||
## Chat discovery
|
||||
|
||||
### Using ActivityPub
|
||||
|
||||
The livechat plugin adds some data in Video ActivityPub objects, so that the chat can be discovered.
|
||||
|
||||
{{% notice info %}}
|
||||
This requires Peertube >= 5.1
|
||||
{{% /notice %}}
|
||||
|
||||
This follows the [FEP-1970](https://codeberg.org/fediverse/fep/src/branch/main/fep/1970/fep-1970.md) recommendations.
|
||||
|
||||
{{% notice warning %}}
|
||||
At the time of the writing, this FEP is in draft status, and the livechat plugin is a Proof-of-concept.
|
||||
Until the FEP is adopted, the specification can change, and the livechat plugin will be adapted accordingly.
|
||||
{{% /notice %}}
|
||||
|
||||
Basically, the chat will be declared as `attachments` on the `Video` object, using the `discussion` relation.
|
||||
|
||||
By default, here is an example of what you will get:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
{
|
||||
"RsaSignature2017": "https://w3id.org/security#RsaSignature2017"
|
||||
},
|
||||
{
|
||||
// ...
|
||||
}
|
||||
],
|
||||
"to": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"cc": [
|
||||
"https://yourinstance.tld/accounts/root/followers"
|
||||
],
|
||||
"type": "Video",
|
||||
"id": "https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535",
|
||||
"name": "The video title",
|
||||
// ...
|
||||
"url": [ /* ... */ ],
|
||||
"attachment": [
|
||||
{
|
||||
"type": "Link",
|
||||
"name": "Chat for live stream: The video title",
|
||||
"rel": "discussion",
|
||||
"href": "https://yourinstance.tld/plugins/livechat/router/webchat/room/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
In case the instance has activated the
|
||||
[external XMPP clients connection](/peertube-plugin-livechat/documentation/admin/advanced/xmpp_clients/) feature:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
{
|
||||
"RsaSignature2017": "https://w3id.org/security#RsaSignature2017"
|
||||
},
|
||||
{
|
||||
// ...
|
||||
}
|
||||
],
|
||||
"to": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"cc": [
|
||||
"https://yourinstance.tld/accounts/root/followers"
|
||||
],
|
||||
"type": "Video",
|
||||
"id": "https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535",
|
||||
"name": "The video title",
|
||||
// ...
|
||||
"url": [ /* ... */ ],
|
||||
"attachment": [
|
||||
{
|
||||
"type": "Link",
|
||||
"name": "Chat for live stream: The video title",
|
||||
"rel": "discussion",
|
||||
"href": "https://yourinstance.tld/plugins/livechat/router/webchat/room/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
},
|
||||
{
|
||||
"type": "Link",
|
||||
"name": "Chat for live stream: The video title",
|
||||
"rel": "discussion",
|
||||
"href": "xmpp://8df24108-6e70-4fc8-b1cc-f2db7fcdd535@room.yourinstance.tld?join"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Algorithm
|
||||
|
||||
If you want to display the chat in a web page or in an iframe, here is what you should do:
|
||||
|
||||
* get the Video ActivityPub object,
|
||||
* if there is no `attachment` key, stop.
|
||||
* loop through the `attachment` values (if `attachment` is not an array, just iterate on this single value)
|
||||
* search for an entry with `rel` === `discussion`, and with `href` using the `https` scheme (that begins with `https://`)
|
||||
* if found, open this href
|
||||
|
||||
If you want to open the chat room using the XMPP protocol:
|
||||
|
||||
* get the Video ActivityPub object,
|
||||
* if there is no `attachment` key, stop.
|
||||
* loop through the `attachment` values (if `attachment` is not an array, just iterate on this single value)
|
||||
* search for an entry with `rel` === `discussion`, and with `href` using the `xmpp` scheme (that begins with `xmpp://`)
|
||||
* if found, open this xmpp uri with your client, or connect to the XMPP room at that address
|
||||
|
||||
#### Additional notes
|
||||
|
||||
In the ActivityPub object, there is also a `peertubeLiveChat` entry.
|
||||
Don't use the content of this entry. This is specific to the livechat plugin, and can be changed or removed in a near future.
|
||||
It is currently required for some endpoint discovery.
|
||||
|
||||
### Using Podcast RSS feed
|
||||
|
||||
The livechat plugin adds some data in Podcast RSS feeds under the [`<podcast:liveItem>`](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#live-item), so that the chat can be discovered for live streams.
|
||||
|
||||
{{% notice info %}}
|
||||
This requires Peertube >= 5.2
|
||||
{{% /notice %}}
|
||||
|
||||
{{% notice info %}}
|
||||
The `<podcast:chat>` element is currently only supported for live streams.
|
||||
{{% /notice %}}
|
||||
|
||||
This follows the [`<podcast:chat>`](https://github.com/Podcastindex-org/podcast-namespace/discussions/502) proposal.
|
||||
|
||||
{{% notice warning %}}
|
||||
At the time of the writing, this proposal is in draft status, and the livechat plugin is a Proof-of-concept.
|
||||
Until the proposal is adopted, the specification can change, and the livechat plugin will be adapted accordingly.
|
||||
{{% /notice %}}
|
||||
|
||||
Basically, the chat will be declared as tag under on the `<podcast:liveItem>` element.
|
||||
|
||||
By default, here is an example of what you will get:
|
||||
|
||||
```xml
|
||||
<podcast:liveItem status="live" start="2023-07-06T18:00:00.000Z">
|
||||
<title>The video title</title>
|
||||
<guid isPermaLink="false">e32b4890-983b-4ce5-8b46-f2d6bc1d8819_2023-07-06T18:00:00.000Z</guid>
|
||||
<link>https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535</link>
|
||||
<podcast:socialInteract
|
||||
uri="https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
protocol="activitypub"
|
||||
accountUrl="https://yourinstance.tld/a/youraccount"
|
||||
/>
|
||||
<enclosure url="https://yourinstance.tld/path/to/video/master.m3u8" type="application/x-mpegURL" />
|
||||
<podcast:alternateEnclosure type="application/x-mpegURL" lang="en" title="HLS" default="true">
|
||||
<podcast:source uri="https://yourinstance.tld/path/to/video/master.m3u8" />
|
||||
</podcast:alternateEnclosure>
|
||||
<itunes:image href="https://yourinstance.tld/lazy-static/previews/8df24108-6e70-4fc8-b1cc-f2db7fcdd535.jpg" />
|
||||
<podcast:chat
|
||||
server="yourinstance.tld"
|
||||
protocol="xmpp"
|
||||
embedUrl="https://yourinstance.tld/plugins/livechat/router/webchat/room/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
/>
|
||||
</podcast:liveItem>
|
||||
```
|
||||
|
||||
In case the instance has activated the
|
||||
[external XMPP clients connection](/peertube-plugin-livechat/documentation/admin/advanced/xmpp_clients/) feature:
|
||||
|
||||
```xml
|
||||
<podcast:liveItem status="live" start="2023-07-06T18:00:00.000Z">
|
||||
<title>The video title</title>
|
||||
<guid isPermaLink="false">e32b4890-983b-4ce5-8b46-f2d6bc1d8819_2023-07-06T18:00:00.000Z</guid>
|
||||
<link>https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535</link>
|
||||
<podcast:socialInteract
|
||||
uri="https://yourinstance.tld/videos/watch/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
protocol="activitypub"
|
||||
accountUrl="https://yourinstance.tld/a/youraccount"
|
||||
/>
|
||||
<enclosure url="https://yourinstance.tld/path/to/video/master.m3u8" type="application/x-mpegURL" />
|
||||
<podcast:alternateEnclosure type="application/x-mpegURL" lang="en" title="HLS" default="true">
|
||||
<podcast:source uri="https://yourinstance.tld/path/to/video/master.m3u8" />
|
||||
</podcast:alternateEnclosure>
|
||||
<itunes:image href="https://yourinstance.tld/lazy-static/previews/8df24108-6e70-4fc8-b1cc-f2db7fcdd535.jpg" />
|
||||
<podcast:chat
|
||||
server="yourinstance.tld"
|
||||
protocol="xmpp"
|
||||
space="8df24108-6e70-4fc8-b1cc-f2db7fcdd535@room.yourinstance.tld"
|
||||
embedUrl="https://yourinstance.tld/plugins/livechat/router/webchat/room/8df24108-6e70-4fc8-b1cc-f2db7fcdd535"
|
||||
/>
|
||||
</podcast:liveItem>
|
||||
```
|
||||
|
||||
#### Algorithm
|
||||
|
||||
If you want to display the chat in a web page or in an iframe, here is what you should do:
|
||||
|
||||
* get the Podcast RSS feed for the channel,
|
||||
* if there is no `<podcast:liveItem>` element under the `<channel>`, stop.
|
||||
* find the `<podcast:liveItem>` you are looking for
|
||||
* `<podcast:socialInteract>` can be used to cross-reference the items with ActivityPub
|
||||
* if there is no `<podcast:chat>` element under the `<podcast:liveItem>`, stop.
|
||||
* loop through the `<podcast:chat>` values (if `<podcast:chat>` is not an array, just iterate on this single value)
|
||||
* there should only be one, but you should expect to handle several just in case
|
||||
* search for the first entry `protocol` === `xmpp` and an `embedUrl` attribute
|
||||
* if found, open this embedUrl
|
||||
|
||||
If you want to open the chat room using the XMPP protocol:
|
||||
|
||||
* get the Podcast RSS feed for the channel,
|
||||
* if there is no `<podcast:liveItem>` element under the `<channel>`, stop.
|
||||
* find the `<podcast:liveItem>` you are looking for
|
||||
* `<podcast:socialInteract>` can be used to cross-reference the items with ActivityPub
|
||||
* loop through the `<podcast:chat>` values (if `<podcast:chat>` is not an array, just iterate on this single value)
|
||||
* there should only be one, but you should expect to handle several just in case
|
||||
* search for the first entry `protocol` === `xmpp` and a `space` attribute
|
||||
* space should be an XMPP JID for a MUC
|
||||
* if found, open this XMPP JID with your client after converting it to a join URI, or connect to the XMPP room at that address
|
Reference in New Issue
Block a user