Stasiek Michalski 3b66c9
# Homeserver details
Stasiek Michalski 3b66c9
homeserver:
Stasiek Michalski 3b66c9
    # The address that this appservice can use to connect to the homeserver.
Stasiek Michalski 3b66c9
    address: https://matrix.opensuse.org
Stasiek Michalski 3b66c9
    # The domain of the homeserver (for MXIDs, etc).
Stasiek Michalski 3b66c9
    domain: opensuse.org
Stasiek Michalski 3b66c9
    # Whether or not to verify the SSL certificate of the homeserver.
Stasiek Michalski 3b66c9
    # Only applies if address starts with https://
Stasiek Michalski 3b66c9
    verify_ssl: true
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Application service host/registration related details
Stasiek Michalski 3b66c9
# Changing these values requires regeneration of the registration.
Stasiek Michalski 3b66c9
appservice:
Stasiek Michalski 3b66c9
    # The address that the homeserver can use to connect to this appservice.
Stasiek Michalski 3b66c9
    address: http://localhost:29317
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The hostname and port where this appservice should listen.
Stasiek Michalski 3b66c9
    hostname: 0.0.0.0
Stasiek Michalski 3b66c9
    port: 29317
Stasiek Michalski 3b66c9
    # The maximum body size of appservice API requests (from the homeserver) in mebibytes
Stasiek Michalski 3b66c9
    # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
Stasiek Michalski 3b66c9
    max_body_size: 1
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The full URI to the database. SQLite and Postgres are fully supported.
Stasiek Michalski 3b66c9
    # Other DBMSes supported by SQLAlchemy may or may not work.
Stasiek Michalski 3b66c9
    # Format examples:
Stasiek Michalski 3b66c9
    #   SQLite:   sqlite:///filename.db
Stasiek Michalski 3b66c9
    #   Postgres: postgres://username:password@hostname/dbname
Stasiek Michalski 3b66c9
    database: postgresql://{{ pillar['profile']['matrix']['database_user'] }}:{{ pillar['postgres']['users']['matrix']['password'] }}@{{ pillar['profile']['matrix']['database_host'] }}/telegram_bridge
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Public part of web server for out-of-Matrix interaction with the bridge.
Stasiek Michalski 3b66c9
    # Used for things like login if the user wants to make sure the 2FA password isn't stored in
Stasiek Michalski 3b66c9
    # the HS database.
Stasiek Michalski 3b66c9
    public:
Stasiek Michalski 3b66c9
        # Whether or not the public-facing endpoints should be enabled.
Stasiek Michalski 3b66c9
        enabled: false
Stasiek Michalski 3b66c9
        # The prefix to use in the public-facing endpoints.
Stasiek Michalski 3b66c9
        prefix: /public
Stasiek Michalski 3b66c9
        # The base URL where the public-facing endpoints are available. The prefix is not added
Stasiek Michalski 3b66c9
        # implicitly.
Stasiek Michalski 3b66c9
        external: https://example.com/public
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Provisioning API part of the web server for automated portal creation and fetching information.
Stasiek Michalski 3b66c9
    # Used by things like Dimension (https://dimension.t2bot.io/).
Stasiek Michalski 3b66c9
    provisioning:
Stasiek Michalski 3b66c9
        # Whether or not the provisioning API should be enabled.
Stasiek Michalski 3b66c9
        enabled: true
Stasiek Michalski 3b66c9
        # The prefix to use in the provisioning API endpoints.
Stasiek Michalski 3b66c9
        prefix: /_matrix/provision/v1
Stasiek Michalski 3b66c9
        # The shared secret to authorize users of the API.
Stasiek Michalski 3b66c9
        # Set to "generate" to generate and save a new token.
Stasiek Michalski 3b66c9
        shared_secret: generate
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The unique ID of this appservice.
Stasiek Michalski 3b66c9
    id: {{ pillar['profile']['matrix']['telegram']['appservice_id'] }}
Stasiek Michalski 3b66c9
    # Username of the appservice bot.
Stasiek Michalski 3b66c9
    bot_username: telegrambot
Stasiek Michalski 3b66c9
    # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
Stasiek Michalski 3b66c9
    # to leave display name/avatar as-is.
Stasiek Michalski 3b66c9
    bot_displayname: Telegram
