1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh.git synced 2024-09-03 19:46:01 +02:00

Merge branch 'testing' into prevent-collision-botname

This commit is contained in:
Dante 2022-09-24 12:03:13 +01:00
commit 448fe66873
19 changed files with 230 additions and 279 deletions

View file

@ -3,14 +3,14 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app
It shall NOT be edited by hand. It shall NOT be edited by hand.
--> -->
# Matrix WhatsApp bridge for YunoHost # 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) [![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) [![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)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Matrix WhatsApp bridge quickly and simply on a YunoHost server. > *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.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
@ -24,18 +24,18 @@ Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh)
** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!** ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
**Shipped version:** 0.6.0~ynh3 **Shipped version:** 0.7.0~ynh2
## Disclaimers / important information ## Disclaimers / important information
### 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 * 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. ** ** 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) * First your matrix user or server has to be authorized in the bridge configuration (see below)
* Then, invite the bot (default @whatsappbot:yoursynapse.domain) * Then, invite the bot (default @whatsappbot:yoursynapse.domain)
* The room with the Mautrix-WhatsApp bot is called "administration room". * The room with the Mautrix-WhatsApp bot is called "administration room".
@ -44,7 +44,7 @@ Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh)
* Send ``help`` to the bot in the created room to know how to control the bot. * 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) 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. 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** 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) 1. Invite the bridge bot to the room (with an authorized user)
@ -53,7 +53,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. 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. 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 <v0.2.0, the relaybot system changed. There is no relaybot administration room anymore. Relay must be re-activated in all rooms**. **When upgrading from <v0.2.0, the relaybot system changed. There is no relaybot administration room anymore. Relay must be re-activated in all rooms**.
To be able to bridge not only your logged in Matrix account but also Matrix friends you invite to a portal room, you need to: To be able to bridge not only your logged in Matrix account but also Matrix friends you invite to a portal room, you need to:
@ -65,14 +65,16 @@ To be able to bridge not only your logged in Matrix account but also Matrix frie
* On the matrix side: the bridge will create matrix puppets corresponding to the WhatsApp users when they send a message. * On the matrix side: the bridge will create matrix puppets corresponding to the WhatsApp users when they send a message.
See also [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html) See also [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html)
### Configuration of the bridge ## Configuration of the bridge
The bridge is [roughly configured at installation](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the The bridge is [roughly configured at installation](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the
following configuration file with SSH: following configuration file with SSH:
```/opt/yunohost/mautrix_whatsapp/config.yaml``` ```/opt/yunohost/mautrix_whatsapp/config.yaml```
and then restarting the mautrix_whatsapp service. and then restarting the mautrix_whatsapp service.
### Multi-users support ## YunoHost specific features
#### Multi-user support
* Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot. * Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot.
* The WhatsApp bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private). * The WhatsApp bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private).
@ -80,7 +82,7 @@ and then restarting the mautrix_whatsapp service.
* If several bot users are in a same WhatsApp group, only one Matrix room will be created by the bridge. * If several bot users are in a same WhatsApp group, only one Matrix room will be created by the bridge.
* See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support * See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
### Multi-instance support #### Multi-instance support
* Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several WhatsApp accounts. * Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several WhatsApp accounts.
* Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances. * Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances.
@ -89,7 +91,7 @@ and then restarting the mautrix_whatsapp service.
ARM, ARM64, AMD64 ARM, ARM64, AMD64
### Limitations ## Limitations
* Audio/Video calls are not bridged yet. * Audio/Video calls are not bridged yet.
* If WhatsApp loses connection, e.g. the phone is set in flight mode or push notifications are deactivated, the bot has sometimes to be restarted manually by sending a reconnnect message in the matrix administration room. * If WhatsApp loses connection, e.g. the phone is set in flight mode or push notifications are deactivated, the bot has sometimes to be restarted manually by sending a reconnnect message in the matrix administration room.
@ -117,6 +119,7 @@ In case you need to upload your logs somewhere, be aware that they contain your
## Documentation and resources ## Documentation and resources
* Official app website: <https://maunium.net/go/mautrix-whatsapp/>
* Official admin documentation: <https://docs.mau.fi/bridges/go/whatsapp/index.html> * Official admin documentation: <https://docs.mau.fi/bridges/go/whatsapp/index.html>
* Upstream app code repository: <https://github.com/mautrix/whatsapp> * Upstream app code repository: <https://github.com/mautrix/whatsapp>
* YunoHost documentation for this app: <https://yunohost.org/app_mautrix_whatsapp> * YunoHost documentation for this app: <https://yunohost.org/app_mautrix_whatsapp>

