aboutsummaryrefslogtreecommitdiff
path: root/app_config/configuration/chat/fb2mx/config.yaml
blob: 964c6814c33a35bce153f9df92474611bfb74751 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Homeserver details
homeserver:
    # The address that this appservice can use to connect to the homeserver.
    address: https://im.deuxfleurs.fr
    # The domain of the homeserver (for MXIDs, etc).
    domain: deuxfleurs.fr
    # Whether or not to verify the SSL certificate of the homeserver.
    # Only applies if address starts with https://
    verify_ssl: true

# Application service host/registration related details
# Changing these values requires regeneration of the registration.
appservice:
    # The address that the homeserver can use to connect to this appservice.
    address: http://fb2mx.service.2.cluster.deuxfleurs.fr:29319

    # The hostname and port where this appservice should listen.
    hostname: 0.0.0.0
    port: 29319
    # The maximum body size of appservice API requests (from the homeserver) in mebibytes
    # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
    max_body_size: 1

    # The full URI to the database. SQLite and Postgres are fully supported.
    # Other DBMSes supported by SQLAlchemy may or may not work.
    # Format examples:
    #   SQLite:   sqlite:///filename.db
    #   Postgres: postgres://username:password@hostname/dbname
    database: '{{ key "secrets/chat/fb2mx/db_url" | trimSpace }}' 

    # The unique ID of this appservice.
    id: facebook
    # Username of the appservice bot.
    bot_username: facebookbot
    # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
    # to leave display name/avatar as-is.
    bot_displayname: Facebook bridge bot
    bot_avatar: mxc://maunium.net/ddtNPZSKMNqaUzqrHuWvUADv

    # Community ID for bridged users (changes registration file) and rooms.
    # Must be created manually.
    community_id: "+fbusers:deuxfleurs.fr"

    # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
    as_token: '{{ key "secrets/chat/fb2mx/as_token" | trimSpace }}'
    hs_token: '{{ key "secrets/chat/fb2mx/hs_token" | trimSpace }}'

# Bridge config
bridge:
    # Localpart template of MXIDs for Facebook users.
    # {userid} is replaced with the user ID of the Facebook user.
    username_template: "facebook_{userid}"
    # Localpart template for per-user room grouping community IDs.
    # The bridge will create these communities and add all of the specific user's portals to the community.
    # {localpart} is the MXID localpart and {server} is the MXID server part of the user.
    #
    # `facebook_{localpart}={server}` is a good value.
    community_template: "facebook_{localpart}={server}"
    # Displayname template for Facebook users.
    # {displayname} is replaced with the display name of the Facebook user
    #               as defined below in displayname_preference.
    # Keys available for displayname_preference are also available here.
    displayname_template: "{displayname} (FB)"
    # Available keys:
    # "name" (full name)
    # "first_name"
    # "last_name"
    # "nickname"
    # "own_nickname" (user-specific!)
    displayname_preference:
    - name

    # The prefix for commands. Only required in non-management rooms.
    command_prefix: "!fb"

    # Number of chats to sync (and create portals for) on startup/login.
    # Maximum 20, set 0 to disable automatic syncing.
    initial_chat_sync: 10
    # Whether or not the Facebook users of logged in Matrix users should be
    # invited to private chats when the user sends a message from another client.
    invite_own_puppet_to_pm: false
    # Whether or not to use /sync to get presence, read receipts and typing notifications when using
    # your own Matrix account as the Matrix puppet for your Facebook account.
    sync_with_custom_puppets: true
    # Whether or not to bridge presence in both directions. Facebook allows users not to broadcast
    # presence, but then it won't send other users' presence to the client.
    presence: true
    # Whether or not to update avatars when syncing all contacts at startup.
    update_avatar_initial_sync: true

    # Permissions for using the bridge.
    # Permitted values:
    #       user - Use the bridge with puppeting.
    #      admin - Use and administrate the bridge.
    # Permitted keys:
    #        * - All Matrix users
    #   domain - All users on that homeserver
    #     mxid - Specific user
    permissions:
        "deuxfleurs.fr": "user"

# Python logging configuration.
#
# See section 16.7.2 of the Python documentation for more info:
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
logging:
    version: 1
    formatters:
        colored:
            (): mautrix_facebook.util.ColorFormatter
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
        normal:
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
    handlers:
        file:
            class: logging.handlers.RotatingFileHandler
            formatter: normal
            filename: ./mautrix-facebook.log
            maxBytes: 10485760
            backupCount: 10
        console:
            class: logging.StreamHandler
            formatter: colored
    loggers:
        mau:
            level: DEBUG
        fbchat:
            level: DEBUG
        aiohttp:
            level: INFO
    root:
        level: DEBUG
        handlers: [file, console]