Stasiek Michalski 3b66c9
    bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Community ID for bridged users (changes registration file) and rooms.
Stasiek Michalski 3b66c9
    # Must be created manually.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Example: "+telegram:example.com". Set to false to disable.
Stasiek Michalski 3b66c9
    community_id: "+telegram:opensuse.org"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
Stasiek Michalski 3b66c9
    as_token: "{{ pillar['profile']['matrix']['telegram']['appservice_token'] }}"
Stasiek Michalski 3b66c9
    hs_token: "{{ pillar['profile']['matrix']['telegram']['homeserver_token'] }}"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Prometheus telemetry config. Requires prometheus-client to be installed.
Stasiek Michalski 3b66c9
# metrics:
Stasiek Michalski 3b66c9
    # enabled: false
Stasiek Michalski 3b66c9
    # listen_port: 8000
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Manhole config.
Stasiek Michalski 3b66c9
# manhole:
Stasiek Michalski 3b66c9
    # Whether or not opening the manhole is allowed.
Stasiek Michalski 3b66c9
    # enabled: false
Stasiek Michalski 3b66c9
    # The path for the unix socket.
Stasiek Michalski 3b66c9
    # path: /var/tmp/mautrix-telegram.manhole
Stasiek Michalski 3b66c9
    # The list of UIDs who can be added to the whitelist.
Stasiek Michalski 3b66c9
    # If empty, any UIDs can be specified in the open-manhole command.
Stasiek Michalski 3b66c9
    # whitelist:
Stasiek Michalski 3b66c9
    # - 0
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Bridge config
Stasiek Michalski 3b66c9
bridge:
Stasiek Michalski 3b66c9
    # Localpart template of MXIDs for Telegram users.
Stasiek Michalski 3b66c9
    # {userid} is replaced with the user ID of the Telegram user.
Stasiek Michalski 3b66c9
    username_template: "telegram_{userid}"
Stasiek Michalski 3b66c9
    # Localpart template of room aliases for Telegram portal rooms.
Stasiek Michalski 3b66c9
    # {groupname} is replaced with the name part of the public channel/group invite link ( https://t.me/{} )
Stasiek Michalski 3b66c9
    alias_template: "telegram_{groupname}"
Stasiek Michalski 3b66c9
    # Displayname template for Telegram users.
Stasiek Michalski 3b66c9
    # {displayname} is replaced with the display name of the Telegram user.
Stasiek Michalski 3b66c9
    displayname_template: "{displayname} [Telegram]"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Set the preferred order of user identifiers which to use in the Matrix puppet display name.
Stasiek Michalski 3b66c9
    # In the (hopefully unlikely) scenario that none of the given keys are found, the numeric user
Stasiek Michalski 3b66c9
    # ID is used.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # If the bridge is working properly, a phone number or an username should always be known, but
Stasiek Michalski 3b66c9
    # the other one can very well be empty.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Valid keys:
Stasiek Michalski 3b66c9
    #   "full name"          (First and/or last name)
Stasiek Michalski 3b66c9
    #   "full name reversed" (Last and/or first name)
Stasiek Michalski 3b66c9
    #   "first name"
Stasiek Michalski 3b66c9
    #   "last name"
Stasiek Michalski 3b66c9
    #   "username"
Stasiek Michalski 3b66c9
    #   "phone number"
Stasiek Michalski 3b66c9
    displayname_preference:
Stasiek Michalski 3b66c9
    - full name
Stasiek Michalski 3b66c9
    - username
Stasiek Michalski 3b66c9
    - phone number
Stasiek Michalski 3b66c9
    # Maximum length of displayname
Stasiek Michalski 3b66c9
    displayname_max_length: 100
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Maximum number of members to sync per portal when starting up. Other members will be
Stasiek Michalski 3b66c9
    # synced when they send messages. The maximum is 10000, after which the Telegram server
Stasiek Michalski 3b66c9
    # will not send any more members.
Stasiek Michalski 3b66c9
    # Defaults to no local limit (-> limited to 10000 by server)
Stasiek Michalski 3b66c9
    max_initial_member_sync: -1
Stasiek Michalski 3b66c9
    # Whether or not to sync the member list in channels.
Stasiek Michalski 3b66c9
    # If no channel admins have logged into the bridge, the bridge won't be able to sync the member