View file

@ -3,14 +3,14 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app
It shall NOT be edited by hand. It shall NOT be edited by hand.
--> -->
# Matrix WhatsApp bridge pour YunoHost # Matrix-WhatsApp bridge pour 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) [![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) [![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)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Matrix WhatsApp bridge rapidement et simplement sur un serveur YunoHost. > *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.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble ## Vue d'ensemble
@ -24,18 +24,18 @@ C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_y
** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!** ** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!**
**Version incluse :** 0.6.0~ynh3 **Version incluse :** 0.7.0~ynh2
## Avertissements / informations importantes ## Avertissements / informations importantes
### Liste de passerelles publiques ## Liste de passerelles publiques
* Demandez sur un des salons suivants: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net * 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. ** ** 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) * 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. * 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". * Ce nouveau salon d'administration du Robot Mautrix-WhatsApp est appelé "Administration Room".
@ -101,6 +101,7 @@ Si vous devez téléverser vos fichiers log quelque-part, soyez avertis qu'ils c
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : <https://maunium.net/go/mautrix-whatsapp/>
* Documentation officielle de l'admin : <https://docs.mau.fi/bridges/go/whatsapp/index.html> * Documentation officielle de l'admin : <https://docs.mau.fi/bridges/go/whatsapp/index.html>
* Dépôt de code officiel de l'app : <https://github.com/mautrix/whatsapp> * Dépôt de code officiel de l'app : <https://github.com/mautrix/whatsapp>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_mautrix_whatsapp> * Documentation YunoHost pour cette app : <https://yunohost.org/app_mautrix_whatsapp>

View file

@ -1,7 +1,7 @@
;; Default test serie ;; Default test serie
; pre-install ; pre-install
sudo yunohost tools update apps sudo yunohost tools update apps
sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_public=$is_public&jitsi_server=$jitsi_server" --force sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_free_registration=$is_free_registration&jitsi_server=$jitsi_server" --force
; Manifest ; Manifest
synapsenumber="1" synapsenumber="1"
whatsappbot="whatsappbot" whatsappbot="whatsappbot"
@ -17,10 +17,15 @@
setup_private=0 setup_private=0
setup_public=0 setup_public=0
upgrade=1 upgrade=1
# 0.3.0
upgrade=1 from_commit=42df5b910927283241e185dcb8a62089adeb9c85 upgrade=1 from_commit=42df5b910927283241e185dcb8a62089adeb9c85
# 0.2.4
upgrade=1 from_commit=23cd51919e2b09865256a21214865d798bd843f6 upgrade=1 from_commit=23cd51919e2b09865256a21214865d798bd843f6
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
;;; Options
Email=
Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=42df5b910927283241e185dcb8a62089adeb9c85 ; commit=42df5b910927283241e185dcb8a62089adeb9c85
name=0.3.0 name=0.3.0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-amd64 SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-amd64
SOURCE_SUM=16fb400dfff3ee41c67c90c4c81106dd1b18d83ce120e038e72d2b0f2e0c3654 SOURCE_SUM=13b43350e3beabcccd5cce51d3562c0eed703b4075674143d13921fa3f9e6400
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=mautrix-whatsapp SOURCE_FILENAME=mautrix-whatsapp

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-arm64 SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-arm64
SOURCE_SUM=3b17adb90a1368e9598c5302c1490f717e86c7d820dbeba20d6404f242edb772 SOURCE_SUM=90157e29087320de779a285c308e9aca1a0f052a9e84c4d071e2fbdb3a2c6e31
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=mautrix-whatsapp SOURCE_FILENAME=mautrix-whatsapp

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-arm SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-arm
SOURCE_SUM=04c6d4d6327048c4d504e0ca349965d1cdcc17ef742eaf6b31148afb3361e02b SOURCE_SUM=54c0c20d5c6a2997d99cdeb469eebf786ce0593f95582e98da318e178ab364ef
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=mautrix-whatsapp SOURCE_FILENAME=mautrix-whatsapp

View file

