From 5d79071f536358c86efd0d485eb88ee573686071 Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 8 Aug 2022 19:57:23 +0100 Subject: [PATCH 1/7] Add new appserviceid setting to avoid collision of botname --- conf/config.yaml | 2 +- scripts/install | 2 ++ scripts/remove | 1 + scripts/restore | 1 + scripts/upgrade | 9 +++++++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index 71b538b..2e05b11 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -50,7 +50,7 @@ appservice: # The unique ID of this appservice. #id: whatsapp - id: __BOTNAME__ + id: __APPSERVICEID__ # Appservice bot details. bot: # Username of the appservice bot. diff --git a/scripts/install b/scripts/install index a62eee3..2d85424 100755 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,7 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= +appserviceid=$YNH_APP_INSTANCE_NAME botname=$YNH_APP_ARG_BOTNAME bot_synapse_adm=$YNH_APP_ARG_BOT_SYNAPSE_ADM encryption=$YNH_APP_ARG_ENCRYPTION @@ -76,6 +77,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 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=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 diff --git a/scripts/remove b/scripts/remove index 86bceee..34484fc 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ 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) botname=$(ynh_app_setting_get --app=$app --key=botname) botadmin=$(ynh_app_setting_get --app=$app --key=botadmin) port=$(ynh_app_setting_get --app=$app --key=port) diff --git a/scripts/restore b/scripts/restore index 9bea70f..4815fa6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) server_name=$(ynh_app_setting_get --app=$app --key=server_name) +appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid) botname=$(ynh_app_setting_get --app=$app --key=botname) synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance) bot_synapse_adm=$(ynh_app_setting_get --app=$app --key=bot_synapse_adm) diff --git a/scripts/upgrade b/scripts/upgrade index aac2b86..127fa65 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ 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) 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) @@ -87,6 +88,14 @@ then ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd fi +# If appserviceid doesn't exist, create it +if [ -z "$appserviceid" ] +then + appserviceid=$app + ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid +fi + + # If db_name doesn't exist, create it #if [ -z "$mautrix_whatsapp_db_name" ]; then # mautrix_whatsapp_db_name=$(ynh_sanitize_dbid --db_name=$app) From a53d04b61baf566fbd744295f993091982a4b9eb Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 8 Aug 2022 18:57:36 +0000 Subject: [PATCH 2/7] 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 c36ede5ce356a982e3d8e4b3caef28e1b6bcbd25 Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 8 Aug 2022 20:17:54 +0100 Subject: [PATCH 3/7] Bump Yuno version --- README.md | 3 +-- README_fr.md | 3 +-- manifest.json | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 46265df..46291c2 100644 --- a/README.md +++ b/README.md @@ -24,8 +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.0~ynh2 - +**Shipped version:** 0.6.0~ynh3 ## Disclaimers / important information ### List of known public services diff --git a/README_fr.md b/README_fr.md index b1f62a5..c2d3cd4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,8 +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.0~ynh2 - +**Version incluse :** 0.6.0~ynh3 ## Avertissements / informations importantes ### Liste de passerelles publiques diff --git a/manifest.json b/manifest.json index 8470572..7f672be 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.0~ynh3", "url": "https://github.com/mautrix/whatsapp", "upstream": { "license": "AGPL-3.0-or-later", From 237095abd7b76fa303d47d7a23816c5482737940 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 8 Aug 2022 19:18:06 +0000 Subject: [PATCH 4/7] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 46291c2..e2b5c1c 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~ynh3 + ## Disclaimers / important information ### List of known public services diff --git a/README_fr.md b/README_fr.md index c2d3cd4..d1084e6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,6 +25,7 @@ C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_y **Version incluse :** 0.6.0~ynh3 + ## Avertissements / informations importantes ### Liste de passerelles publiques From c30332ec43f8c114401177890910f4dd1c7014dc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 17 Sep 2022 06:19:04 +0000 Subject: [PATCH 5/7] 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 6/7] 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 7/7] 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.