homeserver:
    address: ${node.metadata['mautrix-telegram']['homeserver']['url']}
    domain: ${node.metadata['mautrix-telegram']['homeserver']['domain']}
    verify_ssl: true

appservice:
    address: http://${node.metadata['mautrix-telegram'].get('listen-addr', '127.0.0.1')}:${node.metadata['mautrix-telegram'].get('port', 20010)}
    tls_cert: false
    tls_key: false
    hostname: ${node.metadata['mautrix-telegram'].get('listen-addr', '127.0.0.1')}
    port: ${node.metadata['mautrix-telegram'].get('port', 20010)}
    max_body_size: ${node.metadata['mautrix-telegram'].get('max-body-size', 1)}
    database: postgres://${node.metadata['mautrix-telegram']['database']['user']}:${node.metadata['mautrix-telegram']['database']['password']}@${node.metadata['mautrix-telegram']['database'].get('host', 'localhost')}/${node.metadata['mautrix-telegram']['database']['database']}
    public:
        enabled: false
        prefix: /public
        external: https://example.com/public
    provisioning:
        enabled: ${str(node.metadata['mautrix-telegram']['provisioning']['enabled']).lower()}
        prefix: /_matrix/provision/v1
        shared_secret: ${node.metadata['mautrix-telegram']['provisioning']['shared_secret']}
    id: telegram
    bot_username: telegrambot
    bot_displayname: Telegram bridge bot
    bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
    community_id: false
    as_token: ${node.metadata['mautrix-telegram']['as_token']}
    hs_token: ${node.metadata['mautrix-telegram']['hs_token']}

metrics:
    enabled: false
    listen_port: 8000

manhole:
    enabled: false
    path: /var/tmp/mautrix-telegram.manhole
    whitelist:
    - 0

bridge:
    username_template: telegram_{userid}
    alias_template: telegram_{groupname}
    displayname_template: '{displayname} (Telegram)'
    displayname_preference:
    - full name
    - username
    - phone number
    displayname_max_length: 100
    allow_avatar_remove: false
    max_initial_member_sync: -1
    sync_channel_members: true
    skip_deleted_members: true
    startup_sync: true
    sync_dialog_limit: 30
    sync_direct_chats: true
    max_telegram_delete: 100
    sync_matrix_state: true
    allow_matrix_login: true
    plaintext_highlights: false
    public_portals: true
    sync_with_custom_puppets: true
    login_shared_secret:
    telegram_link_preview: true
    inline_images: false
    image_as_file_size: 10
    max_document_size: 500
    parallel_file_transfer: false # incompatible with matrix-media-repo
    federate_rooms: true
    animated_sticker:
        target: webm
        args:
            width: 256
            height: 256
            background: '020202'  # only for gif
            fps: 30               # only for webm
    encryption:
        allow: true
        default: false
    private_chat_portal_meta: false
    delivery_receipts: true
    delivery_error_reports: true
    initial_power_level_overrides:
        user: {}
        group: {}
    bot_messages_as_notices: true
    bridge_notices:
        default: false
        exceptions:
        - '@importantbot:example.com'
    deduplication:
        pre_db_check: false
        cache_queue_length: 20
    message_formats:
        m.text: '<b>$sender_displayname</b>: $message'
        m.notice: '<b>$sender_displayname</b>: $message'
        m.emote: '* <b>$sender_displayname</b> $message'
        m.file: '<b>$sender_displayname</b> sent a file: $message'
        m.image: '<b>$sender_displayname</b> sent an image: $message'
        m.audio: '<b>$sender_displayname</b> sent an audio file: $message'
        m.video: '<b>$sender_displayname</b> sent a video: $message'
        m.location: '<b>$sender_displayname</b> sent a location: $message'
    emote_format: '* $mention $formatted_body'
    state_event_formats:
        join: <b>$displayname</b> joined the room.
        leave: <b>$displayname</b> left the room.
        name_change: <b>$prev_displayname</b> changed their name to <b>$displayname</b>
    filter:
        mode: blacklist
        list: []
    command_prefix: '!tg'
    permissions:
% for user, permission in node.metadata['mautrix-telegram']['permissions'].items():
        ${user}: ${permission}
% endfor
    relaybot:
        private_chat:
            invite:
% for user, permission in node.metadata['mautrix-telegram']['permissions'].items():
%     if permission == 'admin':
            - ${user}
%     endif
% endfor
            state_changes: true
            message: This is a Matrix bridge relaybot and does not support direct chats
        group_chat_invite: []
        ignore_unbridged_group_chat: true
        authless_portals: true
        whitelist_group_admins: true
        ignore_own_incoming_events: true
        whitelist: []
    backfill:
        invite_own_puppet: true
        takeout_limit: 1
        initial_limit: 10
        missed_limit: 0
        disable_notifications: false
        normal_groups: false

telegram:
    api_id: ${node.metadata['mautrix-telegram']['telegram']['api_id']}
    api_hash: ${node.metadata['mautrix-telegram']['telegram']['api_token']}
    bot_token: ${node.metadata['mautrix-telegram']['telegram']['bot_token']}
    connection:
        timeout: 60
        retries: 5
        retry_delay: 3
        flood_sleep_threshold: 60
        request_retries: 5
    device_info:
        device_model: auto
        system_version: auto
        app_version: auto
        lang_code: en
        system_lang_code: en
    server:
        enabled: false
        dc: 2
        ip: 149.154.167.40
        port: 80
    proxy:
        type: disabled
        address: 127.0.0.1
        port: 1080
        rdns: true
        username: ''
        password: ''

logging:
    version: 1
    formatters:
        precise:
            format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
    handlers:
        console:
            class: logging.StreamHandler
            formatter: precise
    loggers:
        mau:
            level: INFO
        telethon:
            level: INFO
        aiohttp:
            level: WARNING
    root:
        level: INFO
        handlers: [console]
