From b099b6a614a2a392d3ebf45e331af26792dcdda5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 10 Aug 2022 08:07:04 +0000 Subject: [PATCH 01/13] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 440c74d..46265df 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) **Shipped version:** 0.6.0~ynh2 + ## Disclaimers / important information ### List of known public services diff --git a/README_fr.md b/README_fr.md index 701ddab..b1f62a5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,8 @@ 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!** -**Version incluse :** 0.6.0~ynh2 +**Version incluse :** 0.6.0~ynh2 + ## Avertissements / informations importantes ### Liste de passerelles publiques From 0c61bb5222d4a0ba8e05465816c17c37172f7514 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 17 Aug 2022 06:18:40 +0000 Subject: [PATCH 02/13] Upgrade to v0.6.1 --- conf/amd64.src | 4 ++-- conf/arm64.src | 4 ++-- conf/armhf.src | 4 ++-- manifest.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index 9078b1d..32daf01 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-amd64 -SOURCE_SUM=16fb400dfff3ee41c67c90c4c81106dd1b18d83ce120e038e72d2b0f2e0c3654 +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-amd64 +SOURCE_SUM=8a4ad96d77b02399ededef4984c3474974349b92d5483c9f4d00ae438063ea1c SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/conf/arm64.src b/conf/arm64.src index b3a546c..5315e84 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-arm64 -SOURCE_SUM=3b17adb90a1368e9598c5302c1490f717e86c7d820dbeba20d6404f242edb772 +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-arm64 +SOURCE_SUM=3e651e9c423f7f6b06a2a7190a2ba5e49dd75a263674f002250bbcf9e9aa1414 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/conf/armhf.src b/conf/armhf.src index 269d980..f8c08df 100644 --- a/conf/armhf.src +++ b/conf/armhf.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.0/mautrix-whatsapp-arm -SOURCE_SUM=04c6d4d6327048c4d504e0ca349965d1cdcc17ef742eaf6b31148afb3361e02b +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-arm +SOURCE_SUM=eab8239862960692ae48f16bc4d803a4d401e66e27ab638577ef212825b31673 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/manifest.json b/manifest.json index 8470572..6f61019 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Matrix / Synapse puppeting bridge for WhatsApp", "fr": "Passerelle Matrix / Synapse pour WhatsApp" }, - "version": "0.6.0~ynh2", + "version": "0.6.1~ynh1", "url": "https://github.com/mautrix/whatsapp", "upstream": { "license": "AGPL-3.0-or-later", From 1a559b12fcf3021e4f3d746e9dc801db5149af30 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 17 Aug 2022 06:18:45 +0000 Subject: [PATCH 03/13] Auto-update README --- README.md | 3 ++- README_fr.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 440c74d..e555149 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ 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!** -**Shipped version:** 0.6.0~ynh2 +**Shipped version:** 0.6.1~ynh1 + ## Disclaimers / important information ### List of known public services diff --git a/README_fr.md b/README_fr.md index 701ddab..8d70b0a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,8 @@ 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!** -**Version incluse :** 0.6.0~ynh2 +**Version incluse :** 0.6.1~ynh1 + ## Avertissements / informations importantes ### Liste de passerelles publiques From 488f46a7e9dbdc6a36da649f83cea76c32042fe0 Mon Sep 17 00:00:00 2001 From: Dante Date: Thu, 25 Aug 2022 11:11:05 +0100 Subject: [PATCH 04/13] Add missing upstream keys in manifest --- manifest.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifest.json b/manifest.json index 6f61019..3bdbf04 100644 --- a/manifest.json +++ b/manifest.json @@ -10,6 +10,8 @@ "url": "https://github.com/mautrix/whatsapp", "upstream": { "license": "AGPL-3.0-or-later", + "website": "https://maunium.net/go/mautrix-whatsapp/", + "demo": "", "admindoc": "https://docs.mau.fi/bridges/go/whatsapp/index.html", "code": "https://github.com/mautrix/whatsapp" }, From 5209027e1f1b3ec5eef66221db5a874ccaef0092 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 25 Aug 2022 10:11:21 +0000 Subject: [PATCH 05/13] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index e555149..b9a67c7 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ In case you need to upload your logs somewhere, be aware that they contain your ## Documentation and resources +* Official app website: * Official admin documentation: * Upstream app code repository: * YunoHost documentation for this app: diff --git a/README_fr.md b/README_fr.md index 8d70b0a..d2650e1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -101,6 +101,7 @@ Si vous devez téléverser vos fichiers log quelque-part, soyez avertis qu'ils c ## Documentations et ressources +* Site officiel de l'app : * Documentation officielle de l'admin : * Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : From 8ecb4923dfe109edbab4dc7831cebefd05f31491 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 5 Sep 2022 00:42:58 +0200 Subject: [PATCH 06/13] Apply example_ynh --- check_process | 5 + conf/config.yaml | 10 +- conf/systemd.service | 8 +- doc/DISCLAIMER.md | 20 ++-- doc/DISCLAIMER_fr.md | 6 +- manifest.json | 3 +- scripts/_common.sh | 2 +- scripts/backup | 7 +- scripts/install | 94 ++++++++---------- scripts/remove | 61 +++++------- scripts/restore | 56 ++++------- scripts/upgrade | 153 +++++++++++++---------------- sources/extra_files/app/.gitignore | 2 - sources/patches/.gitignore | 2 - 14 files changed, 184 insertions(+), 245 deletions(-) delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/check_process b/check_process index 60e492a..52bf3e3 100644 --- a/check_process +++ b/check_process @@ -17,10 +17,15 @@ setup_private=0 setup_public=0 upgrade=1 + # 0.3.0 upgrade=1 from_commit=42df5b910927283241e185dcb8a62089adeb9c85 + # 0.2.4 upgrade=1 from_commit=23cd51919e2b09865256a21214865d798bd843f6 backup_restore=1 multi_instance=1 +;;; Options +Email= +Notification=none ;;; Upgrade options ; commit=42df5b910927283241e185dcb8a62089adeb9c85 name=0.3.0 diff --git a/conf/config.yaml b/conf/config.yaml index 71b538b..d28ee26 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -1,10 +1,8 @@ -# Homeserver details. +# Homeserver details homeserver: # The address that this appservice can use to connect to the homeserver. - #address: https://example.com address: https://__DOMAIN__ # The domain of the homeserver (for MXIDs, etc). - #domain: example.com domain: __SERVER_NAME__ # Is the homeserver actually mautrix-asmux? @@ -22,12 +20,10 @@ homeserver: # Changing these values requires regeneration of the registration. appservice: # The address that the homeserver can use to connect to this appservice. - #address: http://localhost:29318 address: http://localhost:__PORT__ # The hostname and port where this appservice should listen. hostname: 0.0.0.0 - #port: 29318 port: __PORT__ # Database config. @@ -392,7 +388,7 @@ bridge: # 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. #enabled: false - enabled: __ENABLE_RELAYBOT__ + enabled: true # Should only admins be allowed to set themselves as relay users? admin_only: true # The formats to use when sending messages to WhatsApp via the relaybot. @@ -423,4 +419,4 @@ logging: timestamp_format: "Jan _2, 2006 15:04:05" # Minimum severity for log messages printed to stdout/stderr. This doesn't affect the log file. # Options: debug, info, warn, error, fatal - print_level: __LOG_LEVEL__ + print_level: INFO diff --git a/conf/systemd.service b/conf/systemd.service index 90371cb..c16a18b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,18 +1,18 @@ [Unit] -Description=Matrix-Whatsapp Bridge +Description=Matrix Whatsapp Bridge After=matrix-synapse.service [Service] Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=/opt/yunohost/__APP__ -ExecStart=/opt/yunohost/__APP__/mautrix-whatsapp -c=/opt/yunohost/__APP__/config.yaml >> /var/log/__APP__/__APP__.log 2>&1 +WorkingDirectory=__FINALPATH__/ +ExecStart=__FINALPATH__/mautrix-whatsapp -c=__FINALPATH__/config.yaml >> /var/log/__APP__/__APP__.log 2>&1 Restart=always RestartSec=3 # Optional hardening to improve security -ReadWritePaths=/opt/yunohost/__APP__ +ReadWritePaths=__FINALPATH__/ NoNewPrivileges=yes MemoryDenyWriteExecute=true PrivateDevices=yes diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 8e82a1b..c64e70e 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -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 -### 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". @@ -14,7 +14,7 @@ * 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) @@ -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. 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 then - ynh_script_progression --message="Removing $app service..." --weight=3 + ynh_script_progression --message="Removing $app service integration..." --weight=3 yunohost service remove $app fi @@ -53,13 +46,21 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated 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 #================================================= ynh_script_progression --message="Removing the PostgreSQL database..." --weight=4 # 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 ""$bot_synapse_db_user"";" ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$botname"";" @@ -68,6 +69,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"";" #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 #================================================= @@ -76,32 +85,16 @@ ynh_script_progression --message="Removing dependencies..." --weight=8 # Remove metapackage and its 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 #================================================= -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 ynh_secure_remove --file="/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" +/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die --message="Synapse can't restart with the appservice configuration" # Remove the log files ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index 9bea70f..fafdd27 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # 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 /usr/share/yunohost/helpers @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -24,11 +23,13 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=5 +ynh_script_progression --message="Loading installation settings..." --weight=5 app=$YNH_APP_INSTANCE_NAME 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) server_name=$(ynh_app_setting_get --app=$app --key=server_name) botname=$(ynh_app_setting_get --app=$app --key=botname) @@ -39,16 +40,6 @@ botusers=$(ynh_app_setting_get --app=$app --key=botusers) botadmin=$(ynh_app_setting_get --app=$app --key=botadmin) previous_mautrix_version=$(ynh_app_setting_get --app=$app --key=mautrix_version) 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" bot_synapse_db_user="@$botname:$server_name" @@ -57,7 +48,8 @@ bot_synapse_db_user="@$botname:$server_name" #================================================= 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 @@ -66,9 +58,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 -# 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 -ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR @@ -77,21 +68,18 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files chmod 750 "$final_path" -chown $app:$app "$final_path" -chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" +#================================================= +# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=100 +# Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -100,18 +88,17 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=8 ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +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 #================================================= +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" +/opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die "Synapse can't restart with the appservice configuration" #================================================= # RESTORE SYSTEMD @@ -124,24 +111,23 @@ systemctl enable $app.service --quiet #================================================= # 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 -chmod -R 600 "/var/log/$app" -chmod 700 "/var/log/$app" -chown -R $app:$app /var/log/$app +ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= 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 #================================================= 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" # Wait until the synapse user is created sleep 30 diff --git a/scripts/upgrade b/scripts/upgrade index aac2b86..ca2fb2f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,41 +16,51 @@ ynh_script_progression --message="Loading installation settings..." --weight=5 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) 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) -botusers=$(ynh_app_setting_get --app=$app --key=botusers) 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) -previous_mautrix_version=$(ynh_app_setting_get --app=$app --key=mautrix_version) - -#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) -architecture=$YNH_ARCH - -#================================================= -# SET CONSTANTS -#================================================= - -enable_relaybot="true" -# Options: debug, info, warn, error, fatal -log_level="error" -#log_format="$app.log" - +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +port=$(ynh_app_setting_get --app=$app --key=port) +synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance) +server_name=$(ynh_app_setting_get --app=$app --key=server_name) synapse_db_name="matrix_$synapse_instance" bot_synapse_db_user="@$botname:$server_name" #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." --weight=1 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 #================================================= @@ -99,36 +109,6 @@ fi # ynh_app_setting_set --app=$app --key=final_path --value=$final_path #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 #================================================= @@ -137,9 +117,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 # See more: https://docs.mau.fi/bridges/go/setup.html?bridge=whatsapp#systemd-service if ynh_system_user_exists -u "$app"; then - usermod --home /opt/yunohost/$app $app + usermod --home "$final_path" $app else - ynh_system_user_create --username=$app --home_dir=/opt/yunohost/$app + ynh_system_user_create --username=$app --home_dir="$final_path" fi #================================================= @@ -151,28 +131,44 @@ then ynh_script_progression --message="Upgrading source files..." --weight=2 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id=$architecture - chmod 750 $final_path - chown $app:$app $final_path + ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH fi -#================================================= -# 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" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:$app "$final_path" #================================================= -# UPDATE CONFIGURATION +# UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Configuring Mautrix Bridge..." --weight=2 +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 -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 "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 @@ -182,23 +178,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=4 # Create a dedicated 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 #================================================= @@ -217,14 +196,14 @@ chown -R $app:$app /var/log/$app #================================================= 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 #================================================= 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" #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] From e6e6ee65c33e43fb59fca3d557d49e551138f6b7 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 4 Sep 2022 22:43:04 +0000 Subject: [PATCH 07/13] Auto-update README --- README.md | 26 ++++++++++++++------------ README_fr.md | 12 ++++++------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b9a67c7..dfb6fe6 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app 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) -[![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)* -> *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.* ## Overview @@ -28,14 +28,14 @@ Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) ## 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 -### 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". @@ -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. 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) @@ -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. 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 -# 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) -[![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)* -> *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.* ## Vue d'ensemble @@ -28,14 +28,14 @@ C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_y ## 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 -### 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". From 015a0b9fc34852b4e6c5fba7e04eccc680e0ee09 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 5 Sep 2022 04:05:20 +0200 Subject: [PATCH 08/13] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 52bf3e3..8e8ca52 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; Default test serie ; pre-install 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 synapsenumber="1" whatsappbot="whatsappbot" From 0b287e0cab9f438bee54f7ea571800cb6c675dc6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 5 Sep 2022 20:12:39 +0200 Subject: [PATCH 09/13] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9e1b134..ac34d47 100755 --- a/scripts/install +++ b/scripts/install @@ -139,7 +139,7 @@ chown $app:$app "$final_path/config.yaml" 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" +/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" ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml" From 8ae1043b584bb8642f8d2b2800c794960158de80 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 5 Sep 2022 21:07:58 +0200 Subject: [PATCH 10/13] Fix permissions --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index ac34d47..e3cadc0 100755 --- a/scripts/install +++ b/scripts/install @@ -118,7 +118,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH chmod 750 "$final_path" -chmod -R o-rwx "$final_path" +chmod -R 750 "$final_path" chown -R $app:$app "$final_path" #================================================= diff --git a/scripts/restore b/scripts/restore index fafdd27..f492440 100755 --- a/scripts/restore +++ b/scripts/restore @@ -69,7 +69,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" -chmod -R o-rwx "$final_path" +chmod -R 750 "$final_path" chown -R $app:$app "$final_path" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ca2fb2f..129c270 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,7 +135,7 @@ then fi chmod 750 "$final_path" -chmod -R o-rwx "$final_path" +chmod -R 750 "$final_path" chown -R $app:$app "$final_path" #================================================= From c30332ec43f8c114401177890910f4dd1c7014dc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 17 Sep 2022 06:19:04 +0000 Subject: [PATCH 11/13] Upgrade to v0.7.0 --- conf/amd64.src | 4 ++-- conf/arm64.src | 4 ++-- conf/armhf.src | 4 ++-- manifest.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index 32daf01..8b57e20 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-amd64 -SOURCE_SUM=8a4ad96d77b02399ededef4984c3474974349b92d5483c9f4d00ae438063ea1c +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-amd64 +SOURCE_SUM=13b43350e3beabcccd5cce51d3562c0eed703b4075674143d13921fa3f9e6400 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/conf/arm64.src b/conf/arm64.src index 5315e84..4119861 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-arm64 -SOURCE_SUM=3e651e9c423f7f6b06a2a7190a2ba5e49dd75a263674f002250bbcf9e9aa1414 +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-arm64 +SOURCE_SUM=90157e29087320de779a285c308e9aca1a0f052a9e84c4d071e2fbdb3a2c6e31 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/conf/armhf.src b/conf/armhf.src index f8c08df..d54422d 100644 --- a/conf/armhf.src +++ b/conf/armhf.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.6.1/mautrix-whatsapp-arm -SOURCE_SUM=eab8239862960692ae48f16bc4d803a4d401e66e27ab638577ef212825b31673 +SOURCE_URL=https://github.com/mautrix/whatsapp/releases/download/v0.7.0/mautrix-whatsapp-arm +SOURCE_SUM=54c0c20d5c6a2997d99cdeb469eebf786ce0593f95582e98da318e178ab364ef SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mautrix-whatsapp diff --git a/manifest.json b/manifest.json index 3bdbf04..1806200 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Matrix / Synapse puppeting bridge for WhatsApp", "fr": "Passerelle Matrix / Synapse pour WhatsApp" }, - "version": "0.6.1~ynh1", + "version": "0.7.0~ynh1", "url": "https://github.com/mautrix/whatsapp", "upstream": { "license": "AGPL-3.0-or-later", From 65d4a3742bf64d7b859ad904159c65f704714aff Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 17 Sep 2022 06:19:11 +0000 Subject: [PATCH 12/13] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9a67c7..cf3388b 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ 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!** -**Shipped version:** 0.6.1~ynh1 +**Shipped version:** 0.7.0~ynh1 ## Disclaimers / important information diff --git a/README_fr.md b/README_fr.md index d2650e1..3ecd9bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,7 @@ 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!** -**Version incluse :** 0.6.1~ynh1 +**Version incluse :** 0.7.0~ynh1 ## Avertissements / informations importantes From 12a24947d0b88e7561d8f8892791ba0d30506a44 Mon Sep 17 00:00:00 2001 From: Dante Date: Sat, 24 Sep 2022 10:27:48 +0100 Subject: [PATCH 13/13] Add new config options from v0.7.0 --- conf/config.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index d28ee26..03b1f0c 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -5,8 +5,9 @@ homeserver: # The domain of the homeserver (for MXIDs, etc). domain: __SERVER_NAME__ - # Is the homeserver actually mautrix-asmux? - asmux: false + # What software is the homeserver running? + # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. + software: standard # 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. # The bridge will use the appservice as_token to authorize requests. @@ -60,7 +61,7 @@ appservice: # Whether or not to receive ephemeral events via appservice transactions. # Requires MSC2409 support (i.e. Synapse 1.22+). # 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. as_token: "This value is generated when generating the registration" @@ -195,7 +196,7 @@ bridge: # Should Matrix users leaving groups be bridged to WhatsApp? bridge_matrix_leave: true # 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. # Note that updating the m.direct event is not atomic (except with mautrix-asmux) # and is therefore prone to race conditions. @@ -276,6 +277,9 @@ bridge: # Should the bridge never send alerts to the bridge management room? # These are mostly things like the user being logged out. 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, # 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. @@ -319,6 +323,8 @@ bridge: # 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. 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: false # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.