From eec54314f9b9b84064920aa63a3153bd4560db02 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 5 Jun 2022 12:59:43 +0200 Subject: [PATCH] Add autoupdater and use README generator (#49) * Add auto-updater * Use README generator * Auto-update README Co-authored-by: yunohost-bot --- .github/workflows/updater.sh | 27 +++----- .github/workflows/updater.yml | 49 +++++++++++++ README.md | 121 ++++++++++++++++---------------- README_fr.md | 127 ++++++++++++++++------------------ doc/DESCRIPTION.md | 7 ++ doc/DESCRIPTION_fr.md | 7 ++ doc/DISCLAIMER.md | 86 +++++++++++++++++++++++ doc/DISCLAIMER_fr.md | 70 +++++++++++++++++++ manifest.json | 5 ++ 9 files changed, 354 insertions(+), 145 deletions(-) create mode 100644 .github/workflows/updater.yml create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/DISCLAIMER_fr.md diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index c4d53fc..ace22df 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # Since each app is different, maintainers can adapt its contents so as to perform # automatic actions when a new upstream release is detected. -# Remove this exit command when you are ready to run this Action -exit 1 - #================================================= # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= @@ -66,11 +63,14 @@ echo "Handling asset at $asset_url" # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) # Leave $src empty to ignore the asset case $asset_url in - *"admin"*) - src="app" + *"amd64") + src="amd64" ;; - *"update"*) - src="app-upgrade" + *"arm") + src="armhf" + ;; + *"arm64") + src="arm64" ;; *) src="" @@ -91,21 +91,14 @@ checksum=$(sha256sum "$tempdir/$filename" | head -c 64) # Delete temporary directory rm -rf $tempdir -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi - # Rewrite source file cat < conf/$src.src SOURCE_URL=$asset_url SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= +SOURCE_IN_SUBDIR=false +SOURCE_FILENAME=mautrix-whatsapp +SOURCE_EXTRACT=false EOT echo "... conf/$src.src updated" diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/README.md b/README.md index 26e1d41..ae8ffe9 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,40 @@ -# A Matrix-WhatsApp puppeting bridge for YunoHost -[![How components fit togeter](https://camo.githubusercontent.com/857d5c90de07312a60e02ce89efe7f8ece86ab6b/68747470733a2f2f67617a697a6f76612e6e65742f7075622f6d6175747269782d77686174736170702e706e67)](https://docs.mau.fi/bridges/go/whatsapp/index.html) + -[![Integration level](https://dash.yunohost.org/integration/mautrix_whatsapp.svg)](https://dash.yunohost.org/appci/app/mautrix_whatsapp) -[![Install Mautrix-WhatsApp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mautrix_whatsapp) +# Matrix WhatsApp bridge for YunoHost + +[![Integration level](https://dash.yunohost.org/integration/mautrix_whatsapp.svg)](https://dash.yunohost.org/appci/app/mautrix_whatsapp) ![Working status](https://ci-apps.yunohost.org/ci/badges/mautrix_whatsapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mautrix_whatsapp.maintain.svg) +[![Install Matrix WhatsApp bridge with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mautrix_whatsapp) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install a Mautrix-WhatsApp bridge quickly and simply on a YunoHost server alongside Matrix-Synapse. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +> *This package allows you to install Matrix WhatsApp bridge quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service. Messages, media and notifications are bridged between a WhatsApp user and a matrix user. With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations. The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available). Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand. + +A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service. +Messages, media and notifications are bridged between a WhatsApp user and a matrix user. +With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations. +The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available). +Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand. ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!** -**Shipped version:** 0.3.0 +**Shipped version:** 0.3.0~ynh1 +## Disclaimers / important information -## Screenshots - -![](Link to an screenshot for this app) - -## List of known public services +### List of known public services * Ask on one of the following rooms: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net -## Bridging usage +### Bridging usage ** Note that several WhatsApp and Matrix users can be bridged, each WhatsApp account has its own bot administration room. If they are in a same WhatsApp group, only one matrix room will be created. ** -### Bridge a WhatsApp user and a Matrix user +#### Bridge a WhatsApp user and a Matrix user * First your matrix user or server has to be authorized in the bridge configuration (see below) * Then, invite the bot (default @whatsappbot:yoursynapse.domain) * The room with the Mautrix-WhatsApp bot is called "administration room". @@ -37,7 +43,7 @@ A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service. M * Send ``help`` to the bot in the created room to know how to control the bot. See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html) -### Bridge an existing room | Bridge Whatsapp to Signal over Matrix +#### Bridge an existing room | Bridge Whatsapp to Signal over Matrix By default, the bridge creates a portal room for each WA group that the WA user actively uses. Your can also create a portal for an existing Matrix room. **Note that this can be a room created by another bridge, e.g. a Signal portal room** 1. Invite the bridge bot to the room (with an authorized user) @@ -46,7 +52,7 @@ Your can also create a portal for an existing Matrix room. **Note that this can 4. Get the WA invite link `!wa invite-link` and share it with friends. Or invite Whatsapp puppets to room. 5. Optional: Activate relaybot, see next section. -### Relaybot: Bridge a group for several Matrix and several WhatsApp users to chat together +#### Relaybot: Bridge a group for several Matrix and several WhatsApp users to chat together **When upgrading from /dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt update-ca-certificates ``` + +### Miscellaneous information + + * Matrix room (matrix bridges in YunoHost): #mautrix_yunohost:matrix.fdn.fr + * Matrix room (upstream app): #whatsapp:maunium.net +In case you need to upload your logs somewhere, be aware that they contain your contacts' and your phone numbers. Strip them out with +``| sed -r 's/[0-9]{10,}/📞/g' `` + * "Mautrix-WhatsApp" bridge is based on the [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) implementation of the [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) project. + + +## Documentation and resources + +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: + +## Developer info + +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing). + +To try the testing branch, please proceed like that. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug +or +sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug +``` + +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 11bb56a..ddf2a99 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,32 +1,40 @@ -# Une passerelle entre Matrix et WhatsApp pour YunoHost -[![How components fit togeter](https://camo.githubusercontent.com/857d5c90de07312a60e02ce89efe7f8ece86ab6b/68747470733a2f2f67617a697a6f76612e6e65742f7075622f6d6175747269782d77686174736170702e706e67)](https://docs.mau.fi/bridges/go/whatsapp/index.html) -[![Integration level](https://dash.yunohost.org/integration/mautrix-whatsapp.svg)](https://dash.yunohost.org/appci/app/mautrix-whatsapp) -[![Install mautrix-whatsapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mautrix-whatsapp) + -*[Read this readme in english.](./README.md)* +# Matrix WhatsApp bridge pour YunoHost -> *Ce package vous permet d'installer mautrix-whatsapp rapidement et simplement sur un serveur Yunohost. +[![Niveau d'intĂ©gration](https://dash.yunohost.org/integration/mautrix_whatsapp.svg)](https://dash.yunohost.org/appci/app/mautrix_whatsapp) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mautrix_whatsapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mautrix_whatsapp.maintain.svg) +[![Installer Matrix WhatsApp bridge avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mautrix_whatsapp) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Matrix WhatsApp bridge rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble -Une passerelle entre Matrix et WhatsApp empaquetĂ©e comme un service YunoHost. Les messages, mĂ©dias et notifications sont relayĂ©es entre un compte WhatsApp et un compte Matrix. Avec l'option de connexion Robot-Relai, 1 compte Matrix peut inviter d'autres comptes Matrix dans un salon Matrix relayĂ© avec un groupe WhatsApp, ainsi mĂȘme des personnes sans compte WhatsApp peuvent communiquer avec des utilisateur.ice.s de WhatsApp. La passerelle ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un Service d'Application Matrix-Synapse et repose sur une base-de-donnĂ©es postgresql (mysql Ă©galement possible). C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) doit ĂȘtre prĂ©alablemnet installĂ©. + +Une passerelle entre Matrix et WhatsApp empaquetĂ©e comme un service YunoHost. +Les messages, mĂ©dias et notifications sont relayĂ©es entre un compte WhatsApp et un compte Matrix. +Avec l'option de connexion Robot-Relai, 1 compte Matrix peut inviter d'autres comptes Matrix dans un salon Matrix relayĂ© avec un groupe WhatsApp, ainsi mĂȘme des personnes sans compte WhatsApp peuvent communiquer avec des utilisateur.ice.s de WhatsApp. +La passerelle ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un Service d'Application Matrix-Synapse et repose sur une base-de-donnĂ©es postgresql (mysql Ă©galement possible). +C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) doit ĂȘtre prĂ©alablemnet installĂ©. ** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en mĂȘme temps!** -**Version incluse:** 0.3.0 -## Captures d'Ă©cran +**Version incluse :** 0.3.0~ynh1 +## Avertissements / informations importantes -![](Lien vers une capture d'Ă©cran pour cette application) - -## Liste de passerelles publiques +### Liste de passerelles publiques * Demandez sur un des salons suivants: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net -## Usages de la passerelle +### Usages de la passerelle ** Notez que plusieurs comptes WhatsApp et Matrix peuvent ĂȘtre relayĂ©s, chaque compte WhatsApp connectĂ© a son propre Salon d'Administration. Si plusieurs utilisateur.ice.s du Robot sont dans un mĂȘme groupe WhatsApp, seul un Salon Matrix sera créé par la passerelle. ** -### Relayer TOUTES les conversations entre UN compte WhatsApp et UN compte Matrix +#### Relayer TOUTES les conversations entre UN compte WhatsApp et UN compte Matrix * PrĂ©requis : votre compte Matrix ou le serveur sur lequel il est hĂ©bergĂ© doit ĂȘtre autorisĂ© dans la configuration de la passerelle (voir ci-dessous) * Invitez le Robot (par dĂ©faut @whatsappbot:synapse.votredomaine) Ă  une nouvelle conversation. * Ce nouveau salon d'administration du Robot Mautrix-WhatsApp est appelĂ© "Administration Room". @@ -35,93 +43,78 @@ Une passerelle entre Matrix et WhatsApp empaquetĂ©e comme un service YunoHost. L * Envoyez ``help`` au Robot dans le "Administration Room" pour une liste des commandes d'administration de la passerelle. Voir aussi [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html) +#### Robot-Relai "Relaybot": Relayer les conversations de TOUS les comptes Matrix et TOUS les comptes WhatsApp prĂ©sents dans UN groupe/salon - -### Robot-Relai "Relaybot": Relayer les conversations de TOUS les comptes Matrix et TOUS les comptes WhatsApp prĂ©sents dans UN groupe/salon * PrĂ©requis : CrĂ©er un nouveau salon vide "Relaybot Administration Room" et rechercher son identifiant. * Activer l'option Robot-Relai "Relaybot" dans la configuration de la passerelle (default=disabled, voir ci-dessous) et ajouter l'identifiant du salon d'administration du Relaybot "Relaybot Administration Room". * RedĂ©marrer le service mautrix_whatsapp * Vous pouvez maintenant relayer un groupe WhatsApp en y invitant le numĂ©ro de tĂ©lĂ©phone du compte WhatsApp connectĂ© au RobotRelai. CĂŽtĂ© WhatsApp, tous les messages venant de Matrix seront vus comme envoyĂ©s depuis le compte WhatsApp connectĂ©, avec un prĂ©fix indiquant le compte Matrix correspondant. CĂŽtĂ© Matrix, la passerelle va crĂ©er des comptes Matrix pour chaque compte WhatsApp prĂ©sent dans le groupe relayĂ©. Les messages sont indiquĂ©s comme provenant soit du numĂ©ro de tĂ©lĂ©phone, soit du pseudo WhatsApp. Voir aussi [la page wiki principale sur le Robot-Relai](https://docs.mau.fi/bridges/go/whatsapp/relaybot.html) -## Configuration de la passerelle +### Configuration de la passerelle La passerelle est [configurĂ©e avec les paramĂštres standards adaptĂ©s pour votre YunoHost et l'instance Matrix-Synapse sĂ©lectionnĂ©e](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml). Vous pouvez par exemple ajouter des administrateur.ice.s et utilisateur.ice.s du Robot autorisĂ©s en modifiant le fichier de configuration par liaison SSH: ``` sudo nano /opt/yunohost/mautrix_whatsapp/config.yaml``` puis en redĂ©marrant le service: ``` sudo yunohost service restart mautrix_whatsapp``` -## Documentation +### Support multi-comptes - * Documentation officielle "Mautrix-WhatsApp": https://docs.mau.fi/bridges/go/whatsapp/index.html - * Salon Matrix sur les Passerelles dans Yunohost): #mautrix_yunohost:matrix.fdn.fr - * Salon Matrix (application principale): #whatsapp:maunium.net -Si vous devez tĂ©lĂ©verser vos fichiers log quelque-part, soyez avertis qu'ils contiennent des informations sur vos contacts et vos numĂ©ros de tĂ©lĂ©phone. Effacez-les avec -``| sed -r 's/[0-9]{10,}/📞/g' `` - * La passerelle "Mautrix-WhatsApp" repose sur l'implĂ©mentation [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) du projet [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng). - * Documentation YunoHost: Si une documentation spĂ©cifique est nĂ©cessaire, n'hĂ©sitez pas Ă  contribuer. - -## CaractĂ©ristiques spĂ©cifiques YunoHost - -#### Support multi-comptes * Les utilisateur.ice.s du Robot ne sont pas liĂ©s aux comptes Yunohost. N'importe quel compte Matrix ou serveur Synapse autorisĂ©s dans la configuration de la passerelle peut inviter/utiliser le Robot. * Le robot WhatsApp est un utilisateur Matrix-Synapse local, mais accessible via la fĂ©dĂ©ration (Synapse public ou privĂ©). * Plusieurs comptes WhatsApp et Matrix peuvent ĂȘtre liĂ©s avec une seule passerelle, chaque compte a son propre salon d'administration. * Si plusieurs utilisateur.ice.s du Robot sont dans un mĂȘme groupe WhatsApp, seul un Salon Matrix sera créé par la passerelle. Autrement dit, la passerelle construit un seul miroir du rĂ©seau de discussion existant sur WhatsApp (utilisateurs et salons). * Voir https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support -#### Support multi-instance +### Support multi-instance * L'installation multi-instance devrait fonctionner. Plusieurs instances de passerelles pourraient ĂȘtre installĂ©es pour une instance de Matrix-Synapse. Cela permet Ă  un compte matrix de se relier Ă  plusieurs comptes WhatsApp. * Plusieurs instances de passerelles pourraient ĂȘtre installĂ©es pour que chaque instance de Matrix-Synapse puisse en bĂ©nĂ©ficier. Mais une passerelle peut ĂȘtre utilisĂ©e par les comptes de plusieurs instances Matrix-Synapse. -#### Architectures supportĂ©es +### Architectures supportĂ©es -* TestĂ© sur ARMv7 en Avril 2020 -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mautrix_whatsapp%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mautrix_whatsapp%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mautrix_whatsapp/) +ARM, ARM64, AMD64 -## Limitations +### Limitations * Les appels Audio/Video ne sont pas relayĂ©s. Seule une notification apparait. * Si WhatsApp perd la connexion, par ex. l'ordiphone est mis en mode avion ou les notifications poussĂ©es sont dĂ©sactivĂ©es, le robot doit parfois ĂȘtre redĂ©marrĂ© Ă  la main en envoyant un message ``wa !reconnnect`` dans le salon d'administration. -## Informations additionnelles +### Informations additionnelles -* It is recommended to install WhatsApp on a virtual android running on a server, see [upstream wiki Android-VM-Setup page](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html) - -**Plus d'informations sur la page de documentation:** - -* https://docs.mau.fi/bridges/go/whatsapp/index.html -* https://yunohost.org/packaging_apps - -## Liens - - * Signaler un bug: https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh/issues - * Site de l'application: https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh - * Documentation de l'application principale: https://docs.mau.fi/bridges/go/whatsapp/index.html - * DĂ©pĂŽt de l'application principale: https://github.com/mautrix/whatsapp - * Up-Upstream repository: https://github.com/Rhymen/go-whatsapp - * Up-Up-Upstream repository: https://github.com/sigalor/whatsapp-web-reveng - * Site web YunoHost: https://yunohost.org/ - ---- - -Informations pour les dĂ©veloppeurs ----------------- - -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh/tree/testing). - -Pour essayer la branche testing, procĂ©dez comme suit. -``` -sudo yunohost app install https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh/tree/testing --debug -ou -sudo yunohost app upgrade mautrix-whatsapp -u https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh/tree/testing --debug -``` +* Il est recommandĂ© d'installer WhatsApp sur une machine Android virtuelle tournant sur un serveur, cf. le [page Android-VM-Setup du wiki](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html) Pour tester la communication entre le Service d'Application et Matrix-Synapse sur une Machine Virtuelle (ex. avec un nom de domaine: synapse.vm), vous devez installer un certificat: ``` echo | openssl s_client -showcerts -servername synapse.vm -connect synapse.vm:443 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt update-ca-certificates ``` + +### Informations diverses + +* Salon Matrix sur les Passerelles dans Yunohost): #mautrix_yunohost:matrix.fdn.fr +* Salon Matrix (application principale): #whatsapp:maunium.net +Si vous devez tĂ©lĂ©verser vos fichiers log quelque-part, soyez avertis qu'ils contiennent des informations sur vos contacts et vos numĂ©ros de tĂ©lĂ©phone. Effacez-les avec +``| sed -r 's/[0-9]{10,}/📞/g' `` +* La passerelle "Mautrix-WhatsApp" repose sur l'implĂ©mentation [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) du projet [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng). + +## Documentations et ressources + +* Documentation officielle de l'admin : +* DĂ©pĂŽt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : + +## Informations pour les dĂ©veloppeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing). + +Pour essayer la branche testing, procĂ©dez comme suit. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug +ou +sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..d0e3028 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,7 @@ +A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service. +Messages, media and notifications are bridged between a WhatsApp user and a matrix user. +With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations. +The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available). +Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand. + +** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!** diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..028f979 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,7 @@ +Une passerelle entre Matrix et WhatsApp empaquetĂ©e comme un service YunoHost. +Les messages, mĂ©dias et notifications sont relayĂ©es entre un compte WhatsApp et un compte Matrix. +Avec l'option de connexion Robot-Relai, 1 compte Matrix peut inviter d'autres comptes Matrix dans un salon Matrix relayĂ© avec un groupe WhatsApp, ainsi mĂȘme des personnes sans compte WhatsApp peuvent communiquer avec des utilisateur.ice.s de WhatsApp. +La passerelle ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un Service d'Application Matrix-Synapse et repose sur une base-de-donnĂ©es postgresql (mysql Ă©galement possible). +C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) doit ĂȘtre prĂ©alablemnet installĂ©. + +** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en mĂȘme temps!** diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..8e82a1b --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,86 @@ +### List of known public services + +* Ask on one of the following rooms: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net + +### Bridging usage +** Note that several WhatsApp and Matrix users can be bridged, each WhatsApp account has its own bot administration room. If they are in a same WhatsApp group, only one matrix room will be created. ** + +#### Bridge a WhatsApp user and a Matrix user +* First your matrix user or server has to be authorized in the bridge configuration (see below) +* Then, invite the bot (default @whatsappbot:yoursynapse.domain) +* The room with the Mautrix-WhatsApp bot is called "administration room". +* Type ``login`` +* Capture the QR code with the camera in the whatsapp of your VM or smartphone (WhatsApp Web) +* Send ``help`` to the bot in the created room to know how to control the bot. +See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html) + +#### Bridge an existing room | Bridge Whatsapp to Signal over Matrix +By default, the bridge creates a portal room for each WA group that the WA user actively uses. +Your can also create a portal for an existing Matrix room. **Note that this can be a room created by another bridge, e.g. a Signal portal room** +1. Invite the bridge bot to the room (with an authorized user) +2. type `!wa create` +3. Your logged in WA user creates a new corresponding group. +4. Get the WA invite link `!wa invite-link` and share it with friends. Or invite Whatsapp puppets to room. +5. Optional: Activate relaybot, see next section. + +#### Relaybot: Bridge a group for several Matrix and several WhatsApp users to chat together +**When upgrading from /dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt +update-ca-certificates +``` + +### Miscellaneous information + + * Matrix room (matrix bridges in YunoHost): #mautrix_yunohost:matrix.fdn.fr + * Matrix room (upstream app): #whatsapp:maunium.net +In case you need to upload your logs somewhere, be aware that they contain your contacts' and your phone numbers. Strip them out with +``| sed -r 's/[0-9]{10,}/📞/g' `` + * "Mautrix-WhatsApp" bridge is based on the [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) implementation of the [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) project. + diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..31e9ae0 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,70 @@ +### Liste de passerelles publiques + +* Demandez sur un des salons suivants: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net + +### Usages de la passerelle +** Notez que plusieurs comptes WhatsApp et Matrix peuvent ĂȘtre relayĂ©s, chaque compte WhatsApp connectĂ© a son propre Salon d'Administration. Si plusieurs utilisateur.ice.s du Robot sont dans un mĂȘme groupe WhatsApp, seul un Salon Matrix sera créé par la passerelle. ** + +#### Relayer TOUTES les conversations entre UN compte WhatsApp et UN compte Matrix +* PrĂ©requis : votre compte Matrix ou le serveur sur lequel il est hĂ©bergĂ© doit ĂȘtre autorisĂ© dans la configuration de la passerelle (voir ci-dessous) +* Invitez le Robot (par dĂ©faut @whatsappbot:synapse.votredomaine) Ă  une nouvelle conversation. +* Ce nouveau salon d'administration du Robot Mautrix-WhatsApp est appelĂ© "Administration Room". +* Tapez ``login`` +* Scannez le QR-code avec la camĂ©ra Whatsapp de votre Machine Virtuelle ou ordiphone (option WhatsApp Web dans l'appli) +* Envoyez ``help`` au Robot dans le "Administration Room" pour une liste des commandes d'administration de la passerelle. +Voir aussi [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html) + +#### Robot-Relai "Relaybot": Relayer les conversations de TOUS les comptes Matrix et TOUS les comptes WhatsApp prĂ©sents dans UN groupe/salon + +* PrĂ©requis : CrĂ©er un nouveau salon vide "Relaybot Administration Room" et rechercher son identifiant. +* Activer l'option Robot-Relai "Relaybot" dans la configuration de la passerelle (default=disabled, voir ci-dessous) et ajouter l'identifiant du salon d'administration du Relaybot "Relaybot Administration Room". +* RedĂ©marrer le service mautrix_whatsapp +* Vous pouvez maintenant relayer un groupe WhatsApp en y invitant le numĂ©ro de tĂ©lĂ©phone du compte WhatsApp connectĂ© au RobotRelai. CĂŽtĂ© WhatsApp, tous les messages venant de Matrix seront vus comme envoyĂ©s depuis le compte WhatsApp connectĂ©, avec un prĂ©fix indiquant le compte Matrix correspondant. CĂŽtĂ© Matrix, la passerelle va crĂ©er des comptes Matrix pour chaque compte WhatsApp prĂ©sent dans le groupe relayĂ©. Les messages sont indiquĂ©s comme provenant soit du numĂ©ro de tĂ©lĂ©phone, soit du pseudo WhatsApp. +Voir aussi [la page wiki principale sur le Robot-Relai](https://docs.mau.fi/bridges/go/whatsapp/relaybot.html) + +### Configuration de la passerelle + +La passerelle est [configurĂ©e avec les paramĂštres standards adaptĂ©s pour votre YunoHost et l'instance Matrix-Synapse sĂ©lectionnĂ©e](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml). Vous pouvez par exemple ajouter des administrateur.ice.s et utilisateur.ice.s du Robot autorisĂ©s en modifiant le fichier de configuration par liaison SSH: +``` sudo nano /opt/yunohost/mautrix_whatsapp/config.yaml``` +puis en redĂ©marrant le service: +``` sudo yunohost service restart mautrix_whatsapp``` + +### Support multi-comptes + +* Les utilisateur.ice.s du Robot ne sont pas liĂ©s aux comptes Yunohost. N'importe quel compte Matrix ou serveur Synapse autorisĂ©s dans la configuration de la passerelle peut inviter/utiliser le Robot. +* Le robot WhatsApp est un utilisateur Matrix-Synapse local, mais accessible via la fĂ©dĂ©ration (Synapse public ou privĂ©). +* Plusieurs comptes WhatsApp et Matrix peuvent ĂȘtre liĂ©s avec une seule passerelle, chaque compte a son propre salon d'administration. +* Si plusieurs utilisateur.ice.s du Robot sont dans un mĂȘme groupe WhatsApp, seul un Salon Matrix sera créé par la passerelle. Autrement dit, la passerelle construit un seul miroir du rĂ©seau de discussion existant sur WhatsApp (utilisateurs et salons). +* Voir https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support + +### Support multi-instance + +* L'installation multi-instance devrait fonctionner. Plusieurs instances de passerelles pourraient ĂȘtre installĂ©es pour une instance de Matrix-Synapse. Cela permet Ă  un compte matrix de se relier Ă  plusieurs comptes WhatsApp. +* Plusieurs instances de passerelles pourraient ĂȘtre installĂ©es pour que chaque instance de Matrix-Synapse puisse en bĂ©nĂ©ficier. Mais une passerelle peut ĂȘtre utilisĂ©e par les comptes de plusieurs instances Matrix-Synapse. + +### Architectures supportĂ©es + +ARM, ARM64, AMD64 + +### Limitations + +* Les appels Audio/Video ne sont pas relayĂ©s. Seule une notification apparait. +* Si WhatsApp perd la connexion, par ex. l'ordiphone est mis en mode avion ou les notifications poussĂ©es sont dĂ©sactivĂ©es, le robot doit parfois ĂȘtre redĂ©marrĂ© Ă  la main en envoyant un message ``wa !reconnnect`` dans le salon d'administration. + +### Informations additionnelles + +* Il est recommandĂ© d'installer WhatsApp sur une machine Android virtuelle tournant sur un serveur, cf. le [page Android-VM-Setup du wiki](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html) + +Pour tester la communication entre le Service d'Application et Matrix-Synapse sur une Machine Virtuelle (ex. avec un nom de domaine: synapse.vm), vous devez installer un certificat: +``` +echo | openssl s_client -showcerts -servername synapse.vm -connect synapse.vm:443 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt +update-ca-certificates +``` + +### Informations diverses + +* Salon Matrix sur les Passerelles dans Yunohost): #mautrix_yunohost:matrix.fdn.fr +* Salon Matrix (application principale): #whatsapp:maunium.net +Si vous devez tĂ©lĂ©verser vos fichiers log quelque-part, soyez avertis qu'ils contiennent des informations sur vos contacts et vos numĂ©ros de tĂ©lĂ©phone. Effacez-les avec +``| sed -r 's/[0-9]{10,}/📞/g' `` +* La passerelle "Mautrix-WhatsApp" repose sur l'implĂ©mentation [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) du projet [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng). diff --git a/manifest.json b/manifest.json index fe79995..da51168 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,11 @@ }, "version": "0.3.0~ynh1", "url": "https://github.com/mautrix/whatsapp", + "upstream": { + "license": "AGPL-3.0-or-later", + "admindoc": "https://docs.mau.fi/bridges/go/whatsapp/index.html", + "code": "https://github.com/mautrix/whatsapp" + }, "license": "AGPL-3.0-or-later", "maintainer": { "name": "Gredin67",