diff --git a/.gitignore b/.gitignore index 7d4fe7e9..a8426bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ support/documentation/public support/documentation/po/po4a.conf support/documentation/content/translations/**/*.md support/documentation/i18n +support/documentation/.hugo_build.lock public vendor/prosody-appimage vendor/conversejs-* diff --git a/support/documentation/content/en/technical/data/_index.md b/support/documentation/content/en/technical/data/_index.md new file mode 100644 index 00000000..79a71edf --- /dev/null +++ b/support/documentation/content/en/technical/data/_index.md @@ -0,0 +1,50 @@ +--- +title: "Data on the server" +description: "Date files and folders used on the server" +weight: 50 +chapter: false +livechatnotranslation: true +--- + +The livechat plugin stores some date on the server, +in the `/var/www/peertube/storage/plugins/data/peertube-plugin-livechat/` folder. +This page describes these data. + +## prosody + +The `prosody` folder is used by the Prosody XMPP server to store its data and logs. + +## prosodyAppImage + +This plugin uses the Prosoxy XMPP server in background. +This server code is embedded as an AppImage. + +When the plugin starts, it deflate this AppImage in the `prosodyAppImage` folder. + +## serverInfos + +To handle federation between Peertube instances, the plugin needs to store some +information concerning remote instances (available protocols, ...). + +The plugin stores these data in the `serverInfos/instance_uri` folder +(where `instance_uri` is replaced by the instance uri). + +In each instance's folder, there can be these files: + +* `last-update`: json file containing the timestamp of the last information update. So we can avoid refreshing too often. +* `ws-s2s`: if the server allows XMPP S2S Websocket connections, here are the endpoint information +* `s2s`: if the server allows direct XMPP S2S connections, here are the port and url information + +## videoInfos + +To handle federation the plugin needs to store some information about remote videos. + +So, each time we open a new remote chat, a file `videoInfos/remote/instance_uri/video_uuid.json` is created +(where `instance_uri` is the origin instance uri, and `video_uuid` is the video uuid). + +This JSON files contain some data about the remote chat (is it enabled, are anonymous users authorized, +which protocol can we use, ...). +These data can then be read by the Prosody server to connect to the remote chat. + +Moreover, when the current instance builds such data for local videos, +it stores it in `videoInfos/local/video_uuid.json` (where `video_uuid` is the video uuid). diff --git a/support/documentation/content/en/technical/sourcecode/_index.md b/support/documentation/content/en/technical/sourcecode/_index.md new file mode 100644 index 00000000..4269bcd1 --- /dev/null +++ b/support/documentation/content/en/technical/sourcecode/_index.md @@ -0,0 +1,93 @@ +--- +title: "Source code" +description: "Source code organization" +weight: 10 +chapter: false +livechatnotranslation: true +--- + +This page describes the different source code folders and their content. + +## build files + +Files in the root dir that begins with `build-` are files used to build the plugin. +See the `package.json` file for more information. + +## assets + +### assets/images + +The `assets/images` folder contains all icons files used by the plugin. + +There is also the `assets/images/avatars` folders, which contains avatars used for anonymous chat users. +These files are used to generate multiple avatars (see the `build-avatars.js` script for more information). + +### assets/styles + +The `assets/styles` folder contains the livechat plugin SCSS source files. + +## build + +The `build` folder is not part of the source code, but is used to put some files during the build process. + +For example, `build-conversejs.js` use the folder `build/conversejs` to build a customized ConverseJS version. + +## client + +The `client` folder contains the front-end source code. + +Files like `client/common-client-plugin.ts`, `client/videowatch-client-plugin.ts`, ... are the base files that +are loaded by Peertube for different "scopes" (`common`, `videowatch`, ...). +Please refer to the [Peertube plugin documentation](https://docs.joinpeertube.org/contribute/plugins) + for more information. + +## conversejs + +The `conversejs` folder contains code relative to the use of ConverseJS. + +### conversejs/custom + +The `conversejs/custom` folder contains some files that are used to customize ConverseJS. +See the `build-conversejs.sh` script for more information. + +## dist + +The dist folder is where goes all files created during the build process. +It is not part of the source code. + +## documentation + +The folder `documentation` is deprecated. +We only keep files in this folder to avoid dead links +(links to these files were shared on many websites or social media posts). + +The source code for the new documentation is in `support/documentation/content/en`, +and is used to generate the documentation web site. + +## languages + +The folder `languages` contains the languages files. +These files are [translated using Weblate](/peertube-plugin-livechat/contributing/translate/)). + +## prosody-modules + +The `prosody-modules` folder contains some modules used by Prosody. + +Some of them are "officials" plugins, others are specific to this plugin. + +## server + +The `server` folder contains the backend source code. + +## shared + +The `shared` folder contains comme code that will be used both on frontend and backend. + +## support/documentation + +The `support/documentation` contains the documentation source code. + +## vendor + +The `vendor` folder is not part of the source code. +It is used during the build process to download some external source code.