Stasiek Michalski 3b66c9
    # list regardless of this setting.
Stasiek Michalski 3b66c9
    sync_channel_members: true
Stasiek Michalski 3b66c9
    # Whether or not to skip deleted members when syncing members.
Stasiek Michalski 3b66c9
    skip_deleted_members: true
Stasiek Michalski 3b66c9
    # Whether or not to automatically synchronize contacts and chats of Matrix users logged into
Stasiek Michalski 3b66c9
    # their Telegram account at startup.
Stasiek Michalski 3b66c9
    startup_sync: true
Stasiek Michalski 3b66c9
    # Number of most recently active dialogs to check when syncing chats.
Stasiek Michalski 3b66c9
    # Set to 0 to remove limit.
Stasiek Michalski 3b66c9
    sync_dialog_limit: 30
Stasiek Michalski 3b66c9
    # Whether or not to sync and create portals for direct chats at startup.
Stasiek Michalski 3b66c9
    sync_direct_chats: false
Stasiek Michalski 3b66c9
    # The maximum number of simultaneous Telegram deletions to handle.
Stasiek Michalski 3b66c9
    # A large number of simultaneous redactions could put strain on your homeserver.
Stasiek Michalski 3b66c9
    max_telegram_delete: 10
Stasiek Michalski 3b66c9
    # Whether or not to automatically sync the Matrix room state (mostly unpuppeted displaynames)
Stasiek Michalski 3b66c9
    # at startup and when creating a bridge.
Stasiek Michalski 3b66c9
    sync_matrix_state: true
Stasiek Michalski 3b66c9
    # Allow logging in within Matrix. If false, the only way to log in is using the out-of-Matrix
Stasiek Michalski 3b66c9
    # login website (see appservice.public config section)
Stasiek Michalski 3b66c9
    allow_matrix_login: true
Stasiek Michalski 3b66c9
    # Whether or not to bridge plaintext highlights.
Stasiek Michalski 3b66c9
    # Only enable this if your displayname_template has some static part that the bridge can use to
Stasiek Michalski 3b66c9
    # reliably identify what is a plaintext highlight.
Stasiek Michalski 3b66c9
    plaintext_highlights: false
Stasiek Michalski 3b66c9
    # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix.
Stasiek Michalski 3b66c9
    public_portals: false
Stasiek Michalski 3b66c9
    # Whether or not to use /sync to get presence, read receipts and typing notifications when using
Stasiek Michalski 3b66c9
    # your own Matrix account as the Matrix puppet for your Telegram account.
Stasiek Michalski 3b66c9
    sync_with_custom_puppets: true
Stasiek Michalski 3b66c9
    # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # If set, custom puppets will be enabled automatically for local users
Stasiek Michalski 3b66c9
    # instead of users having to find an access token and run `login-matrix`
Stasiek Michalski 3b66c9
    # manually.
Stasiek Michalski 3b66c9
    login_shared_secret: null
Stasiek Michalski 3b66c9
    # Set to false to disable link previews in messages sent to Telegram.
Stasiek Michalski 3b66c9
    telegram_link_preview: true
Stasiek Michalski 3b66c9
    # Use inline images instead of a separate message for the caption.
Stasiek Michalski 3b66c9
    # N.B. Inline images are not supported on all clients (e.g. Riot iOS).
Stasiek Michalski 3b66c9
    inline_images: false
Stasiek Michalski 3b66c9
    # Maximum size of image in megabytes before sending to Telegram as a document.
Stasiek Michalski 3b66c9
    image_as_file_size: 10
Stasiek Michalski 3b66c9
    # Maximum size of Telegram documents in megabytes to bridge.
Stasiek Michalski 3b66c9
    max_document_size: 100
Stasiek Michalski 3b66c9
    # Enable experimental parallel file transfer, which makes uploads/downloads much faster by
Stasiek Michalski 3b66c9
    # streaming from/to Matrix and using many connections for Telegram.
Stasiek Michalski 3b66c9
    # Note that generating HQ thumbnails for videos is not possible with streamed transfers.
Stasiek Michalski 3b66c9
    parallel_file_transfer: false
Stasiek Michalski 3b66c9
    # Whether or not created rooms should have federation enabled.