@ -1,14 +1,13 @@
# Homeserver details. # Homeserver details
homeserver: homeserver:
# The address that this appservice can use to connect to the homeserver. # The address that this appservice can use to connect to the homeserver.
#address: https://example.com
address: https://__DOMAIN__ address: https://__DOMAIN__
# The domain of the homeserver (for MXIDs, etc). # The domain of the homeserver (for MXIDs, etc).
#domain: example.com
domain: __SERVER_NAME__ domain: __SERVER_NAME__
# Is the homeserver actually mautrix-asmux? # What software is the homeserver running?
asmux: false # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
software: standard
# The URL to push real-time bridge status to. # The URL to push real-time bridge status to.
# If set, the bridge will make POST requests to this URL whenever a user's whatsapp connection state changes. # If set, the bridge will make POST requests to this URL whenever a user's whatsapp connection state changes.
# The bridge will use the appservice as_token to authorize requests. # The bridge will use the appservice as_token to authorize requests.
@ -22,12 +21,10 @@ homeserver:
# Changing these values requires regeneration of the registration. # Changing these values requires regeneration of the registration.
appservice: appservice:
# The address that the homeserver can use to connect to this appservice. # The address that the homeserver can use to connect to this appservice.
#address: http://localhost:29318
address: http://localhost:__PORT__ address: http://localhost:__PORT__
# The hostname and port where this appservice should listen. # The hostname and port where this appservice should listen.
hostname: 0.0.0.0 hostname: 0.0.0.0
#port: 29318
port: __PORT__ port: __PORT__
# Database config. # Database config.
@ -64,7 +61,7 @@ appservice:
# Whether or not to receive ephemeral events via appservice transactions. # Whether or not to receive ephemeral events via appservice transactions.
# Requires MSC2409 support (i.e. Synapse 1.22+). # Requires MSC2409 support (i.e. Synapse 1.22+).
# You should disable bridge -> sync_with_custom_puppets when this is enabled. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
ephemeral_events: false ephemeral_events: true
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
as_token: "This value is generated when generating the registration" as_token: "This value is generated when generating the registration"
@ -199,7 +196,7 @@ bridge:
# Should Matrix users leaving groups be bridged to WhatsApp? # Should Matrix users leaving groups be bridged to WhatsApp?
bridge_matrix_leave: true bridge_matrix_leave: true
# Should the bridge sync with double puppeting to receive EDUs that aren't normally sent to appservices. # Should the bridge sync with double puppeting to receive EDUs that aren't normally sent to appservices.
sync_with_custom_puppets: true sync_with_custom_puppets: false
# Should the bridge update the m.direct account data event when double puppeting is enabled. # Should the bridge update the m.direct account data event when double puppeting is enabled.
# Note that updating the m.direct event is not atomic (except with mautrix-asmux) # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
# and is therefore prone to race conditions. # and is therefore prone to race conditions.
@ -280,6 +277,9 @@ bridge:
# Should the bridge never send alerts to the bridge management room? # Should the bridge never send alerts to the bridge management room?
# These are mostly things like the user being logged out. # These are mostly things like the user being logged out.
disable_bridge_alerts: false disable_bridge_alerts: false
# Should the bridge stop if the WhatsApp server says another user connected with the same session?
# This is only safe on single-user bridges.
crash_on_stream_replaced: false
# Should the bridge detect URLs in outgoing messages, ask the homeserver to generate a preview, # Should the bridge detect URLs in outgoing messages, ask the homeserver to generate a preview,
# and send it to WhatsApp? URL previews can always be sent using the `com.beeper.linkpreviews` # and send it to WhatsApp? URL previews can always be sent using the `com.beeper.linkpreviews`
# key in the event content even if this is disabled. # key in the event content even if this is disabled.
@ -323,6 +323,8 @@ bridge:
# This will cause the bridge bot to be in private chats for the encryption to work properly. # This will cause the bridge bot to be in private chats for the encryption to work properly.
# It is recommended to also set private_chat_portal_meta to true when using this. # It is recommended to also set private_chat_portal_meta to true when using this.
default: false default: false
# Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
appservice: false
# Require encryption, drop any unencrypted messages. # Require encryption, drop any unencrypted messages.
require: false require: false
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
@ -392,7 +394,7 @@ bridge:
# Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any
# authenticated user into a relaybot for that chat. # authenticated user into a relaybot for that chat.
#enabled: false #enabled: false
enabled: __ENABLE_RELAYBOT__ enabled: true
# Should only admins be allowed to set themselves as relay users? # Should only admins be allowed to set themselves as relay users?
admin_only: true admin_only: true
# The formats to use when sending messages to WhatsApp via the relaybot. # The formats to use when sending messages to WhatsApp via the relaybot.
@ -423,4 +425,4 @@ logging:
timestamp_format: "Jan _2, 2006 15:04:05" timestamp_format: "Jan _2, 2006 15:04:05"
# Minimum severity for log messages printed to stdout/stderr. This doesn't affect the log file. # Minimum severity for log messages printed to stdout/stderr. This doesn't affect the log file.
# Options: debug, info, warn, error, fatal # Options: debug, info, warn, error, fatal
print_level: __LOG_LEVEL__ print_level: INFO

