diff --git a/README.md b/README.md index ca6a0d8..6d9abd6 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/python/ * see https://docs.mau.fi/bridges/python/telegram/relay-bot.html -**Shipped version:** 0.11.3~ynh2 +**Shipped version:** 0.12.0~ynh1 ## Disclaimers / important information diff --git a/README_fr.md b/README_fr.md index 19decaf..4ebb8ce 100644 --- a/README_fr.md +++ b/README_fr.md @@ -50,7 +50,7 @@ See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/python/ * see https://docs.mau.fi/bridges/python/telegram/relay-bot.html -**Version incluse :** 0.11.3~ynh2 +**Version incluse :** 0.12.0~ynh1 ## Avertissements / informations importantes diff --git a/conf/app.src b/conf/app.src index beb5781..2b46828 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mautrix/telegram/archive/refs/tags/v0.11.3.tar.gz -SOURCE_SUM=5ce51e8265316e1ac706c7f70c446d28b9728cb26e63b6afc48412d12ccd9a97 +SOURCE_URL=https://github.com/mautrix/telegram/archive/refs/tags/v0.12.0.tar.gz +SOURCE_SUM=bcc971d638a985d5196c1986f8f332b0f8236b6f34da712bec8662ab38523434 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.yaml b/conf/config.yaml index d8af4c6..65ce02c 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -146,6 +146,10 @@ bridge: # will not send any more members. # -1 means no limit (which means it's limited to 10000 by the server) max_initial_member_sync: 100 + # Maximum number of participants in chats to bridge. Only applies when the portal is being created. + # If there are more members when trying to create a room, the room creation will be cancelled. + # -1 means no limit (which means all chats can be bridged) + max_member_count: -1 # Whether or not to sync the member list in channels. # If no channel admins have logged into the bridge, the bridge won't be able to sync the member # list regardless of this setting. @@ -172,10 +176,6 @@ bridge: # Allow logging in within Matrix. If false, users can only log in using login-qr or the # out-of-Matrix login website (see appservice.public config section) allow_matrix_login: true - # Whether or not to bridge plaintext highlights. - # Only enable this if your displayname_template has some static part that the bridge can use to - # reliably identify what is a plaintext highlight. - plaintext_highlights: false # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix. public_portals: true # Whether or not to use /sync to get presence, read receipts and typing notifications @@ -204,13 +204,13 @@ bridge: # Whether or not the !tg join command should do a HTTP request # to resolve redirects in invite links. invite_link_resolve: false - # Use inline images instead of a separate message for the caption. - # N.B. Inline images are not supported on all clients (e.g. Element iOS/Android). - inline_images: false + # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552. + # This is currently not supported in most clients. + caption_in_message: false # Maximum size of image in megabytes before sending to Telegram as a document. image_as_file_size: 10 - # Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 1280x1280 = 1638400. - image_as_file_pixels: 1638400 + # Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 4096x4096 = 16777216. + image_as_file_pixels: 16777216 # Enable experimental parallel file transfer, which makes uploads/downloads much faster by # streaming from/to Matrix and using many connections for Telegram. # Note that generating HQ thumbnails for videos is not possible with streamed transfers. @@ -226,12 +226,24 @@ bridge: # png - converts to non-animated png (fastest), # gif - converts to animated gif # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support + # webp - converts to animated webp, requires ffmpeg executable with webp codec/container support target: gif + # Should video stickers be converted to the specified format as well? + convert_from_webm: false # Arguments for converter. All converters take width and height. args: width: 256 height: 256 - fps: 25 # only for webm and gif (2, 5, 10, 20 or 25 recommended) + fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended) + # Settings for converting animated emoji. + # Same as animated_sticker, but webm is not supported as the target + # (because inline images can only contain images, not videos). + animated_emoji: + target: webp + args: + width: 64 + height: 64 + fps: 25 # End-to-bridge encryption support options. # # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. @@ -241,20 +253,46 @@ bridge: # Default to encryption, force-enable encryption in all portals the bridge creates # This will cause the bridge bot to be in private chats for the encryption to work properly. default: __IS_ENCRYPTION_ENABLED__ - # Database for the encryption data. If set to `default`, will use the appservice database. - database: default - # Options for automatic key sharing. - key_sharing: - # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. - # You must use a client that supports requesting keys from other users to use this feature. - allow: false - # Require the requesting device to have a valid cross-signing signature? - # This doesn't require that the bridge has verified the device, only that the user has verified it. - # Not yet implemented. - require_cross_signing: false - # Require devices to be verified by the bridge? - # Verification by the bridge is not yet implemented. - require_verification: true + # Require encryption, drop any unencrypted messages. + require: __IS_ENCRYPTION_ENABLED__ + # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. + # You must use a client that supports requesting keys from other users to use this feature. + allow_key_sharing: false + # What level of device verification should be required from users? + # + # Valid levels: + # unverified - Send keys to all device in the room. + # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. + # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). + # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. + # Note that creating user signatures from the bridge bot is not currently possible. + # verified - Require manual per-device verification + # (currently only possible by modifying the `trust` column in the `crypto_device` database table). + verification_levels: + # Minimum level for which the bridge should send keys to when bridging messages from Telegram to Matrix. + receive: unverified + # Minimum level that the bridge should accept for incoming Matrix messages. + send: unverified + # Minimum level that the bridge should require for accepting key requests. + share: cross-signed-tofu + # Options for Megolm room key rotation. These options allow you to + # configure the m.room.encryption event content. See: + # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for + # more information about that event. + rotation: + # Enable custom Megolm room key rotation settings. Note that these + # settings will only apply to rooms created after this option is + # set. + enable_custom: false + # The maximum number of milliseconds a session should be used + # before changing it. The Matrix spec recommends 604800000 (a week) + # as the default. + milliseconds: 604800000 + # The maximum number of messages that should be sent with a given a + # session before changing it. The Matrix spec recommends 100 as the + # default. + messages: 100 + # Whether or not to explicitly set the avatar and room name for private # chat portal rooms. This will be implicitly enabled if encryption.default is true. private_chat_portal_meta: false @@ -263,6 +301,8 @@ bridge: delivery_receipts: false # Whether or not delivery errors should be reported as messages in the Matrix room. delivery_error_reports: false + # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. + message_status_events: false # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. # This field will automatically be changed back to false after it, # except if the config file is not writable. @@ -282,6 +322,9 @@ bridge: kick_on_logout: true # Should the "* user joined Telegram" notice always be marked as read automatically? always_read_joined_telegram_notice: true + # Should the bridge auto-create a group chat on Telegram when a ghost is invited to a room? + # Requires the user to have sufficient power level and double puppeting enabled. + create_group_on_invite: true # Settings for backfilling messages from Telegram. backfill: # Whether or not the Telegram ghosts of logged in Matrix users should be @@ -325,8 +368,7 @@ bridge: # List of user IDs for whom the previous flag is flipped. # e.g. if bridge_notices.default is false, notices from other users will not be bridged, but # notices from users listed here will be bridged. - exceptions: - - "@importantbot:example.com" + exceptions: [] # An array of possible values for the $distinguisher variable in message formats. # Each user gets one of the values here, based on a hash of their user ID. @@ -451,6 +493,12 @@ telegram: # (Optional) Create your own bot at https://t.me/BotFather bot_token: __BOTTOKEN__ + # Should the bridge request missed updates from Telegram when restarting? + catch_up: true + # Should incoming updates be handled sequentially to make sure order is preserved on Matrix? + sequential_updates: true + exit_on_update_error: false + # Telethon connection options. connection: # The timeout in seconds to be used when connecting. @@ -476,7 +524,7 @@ telegram: # Device info sent to Telegram. device_info: # "auto" = OS name+version. - device_model: auto + device_model: mautrix-telegram # "auto" = Telethon version. system_version: auto # "auto" = mautrix-telegram version. diff --git a/manifest.json b/manifest.json index b70bde8..bfd0ce5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Telegram puppeting bridge for Matrix/Synapse", "fr": "Passerelle Telegram pour Matrix/Synapse" }, - "version": "0.11.3~ynh2", + "version": "0.12.0~ynh1", "url": "https://docs.mau.fi/bridges/python/telegram/index.html", "upstream": { "license": "AGPL-3.0-or-later", @@ -24,8 +24,7 @@ "yunohost": ">= 11.0.0" }, "multi_instance": true, - "services": [ - ], + "services": [], "arguments": { "install": [ { diff --git a/scripts/_common.sh b/scripts/_common.sh index 8296088..b04153f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,9 +5,8 @@ #================================================= # dependencies used by the app -# HACK zlib1g-dev libjpeg-dev (libwebp-dev optional but necessary for stickers) are necessary to compile / install pillow -pkg_dependencies="postgresql python3 zlib1g-dev libjpeg-dev libwebp-dev python3-venv libpq-dev libffi-dev" -pkg_dependencies_e2be="libolm-dev" +# HACK zlib1g-dev libjpeg-dev (libwebp-dev and libolm-dev optional but necessary for stickers/e2be) are necessary to compile / install pillow +pkg_dependencies="postgresql python3 zlib1g-dev libjpeg-dev libwebp-dev python3-venv libpq-dev libffi-dev libolm-dev" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 0362dc4..6458f75 100755 --- a/scripts/install +++ b/scripts/install @@ -107,11 +107,6 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=97 -if [ $encryption -eq 1 ]; then - # Install libolm-dev to be able to use encryption - ynh_install_extra_app_dependencies $pkg_dependencies_e2be -fi - ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -164,10 +159,10 @@ ynh_script_progression --message="Configuring Mautrix-Bridge..." --weight=2 mautrix_config_path="$final_path/config.yaml" as_token="\"This value is generated when generating the registration\"" hs_token="\"This value is generated when generating the registration\"" -is_encryption_enabled=$encryption +is_encryption_enabled="$encryption" if [ $encryption -eq 1 ]; then - is_encryption_enabled=true + is_encryption_enabled="true" fi write_bridge_config diff --git a/scripts/upgrade b/scripts/upgrade index 170d407..5f1888b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,11 +97,6 @@ fi #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=1 -if [ $encryption -eq 1 ]; then - # Install libolm-dev to be able to use encryption - ynh_install_extra_app_dependencies $pkg_dependencies_e2be -fi - ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -135,10 +130,10 @@ as_token=$(grep "as_token:" "$mautrix_config_path" | sed -r "s/ *as_token: *//") hs_token=$(grep "hs_token:" "$mautrix_config_path" | sed -r "s/ *hs_token: *//") # ynh_replace_string --match_string=__AS_TOKEN__ --replace_string="$as_token" --target_file="$mautrix_config_path" # ynh_replace_string --match_string=__HS_TOKEN__ --replace_string="$hs_token" --target_file="$mautrix_config_path" -is_encryption_enabled=$encryption +is_encryption_enabled="$encryption" if [ $encryption -eq 1 ]; then - is_encryption_enabled=true + is_encryption_enabled="true" fi write_bridge_config