Stasiek Michalski 3b66c9
    # If false, created portal rooms will never be federated.
Stasiek Michalski 3b66c9
    federate_rooms: true
Stasiek Michalski 3b66c9
    # Settings for converting animated stickers.
Stasiek Michalski 3b66c9
    animated_sticker:
Stasiek Michalski 3b66c9
        # Format to which animated stickers should be converted.
Stasiek Michalski 3b66c9
        # disable - No conversion, send as-is (gzipped lottie)
Stasiek Michalski 3b66c9
        # png - converts to non-animated png (fastest),
Stasiek Michalski 3b66c9
        # gif - converts to animated gif, but loses transparency
Stasiek Michalski 3b66c9
        # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support
Stasiek Michalski 3b66c9
        target: webm
Stasiek Michalski 3b66c9
        # Arguments for converter. All converters take width and height.
Stasiek Michalski 3b66c9
        # GIF converter takes background as a hex color.
Stasiek Michalski 3b66c9
        args:
Stasiek Michalski 3b66c9
            width: 256
Stasiek Michalski 3b66c9
            height: 256
Stasiek Michalski 3b66c9
            fps: 30
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Overrides for base power levels.
Stasiek Michalski 3b66c9
    initial_power_level_overrides:
Stasiek Michalski 3b66c9
        user: {}
Stasiek Michalski 3b66c9
        group: {}
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Whether to bridge Telegram bot messages as m.notices or m.texts.
Stasiek Michalski 3b66c9
    bot_messages_as_notices: true
Stasiek Michalski 3b66c9
    bridge_notices:
Stasiek Michalski 3b66c9
        # Whether or not Matrix bot messages (type m.notice) should be bridged.
Stasiek Michalski 3b66c9
        default: false
Stasiek Michalski 3b66c9
        # List of user IDs for whom the previous flag is flipped.
Stasiek Michalski 3b66c9
        # e.g. if bridge_notices.default is false, notices from other users will not be bridged, but
Stasiek Michalski 3b66c9
        #      notices from users listed here will be bridged.
Stasiek Michalski 3b66c9
        # exceptions:
Stasiek Michalski 3b66c9
        # - "@importantbot:example.com"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Some config options related to Telegram message deduplication.
Stasiek Michalski 3b66c9
    # The default values are usually fine, but some debug messages/warnings might recommend you
Stasiek Michalski 3b66c9
    # change these.
Stasiek Michalski 3b66c9
    deduplication:
Stasiek Michalski 3b66c9
        # Whether or not to check the database if the message about to be sent is a duplicate.
Stasiek Michalski 3b66c9
        pre_db_check: false
Stasiek Michalski 3b66c9
        # The number of latest events to keep when checking for duplicates.
Stasiek Michalski 3b66c9
        # You might need to increase this on high-traffic bridge instances.
Stasiek Michalski 3b66c9
        cache_queue_length: 20
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The formats to use when sending messages to Telegram via the relay bot.
Stasiek Michalski 3b66c9
    # Text msgtypes (m.text, m.notice and m.emote) support HTML, media msgtypes don't.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Available variables:
Stasiek Michalski 3b66c9
    #   $sender_displayname - The display name of the sender (e.g. Example User)
Stasiek Michalski 3b66c9
    #   $sender_username    - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
Stasiek Michalski 3b66c9
    #   $sender_mxid        - The Matrix ID of the sender (e.g. @exampleuser:example.com)
Stasiek Michalski 3b66c9
    #   $message            - The message content
Stasiek Michalski 3b66c9
    message_formats:
Stasiek Michalski 3b66c9
        m.text: "$sender_displayname: $message"
Stasiek Michalski 3b66c9
        m.notice: "$sender_displayname: $message"
Stasiek Michalski 3b66c9
        m.emote: "* $sender_displayname $message"
Stasiek Michalski 3b66c9
        m.file: "$sender_displayname sent a file: $message"
Stasiek Michalski 3b66c9
        m.image: "$sender_displayname sent an image: $message"
Stasiek Michalski 3b66c9
        m.audio: "$sender_displayname sent an audio file: $message"
Stasiek Michalski 3b66c9
        m.video: "$sender_displayname sent a video: $message"
Stasiek Michalski 3b66c9
        m.location: "$sender_displayname sent a location: $message"