View file

@ -1,18 +1,18 @@
[Unit] [Unit]
Description=Matrix-Whatsapp Bridge Description=Matrix Whatsapp Bridge
After=matrix-synapse.service After=matrix-synapse.service
[Service] [Service]
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=/opt/yunohost/__APP__ WorkingDirectory=__FINALPATH__/
ExecStart=/opt/yunohost/__APP__/mautrix-whatsapp -c=/opt/yunohost/__APP__/config.yaml >> /var/log/__APP__/__APP__.log 2>&1 ExecStart=__FINALPATH__/mautrix-whatsapp -c=__FINALPATH__/config.yaml >> /var/log/__APP__/__APP__.log 2>&1
Restart=always Restart=always
RestartSec=3 RestartSec=3
# Optional hardening to improve security # Optional hardening to improve security
ReadWritePaths=/opt/yunohost/__APP__ ReadWritePaths=__FINALPATH__/
NoNewPrivileges=yes NoNewPrivileges=yes
MemoryDenyWriteExecute=true MemoryDenyWriteExecute=true
PrivateDevices=yes PrivateDevices=yes

View file

@ -1,11 +1,11 @@
### 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 * 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. ** ** 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) * First your matrix user or server has to be authorized in the bridge configuration (see below)
* Then, invite the bot (default @whatsappbot:yoursynapse.domain) * Then, invite the bot (default @whatsappbot:yoursynapse.domain)
* The room with the Mautrix-WhatsApp bot is called "administration room". * The room with the Mautrix-WhatsApp bot is called "administration room".
@ -14,7 +14,7 @@
* Send ``help`` to the bot in the created room to know how to control the bot. * 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) 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. 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** 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) 1. Invite the bridge bot to the room (with an authorized user)
@ -23,7 +23,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. 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. 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 <v0.2.0, the relaybot system changed. There is no relaybot administration room anymore. Relay must be re-activated in all rooms**. **When upgrading from <v0.2.0, the relaybot system changed. There is no relaybot administration room anymore. Relay must be re-activated in all rooms**.
To be able to bridge not only your logged in Matrix account but also Matrix friends you invite to a portal room, you need to: To be able to bridge not only your logged in Matrix account but also Matrix friends you invite to a portal room, you need to:
@ -35,14 +35,16 @@ To be able to bridge not only your logged in Matrix account but also Matrix frie
* On the matrix side: the bridge will create matrix puppets corresponding to the WhatsApp users when they send a message. * On the matrix side: the bridge will create matrix puppets corresponding to the WhatsApp users when they send a message.
See also [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html) See also [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html)
### Configuration of the bridge ## Configuration of the bridge
The bridge is [roughly configured at installation](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the The bridge is [roughly configured at installation](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the
following configuration file with SSH: following configuration file with SSH:
```/opt/yunohost/mautrix_whatsapp/config.yaml``` ```/opt/yunohost/mautrix_whatsapp/config.yaml```
and then restarting the mautrix_whatsapp service. and then restarting the mautrix_whatsapp service.
### Multi-users support ## YunoHost specific features
#### Multi-user support
* Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot. * Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot.
* The WhatsApp bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private). * The WhatsApp bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private).
@ -50,7 +52,7 @@ and then restarting the mautrix_whatsapp service.
* If several bot users are in a same WhatsApp group, only one Matrix room will be created by the bridge. * If several bot users are in a same WhatsApp group, only one Matrix room will be created by the bridge.
* See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support * See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
### Multi-instance support #### Multi-instance support
* Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several WhatsApp accounts. * Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several WhatsApp accounts.
* Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances. * Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances.
@ -59,7 +61,7 @@ and then restarting the mautrix_whatsapp service.
ARM, ARM64, AMD64 ARM, ARM64, AMD64
### Limitations ## Limitations
* Audio/Video calls are not bridged yet. * Audio/Video calls are not bridged yet.
* If WhatsApp loses connection, e.g. the phone is set in flight mode or push notifications are deactivated, the bot has sometimes to be restarted manually by sending a reconnnect message in the matrix administration room. * If WhatsApp loses connection, e.g. the phone is set in flight mode or push notifications are deactivated, the bot has sometimes to be restarted manually by sending a reconnnect message in the matrix administration room.

View file

@ -1,11 +1,11 @@
### Liste de passerelles publiques ## Liste de passerelles publiques
* Demandez sur un des salons suivants: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net * 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. ** ** 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) * 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. * 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". * Ce nouveau salon d'administration du Robot Mautrix-WhatsApp est appelé "Administration Room".

View file

@ -1,15 +1,16 @@
{ {
"name": "Matrix WhatsApp bridge", "name": "Matrix-WhatsApp bridge",
"id": "mautrix_whatsapp", "id": "mautrix_whatsapp",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Matrix / Synapse puppeting bridge for WhatsApp", "en": "Matrix / Synapse puppeting bridge for WhatsApp",
"fr": "Passerelle Matrix / Synapse pour WhatsApp" "fr": "Passerelle Matrix / Synapse pour WhatsApp"
}, },
"version": "0.6.0~ynh3", "version": "0.7.0~ynh2",
"url": "https://github.com/mautrix/whatsapp", "url": "https://github.com/mautrix/whatsapp",
"upstream": { "upstream": {
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"website": "https://maunium.net/go/mautrix-whatsapp/",
"admindoc": "https://docs.mau.fi/bridges/go/whatsapp/index.html", "admindoc": "https://docs.mau.fi/bridges/go/whatsapp/index.html",
"code": "https://github.com/mautrix/whatsapp" "code": "https://github.com/mautrix/whatsapp"
}, },

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app (must be on a single line)
pkg_dependencies="g++ postgresql ffmpeg" pkg_dependencies="g++ postgresql ffmpeg"
#================================================= #=================================================

View file

@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -24,7 +23,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..." ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -48,7 +47,7 @@ ynh_backup --src_path="$final_path"
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_backup --src_path="/var/log/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD

View file