Stasiek Michalski 3b66c9
    # Telegram doesn't have built-in emotes, this field specifies how m.emote's from authenticated
Stasiek Michalski 3b66c9
    # users are sent to telegram. All fields in message_formats are supported. Additionally, the
Stasiek Michalski 3b66c9
    # Telegram user info is available in the following variables:
Stasiek Michalski 3b66c9
    #    $displayname - Telegram displayname
Stasiek Michalski 3b66c9
    #    $username    - Telegram username (may not exist)
Stasiek Michalski 3b66c9
    #    $mention     - Telegram @username or displayname mention (depending on which exists)
Stasiek Michalski 3b66c9
    emote_format: "* $mention $formatted_body"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The formats to use when sending state events to Telegram via the relay bot.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Variables from `message_formats` that have the `sender_` prefix are available without the prefix.
Stasiek Michalski 3b66c9
    # In name_change events, `$prev_displayname` is the previous displayname.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Set format to an empty string to disable the messages for that event.
Stasiek Michalski 3b66c9
    state_event_formats:
Stasiek Michalski 3b66c9
        join: ""
Stasiek Michalski 3b66c9
        leave: ""
Stasiek Michalski 3b66c9
        name_change: ""
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Filter rooms that can/can't be bridged. Can also be managed using the `filter` and
Stasiek Michalski 3b66c9
    # `filter-mode` management commands.
Stasiek Michalski 3b66c9
    #
Stasiek Michalski 3b66c9
    # Filters do not affect direct chats.
Stasiek Michalski 3b66c9
    # An empty blacklist will essentially disable the filter.
Stasiek Michalski 3b66c9
    filter:
Stasiek Michalski 3b66c9
        # Filter mode to use. Either "blacklist" or "whitelist".
Stasiek Michalski 3b66c9
        # If the mode is "blacklist", the listed chats will never be bridged.
Stasiek Michalski 3b66c9
        # If the mode is "whitelist", only the listed chats can be bridged.
Stasiek Michalski 3b66c9
        mode: blacklist
Stasiek Michalski 3b66c9
        # The list of group/channel IDs to filter.
Stasiek Michalski 3b66c9
        list: []
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # The prefix for commands. Only required in non-management rooms.
Stasiek Michalski 3b66c9
    command_prefix: "!tg"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Permissions for using the bridge.
Stasiek Michalski 3b66c9
    # Permitted values:
Stasiek Michalski 3b66c9
    #   relaybot - Only use the bridge via the relaybot, no access to commands.
Stasiek Michalski 3b66c9
    #       user - Relaybot level + access to commands to create bridges.
Stasiek Michalski 3b66c9
    #  puppeting - User level + logging in with a Telegram account.
Stasiek Michalski 3b66c9
    #       full - Full access to use the bridge, i.e. previous levels + Matrix login.
Stasiek Michalski 3b66c9
    #      admin - Full access to use the bridge and some extra administration commands.
Stasiek Michalski 3b66c9
    # Permitted keys:
Stasiek Michalski 3b66c9
    #        * - All Matrix users
Stasiek Michalski 3b66c9
    #   domain - All users on that homeserver
Stasiek Michalski 3b66c9
    #     mxid - Specific user
Stasiek Michalski 3b66c9
    permissions:
Stasiek Michalski 3b66c9
        "*": "relaybot"
Stasiek Michalski 79adc3
        # "public.example.com": "user"
Stasiek Michalski 79adc3
        # "example.com": "full"
Stasiek Michalski 79adc3
        # "@admin:example.com": "admin"
Stasiek Michalski 79adc3
        "@hellcp:opensuse.org"
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Options related to the message relay Telegram bot.
Stasiek Michalski 3b66c9
    relaybot:
Stasiek Michalski 3b66c9
        private_chat:
Stasiek Michalski 3b66c9
            # List of users to invite to the portal when someone starts a private chat with the bot.
Stasiek Michalski 3b66c9
            # If empty, private chats with the bot won't create a portal.
Stasiek Michalski 3b66c9
            invite: []
Stasiek Michalski 3b66c9
            # Whether or not to bridge state change messages in relaybot private chats.
Stasiek Michalski 3b66c9
            state_changes: true
Stasiek Michalski 3b66c9
            # When private_chat_invite is empty, this message is sent to users /starting the