@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -25,16 +24,20 @@ ynh_abort_if_errors
#================================================= #=================================================
appserviceid=$YNH_APP_INSTANCE_NAME appserviceid=$YNH_APP_INSTANCE_NAME
synapsenumber=$YNH_APP_ARG_SYNAPSENUMBER
botname=$YNH_APP_ARG_BOTNAME botname=$YNH_APP_ARG_BOTNAME
bot_synapse_adm=$YNH_APP_ARG_BOT_SYNAPSE_ADM bot_synapse_adm=$YNH_APP_ARG_BOT_SYNAPSE_ADM
encryption=$YNH_APP_ARG_ENCRYPTION encryption=$YNH_APP_ARG_ENCRYPTION
botadmin=$YNH_APP_ARG_BOTADMIN botadmin=$YNH_APP_ARG_BOTADMIN
botusers=$YNH_APP_ARG_BOTUSERS botusers=$YNH_APP_ARG_BOTUSERS
app=$YNH_APP_INSTANCE_NAME
if [ "$botusers" == "admin" ] if [ "$botusers" == "admin" ]
then then
botusers=$botadmin botusers=$botadmin
fi fi
synapsenumber=$YNH_APP_ARG_SYNAPSENUMBER
# ToDo check (in manifest?) if the selected synapse instance is not already connected to a mautrix_whatsapp bridge # ToDo check (in manifest?) if the selected synapse instance is not already connected to a mautrix_whatsapp bridge
if [ $synapsenumber -eq "1" ] if [ $synapsenumber -eq "1" ]
then then
@ -44,10 +47,7 @@ else
fi fi
server_name=$(ynh_app_setting_get --app $synapse_instance --key server_name) server_name=$(ynh_app_setting_get --app $synapse_instance --key server_name)
domain=$(ynh_app_setting_get --app $synapse_instance --key domain) domain=$(ynh_app_setting_get --app $synapse_instance --key domain)
synapse_db_name="matrix_$synapse_instance"
mautrix_version=$(ynh_app_upstream_version)
architecture=$YNH_ARCH
app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -56,35 +56,21 @@ ynh_script_progression --message="Validating installation parameters..." --weigh
final_path=/opt/yunohost/$app final_path=/opt/yunohost/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder" test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#=================================================
# SET CONSTANTS
#=================================================
enable_relaybot="true"
# Options: debug, info, warn, error, fatal
log_level="error"
#log_format="$app.log"
synapse_db_name="matrix_$synapse_instance"
bot_synapse_db_user="@$botname:$server_name"
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=7
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=server_name --value=$server_name
ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid
ynh_app_setting_set --app=$app --key=botname --value=$botname ynh_app_setting_set --app=$app --key=botname --value=$botname
ynh_app_setting_set --app=$app --key=synapse_instance --value=$synapse_instance
ynh_app_setting_set --app=$app --key=bot_synapse_adm --value=$bot_synapse_adm ynh_app_setting_set --app=$app --key=bot_synapse_adm --value=$bot_synapse_adm
ynh_app_setting_set --app=$app --key=encryption --value=$encryption ynh_app_setting_set --app=$app --key=encryption --value=$encryption
ynh_app_setting_set --app=$app --key=botusers --value=$botusers
ynh_app_setting_set --app=$app --key=botadmin --value=$botadmin ynh_app_setting_set --app=$app --key=botadmin --value=$botadmin
ynh_app_setting_set --app=$app --key=mautrix_version --value=$mautrix_version ynh_app_setting_set --app=$app --key=botusers --value=$botusers
ynh_app_setting_set --app=$app --key=synapse_instance --value=$synapse_instance
ynh_app_setting_set --app=$app --key=server_name --value=$server_name
ynh_app_setting_set --app=$app --key=domain --value=$domain
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -100,7 +86,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=10 ynh_script_progression --message="Installing dependencies..." --weight=97
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
@ -109,9 +95,8 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --weight=1 ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user and set home dir to /opt/yunohost/$app so systemd hardening works # Create a system user
# See more: https://docs.mau.fi/bridges/go/setup.html?bridge=whatsapp#systemd-service ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app
#================================================= #=================================================
# CREATE A POSTGRESQL DATABASE # CREATE A POSTGRESQL DATABASE
@ -119,31 +104,48 @@ ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=3 ynh_script_progression --message="Creating a PostgreSQL database..." --weight=3
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
db_pwd=$(ynh_string_random --length=30)
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=5 ynh_script_progression --message="Setting up source files..." --weight=5
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH
chmod 750 "$final_path" chmod 750 "$final_path"
chown $app:$app "$final_path" chmod -R 750 "$final_path"
chown -R $app:$app "$final_path"
#=================================================
# SPECIFIC SETUP
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring Mautrix Bridge..." --weight=2 ynh_script_progression --message="Adding a configuration file..." --weight=2
ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml" ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml"
chmod -R 750 "$final_path"
chmod 400 "$final_path/config.yaml"
chown $app:$app "$final_path/config.yaml"
#=================================================
# REGISTER SYNAPSE APP-SERVICE
#=================================================
ynh_script_progression --message="Registering Synapse app-service" --weight=1
$final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die --message="Synapse can't restart with the appservice configuration"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
ynh_store_file_checksum --file="$final_path/config.yaml"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -153,24 +155,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=5
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# REGISTER SYNAPSE APP-SERVICE
#=================================================
$final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
chown -R $app:$app "$final_path"
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh \
|| ynh_die "Synapse can't restart with the appservice configuration"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
ynh_store_file_checksum --file="$final_path/config.yaml"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -189,7 +173,7 @@ chown -R $app:$app /var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "$app daemon for bridging Whatsapp and Matrix messages" --log "/var/log/$app/$app.log" yunohost service add $app --description="$app daemon for bridging Whatsapp and Matrix messages" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE

View file

@ -16,33 +16,26 @@ ynh_script_progression --message="Loading installation settings..." --weight=5
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid) appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
botname=$(ynh_app_setting_get --app=$app --key=botname) botname=$(ynh_app_setting_get --app=$app --key=botname)
botadmin=$(ynh_app_setting_get --app=$app --key=botadmin) synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
port=$(ynh_app_setting_get --app=$app --key=port) server_name=$(ynh_app_setting_get --app=$app --key=server_name)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# SET CONSTANTS
#=================================================
synapse_db_name="matrix_$synapse_instance" synapse_db_name="matrix_$synapse_instance"
bot_synapse_db_user="@""$botname"":""$server_name" bot_synapse_db_user="@""$botname"":""$server_name"
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE SERVICE FROM ADMIN PANEL # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# Remove a service from the admin panel, added by `yunohost service add` # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service..." --weight=3 ynh_script_progression --message="Removing $app service integration..." --weight=3
yunohost service remove $app yunohost service remove $app
fi fi
@ -54,13 +47,21 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#================================================= #=================================================
# REMOVE THE POSTGRESQL DATABASE # REMOVE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=4 ynh_script_progression --message="Removing the PostgreSQL database..." --weight=4
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_psql_remove_db --db_user=$db_name --db_name=$db_name ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$app"";" ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$app"";"
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$bot_synapse_db_user"";" ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$bot_synapse_db_user"";"
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$botname"";" ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$botname"";"
@ -69,6 +70,14 @@ ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$bot_syn
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$botname"";" ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$botname"";"
#yunohost app action run $synapse_instance drop_user -a username=$botname #yunohost app action run $synapse_instance drop_user -a username=$botname
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..." --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -77,32 +86,16 @@ ynh_script_progression --message="Removing dependencies..." --weight=8
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..." --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================
ynh_script_progression --message="Removing synapse app service..." --weight=6 # REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..." --weight=6
# Remove a directory securely # Remove a directory securely
ynh_secure_remove --file="/etc/matrix-$synapse_instance/app-service/$app.yaml" ynh_secure_remove --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die --message="Synapse can't restart with the appservice configuration"
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh \
|| ynh_die "Synapse can't restart with the appservice configuration"
# Remove the log files # Remove the log files
ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/var/log/$app"

View file

@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
#### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -24,11 +23,13 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --weight=5 ynh_script_progression --message="Loading installation settings..." --weight=5
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
server_name=$(ynh_app_setting_get --app=$app --key=server_name) server_name=$(ynh_app_setting_get --app=$app --key=server_name)
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid) appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
@ -40,16 +41,6 @@ botusers=$(ynh_app_setting_get --app=$app --key=botusers)
botadmin=$(ynh_app_setting_get --app=$app --key=botadmin) botadmin=$(ynh_app_setting_get --app=$app --key=botadmin)
previous_mautrix_version=$(ynh_app_setting_get --app=$app --key=mautrix_version) previous_mautrix_version=$(ynh_app_setting_get --app=$app --key=mautrix_version)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
mautrix_version=$(ynh_app_upstream_version)
#=================================================
# SET CONSTANTS
#=================================================
synapse_db_name="matrix_$synapse_instance" synapse_db_name="matrix_$synapse_instance"
bot_synapse_db_user="@$botname:$server_name" bot_synapse_db_user="@$botname:$server_name"
@ -58,7 +49,8 @@ bot_synapse_db_user="@$botname:$server_name"
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1 ynh_script_progression --message="Validating restoration parameters..." --weight=1
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
@ -67,9 +59,8 @@ test ! -d $final_path || ynh_die --message="There is already a directory: $final
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create a dedicated user (if not existing) and set home dir to /opt/yunohost/$app so systemd hardening works # Create the dedicated user (if not existing)
# See more: https://docs.mau.fi/bridges/go/setup.html?bridge=whatsapp#systemd-service ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -78,21 +69,18 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
#=================================================
# RESTORE USER RIGHTS
#=================================================
# Restore permissions on app files
chmod 750 "$final_path" chmod 750 "$final_path"
chown $app:$app "$final_path"
chmod -R 750 "$final_path" chmod -R 750 "$final_path"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=100 ynh_script_progression --message="Reinstalling dependencies..." --weight=100
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
@ -101,18 +89,17 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=8 ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=8
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REGISTER SYNAPSE APP-SERVICE # REGISTER SYNAPSE APP-SERVICE
#================================================= #=================================================
ynh_script_progression --message="Registering Synapse app-service" --weight=1
$final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml $final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh \ /opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die "Synapse can't restart with the appservice configuration"
|| ynh_die "Synapse can't restart with the appservice configuration"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -125,24 +112,23 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_use_logrotate --logfile "/var/log/$app/$app.log" --nonappend --specific_user $app/$app ynh_restore_file --origin_path="/etc/logrotate.d/$app"
chmod -R 600 "/var/log/$app"
chmod 700 "/var/log/$app"
chown -R $app:$app /var/log/$app
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "$app daemon for bridging Whatsapp and Matrix messages" --log "/var/log/$app/$app.log" yunohost service add $app --description="$app daemon for bridging Whatsapp and Matrix messages" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=30 ynh_script_progression --message="Starting a systemd service..." --weight=30
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
# Wait until the synapse user is created # Wait until the synapse user is created
sleep 30 sleep 30