Stasiek Michalski 3b66c9
            # relaybot. Telegram's "markdown" is supported.
Stasiek Michalski 3b66c9
            message: This is a Matrix bridge relaybot and does not support direct chats
Stasiek Michalski 3b66c9
        # List of users to invite to all group chat portals created by the bridge.
Stasiek Michalski 3b66c9
        group_chat_invite: []
Stasiek Michalski 3b66c9
        # Whether or not the relaybot should not bridge events in unbridged group chats.
Stasiek Michalski 3b66c9
        # If false, portals will be created when the relaybot receives messages, just like normal
Stasiek Michalski 3b66c9
        # users. This behavior is usually not desirable, as it interferes with manually bridging
Stasiek Michalski 3b66c9
        # the chat to another room.
Stasiek Michalski 3b66c9
        ignore_unbridged_group_chat: true
Stasiek Michalski 3b66c9
        # Whether or not to allow creating portals from Telegram.
Stasiek Michalski 3b66c9
        authless_portals: true
Stasiek Michalski 3b66c9
        # Whether or not to allow Telegram group admins to use the bot commands.
Stasiek Michalski 3b66c9
        whitelist_group_admins: true
Stasiek Michalski 3b66c9
        # Whether or not to ignore incoming events sent by the relay bot.
Stasiek Michalski 3b66c9
        ignore_own_incoming_events: true
Stasiek Michalski 3b66c9
        # List of usernames/user IDs who are also allowed to use the bot commands.
Stasiek Michalski 3b66c9
        # whitelist:
Stasiek Michalski 3b66c9
        # - myusername
Stasiek Michalski 3b66c9
        # - 12345678
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Telegram config
Stasiek Michalski 3b66c9
telegram:
Stasiek Michalski 3b66c9
    # Get your own API keys at https://my.telegram.org/apps
Stasiek Michalski 3b66c9
    api_id: {{ pillar['profile']['matrix']['telegram']['api_id'] }}
Stasiek Michalski 3b66c9
    api_hash: {{ pillar['profile']['matrix']['telegram']['api_hash'] }}
Stasiek Michalski 3b66c9
    # (Optional) Create your own bot at https://t.me/BotFather
Stasiek Michalski 3b66c9
    bot_token: {{ pillar['profile']['matrix']['telegram']['bot_token'] }}
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Telethon connection options.
Stasiek Michalski 3b66c9
    connection:
Stasiek Michalski 3b66c9
        # The timeout in seconds to be used when connecting.
Stasiek Michalski 3b66c9
        timeout: 120
Stasiek Michalski 3b66c9
        # How many times the reconnection should retry, either on the initial connection or when
Stasiek Michalski 3b66c9
        # Telegram disconnects us. May be set to a negative or null value for infinite retries, but
Stasiek Michalski 3b66c9
        # this is not recommended, since the program can get stuck in an infinite loop.
Stasiek Michalski 3b66c9
        retries: 5
Stasiek Michalski 3b66c9
        # The delay in seconds to sleep between automatic reconnections.
Stasiek Michalski 3b66c9
        retry_delay: 1
Stasiek Michalski 3b66c9
        # The threshold below which the library should automatically sleep on flood wait errors
Stasiek Michalski 3b66c9
        # (inclusive). For instance, if a FloodWaitError for 17s occurs and flood_sleep_threshold
Stasiek Michalski 3b66c9
        # is 20s, the library will sleep automatically. If the error was for 21s, it would raise
Stasiek Michalski 3b66c9
        # the error instead. Values larger than a day (86400) will be changed to a day.
Stasiek Michalski 3b66c9
        flood_sleep_threshold: 60
Stasiek Michalski 3b66c9
        # How many times a request should be retried. Request are retried when Telegram is having
Stasiek Michalski 3b66c9
        # internal issues, when there is a FloodWaitError less than flood_sleep_threshold, or when
Stasiek Michalski 3b66c9
        # there's a migrate error. May take a negative or null value for infinite retries, but this
Stasiek Michalski 3b66c9
        # is not recommended, since some requests can always trigger a call fail (such as searching
Stasiek Michalski 3b66c9
        # for messages).
Stasiek Michalski 3b66c9
        request_retries: 5
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Device info sent to Telegram.
Stasiek Michalski 3b66c9
    device_info:
Stasiek Michalski 3b66c9
        # "auto" = OS name+version.
Stasiek Michalski 3b66c9
        device_model: auto
Stasiek Michalski 3b66c9
        # "auto" = Telethon version.
Stasiek Michalski 3b66c9
        system_version: auto
Stasiek Michalski 3b66c9
        # "auto" = mautrix-telegram version.
Stasiek Michalski 3b66c9
        app_version: auto
Stasiek Michalski 3b66c9
        lang_code: en
Stasiek Michalski 3b66c9
        system_lang_code: en
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Custom server to connect to.
Stasiek Michalski 3b66c9
    server:
Stasiek Michalski 3b66c9
        # Set to true to use these server settings. If false, will automatically
Stasiek Michalski 3b66c9
        # use production server assigned by Telegram. Set to false in production.
Stasiek Michalski 3b66c9
        enabled: false
Stasiek Michalski 3b66c9
        # The DC ID to connect to.
Stasiek Michalski 3b66c9
        dc: 2
Stasiek Michalski 3b66c9
        # The IP to connect to.
Stasiek Michalski 3b66c9
        ip: 149.154.167.40
Stasiek Michalski 3b66c9
        # The port to connect to. 443 may not work, 80 is better and both are equally secure.
Stasiek Michalski 3b66c9
        port: 80
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
    # Telethon proxy configuration.
Stasiek Michalski 3b66c9
    # You must install PySocks from pip for proxies to work.
Stasiek Michalski 3b66c9
    proxy:
Stasiek Michalski 3b66c9
        # Allowed types: disabled, socks4, socks5, http, mtproxy
Stasiek Michalski 3b66c9
        type: disabled
Stasiek Michalski 3b66c9
        # Proxy IP address and port.
Stasiek Michalski 3b66c9
        address: 127.0.0.1
Stasiek Michalski 3b66c9
        port: 1080
Stasiek Michalski 3b66c9
        # Whether or not to perform DNS resolving remotely. Only for socks/http proxies.
Stasiek Michalski 3b66c9
        rdns: true
Stasiek Michalski 3b66c9
        # Proxy authentication (optional). Put MTProxy secret in password field.
Stasiek Michalski 3b66c9
        username: ""
Stasiek Michalski 3b66c9
        password: ""
Stasiek Michalski 3b66c9
Stasiek Michalski 3b66c9
# Python logging configuration.
Stasiek Michalski 3b66c9
#
Stasiek Michalski 3b66c9
# See section 16.7.2 of the Python documentation for more info:
Stasiek Michalski 3b66c9
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
Stasiek Michalski 3b66c9
logging:
Stasiek Michalski 3b66c9
    version: 1
Stasiek Michalski 3b66c9
    formatters:
Stasiek Michalski 3b66c9
        colored:
Stasiek Michalski 3b66c9
            (): mautrix_telegram.util.ColorFormatter
Stasiek Michalski 3b66c9
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
Stasiek Michalski 3b66c9
        normal:
Stasiek Michalski 3b66c9
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
Stasiek Michalski 3b66c9
    handlers:
Stasiek Michalski 3b66c9
        file:
Stasiek Michalski 3b66c9
            class: logging.handlers.RotatingFileHandler
Stasiek Michalski 3b66c9
            formatter: normal
Stasiek Michalski 3b66c9
            filename: ./mautrix-telegram.log
Stasiek Michalski 3b66c9
            maxBytes: 10485760
Stasiek Michalski 3b66c9
            backupCount: 10
Stasiek Michalski 3b66c9
        console:
Stasiek Michalski 3b66c9
            class: logging.StreamHandler
Stasiek Michalski 3b66c9
            formatter: colored
Stasiek Michalski 3b66c9
    loggers:
Stasiek Michalski 3b66c9
        mau:
Stasiek Michalski 3b66c9
            level: DEBUG
Stasiek Michalski 3b66c9
        telethon:
Stasiek Michalski 3b66c9
            level: INFO
Stasiek Michalski 3b66c9
        aiohttp:
Stasiek Michalski 3b66c9
            level: INFO
Stasiek Michalski 3b66c9
    root:
Stasiek Michalski 3b66c9
        level: DEBUG
Stasiek Michalski 3b66c9
        handlers: [file, console]