View file

@ -16,42 +16,52 @@ ynh_script_progression --message="Loading installation settings..." --weight=5
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
port=$(ynh_app_setting_get --app=$app --key=port)
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid) appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
botname=$(ynh_app_setting_get --app=$app --key=botname) botname=$(ynh_app_setting_get --app=$app --key=botname)
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
encryption=$(ynh_app_setting_get --app=$app --key=encryption) encryption=$(ynh_app_setting_get --app=$app --key=encryption)
botusers=$(ynh_app_setting_get --app=$app --key=botusers)
botadmin=$(ynh_app_setting_get --app=$app --key=botadmin) botadmin=$(ynh_app_setting_get --app=$app --key=botadmin)
botusers=$(ynh_app_setting_get --app=$app --key=botusers)
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
previous_mautrix_version=$(ynh_app_setting_get --app=$app --key=mautrix_version) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
#db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) port=$(ynh_app_setting_get --app=$app --key=port)
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
mautrix_version=$(ynh_app_upstream_version) server_name=$(ynh_app_setting_get --app=$app --key=server_name)
architecture=$YNH_ARCH
#=================================================
# SET CONSTANTS
#=================================================
enable_relaybot="true"
# Options: debug, info, warn, error, fatal
log_level="error"
#log_format="$app.log"
synapse_db_name="matrix_$synapse_instance" synapse_db_name="matrix_$synapse_instance"
bot_synapse_db_user="@$botname:$server_name" bot_synapse_db_user="@$botname:$server_name"
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..." --weight=1
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -108,36 +118,6 @@ fi
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path # ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#fi #fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=100
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -146,9 +126,9 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing) and set home dir to /opt/yunohost/$app so systemd hardening works # Create a dedicated user (if not existing) and set home dir to /opt/yunohost/$app so systemd hardening works
# See more: https://docs.mau.fi/bridges/go/setup.html?bridge=whatsapp#systemd-service # See more: https://docs.mau.fi/bridges/go/setup.html?bridge=whatsapp#systemd-service
if ynh_system_user_exists -u "$app"; then if ynh_system_user_exists -u "$app"; then
usermod --home /opt/yunohost/$app $app usermod --home "$final_path" $app
else else
ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app ynh_system_user_create --username=$app --home_dir="$final_path"
fi fi
#================================================= #=================================================
@ -160,29 +140,45 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=2 ynh_script_progression --message="Upgrading source files..." --weight=2
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH
chmod 750 $final_path
chown $app:$app $final_path
fi fi
#================================================= chmod 750 "$final_path"
# STORE THE CONFIG FILE CHECKSUM
#=================================================
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
ynh_backup_if_checksum_is_different --file="$final_path/config.yaml"
ynh_backup_if_checksum_is_different --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
#=================================================
# UPDATE CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring Mautrix Bridge..." --weight=2
ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml"
chmod -R 750 "$final_path" chmod -R 750 "$final_path"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=100
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=2
ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml"
chmod 400 "$final_path/config.yaml"
chown $app:$app "$final_path/config.yaml"
#=================================================
# REGISTER SYNAPSE APP-SERVICE
#=================================================
ynh_script_progression --message="Registering Synapse app-service" --weight=1
$final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die "Synapse can't restart with the appservice configuration"
# Set permissions on app files
chown -R $app:$app "$final_path"
ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
ynh_store_file_checksum --file="$final_path/config.yaml"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
@ -191,23 +187,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=4
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# REGISTER SYNAPSE APP-SERVICE
#=================================================
$final_path/mautrix-whatsapp -g -c $final_path/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
#Add the path to the registration file (registration.yaml by default) to your synapse homeserver.yaml under app_service_config_files.
/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh \
|| ynh_die "Synapse can't restart with the appservice configuration"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/config.yaml"
ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -226,14 +205,14 @@ chown -R $app:$app /var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "$app daemon for bridging Whatsapp and Matrix messages" --log "/var/log/$app/$app.log" yunohost service add $app --description="$app daemon for bridging Whatsapp and Matrix messages" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
chown -R $app:$app "$final_path" # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" ynh_systemd_action --service_name=$app --action="start"
#================================================= #=================================================

View file

@ -1,2 +0,0 @@
*~
*.sw[op]

View file

@ -1,2 +0,0 @@
*~
*.sw[op]