Raw YAML - Releases: latest, v26.04, v26.03, v25.11, v25.10
1# Network-specific config options
2network:
3 # Proxy to use for all Twitter connections.
4 proxy: null
5 # Alternative to proxy: an HTTP endpoint that returns the proxy URL to use for Twitter connections.
6 get_proxy_url: null
7
8 # Displayname template for Twitter users.
9 # {{ .DisplayName }} is replaced with the display name of the Twitter user.
10 # {{ .Username }} is replaced with the username of the Twitter user.
11 displayname_template: "{{ .DisplayName }} (Twitter)"
12
13 # Maximum number of conversations to sync on startup
14 conversation_sync_limit: 20
15
16 # Should the bridge cache sessions instead of resyncing chats on every restart?
17 cache_session: true
18
19 # Should the bridge use "X" instead of "Twitter" in certain places,
20 # such as the management room welcome message and MSC2346 bridge info?
21 x: false
22
23
24# Config options that affect the central bridge module.
25bridge:
26 # The prefix for commands. Only required in non-management rooms.
27 command_prefix: '!twitter'
28 # Should the bridge create a space for each login containing the rooms that account is in?
29 personal_filtering_spaces: true
30 # Whether the bridge should set names and avatars explicitly for DM portals.
31 # This is only necessary when using clients that don't support MSC4171.
32 private_chat_portal_meta: true
33 # Should events be handled asynchronously within portal rooms?
34 # If true, events may end up being out of order, but slow events won't block other ones.
35 # This is not yet safe to use.
36 async_events: false
37 # Should every user have their own portals rather than sharing them?
38 # By default, users who are in the same group on the remote network will be
39 # in the same Matrix room bridged to that group. If this is set to true,
40 # every user will get their own Matrix room instead.
41 # SETTING THIS IS IRREVERSIBLE AND POTENTIALLY DESTRUCTIVE IF PORTALS ALREADY EXIST.
42 split_portals: false
43 # Should the bridge resend `m.bridge` events to all portals on startup?
44 resend_bridge_info: false
45 # Should `m.bridge` events be sent without a state key?
46 # By default, the bridge uses a unique key that won't conflict with other bridges.
47 no_bridge_info_state_key: false
48 # Should bridge connection status be sent to the management room as `m.notice` events?
49 # These contain the same data that can be posted to an external HTTP server using homeserver -> status_endpoint.
50 # Allowed values: none, errors, all
51 bridge_status_notices: errors
52 # How long after an unknown error should the bridge attempt a full reconnect?
53 # Must be at least 1 minute. The bridge will add an extra ±20% jitter to this value.
54 unknown_error_auto_reconnect: null
55
56 # Should leaving Matrix rooms be bridged as leaving groups on the remote network?
57 bridge_matrix_leave: false
58 # Should `m.notice` messages be bridged?
59 bridge_notices: false
60 # Should room tags only be synced when creating the portal? Tags mean things like favorite/pin and archive/low priority.
61 # Tags currently can't be synced back to the remote network, so a continuous sync means tagging from Matrix will be undone.
62 tag_only_on_create: true
63 # List of tags to allow bridging. If empty, no tags will be bridged.
64 only_bridge_tags: [m.favourite, m.lowpriority]
65 # Should room mute status only be synced when creating the portal?
66 # Like tags, mutes can't currently be synced back to the remote network.
67 mute_only_on_create: true
68 # Should the bridge check the db to ensure that incoming events haven't been handled before
69 deduplicate_matrix_messages: false
70 # Should cross-room reply metadata be bridged?
71 # Most Matrix clients don't support this and servers may reject such messages too.
72 cross_room_replies: false
73 # If a state event fails to bridge, should the bridge revert any state changes made by that event?
74 revert_failed_state_changes: false
75 # In portals with no relay set, should Matrix users be kicked if they're
76 # not logged into an account that's in the remote chat?
77 kick_matrix_users: true
78
79 # What should be done to portal rooms when a user logs out or is logged out?
80 # Permitted values:
81 # nothing - Do nothing, let the user stay in the portals
82 # kick - Remove the user from the portal rooms, but don't delete them
83 # unbridge - Remove all ghosts in the room and disassociate it from the remote chat
84 # delete - Remove all ghosts and users from the room (i.e. delete it)
85 cleanup_on_logout:
86 # Should cleanup on logout be enabled at all?
87 enabled: false
88 # Settings for manual logouts (explicitly initiated by the Matrix user)
89 manual:
90 # Action for private portals which will never be shared with other Matrix users.
91 private: nothing
92 # Action for portals with a relay user configured.
93 relayed: nothing
94 # Action for portals which may be shared, but don't currently have any other Matrix users.
95 shared_no_users: nothing
96 # Action for portals which have other logged-in Matrix users.
97 shared_has_users: nothing
98 # Settings for credentials being invalidated (initiated by the remote network, possibly through user action).
99 # Keys have the same meanings as in the manual section.
100 bad_credentials:
101 private: nothing
102 relayed: nothing
103 shared_no_users: nothing
104 shared_has_users: nothing
105
106 # Settings for relay mode
107 relay:
108 # Whether relay mode should be allowed. If allowed, the set-relay command can be used to turn any
109 # authenticated user into a relaybot for that chat.
110 enabled: false
111 # Should only admins be allowed to set themselves as relay users?
112 # If true, non-admins can only set users listed in default_relays as relays in a room.
113 admin_only: true
114 # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room.
115 default_relays: []
116 # The formats to use when sending messages via the relaybot.
117 # Available variables:
118 # .Sender.UserID - The Matrix user ID of the sender.
119 # .Sender.Displayname - The display name of the sender (if set).
120 # .Sender.RequiresDisambiguation - Whether the sender's name may be confused with the name of another user in the room.
121 # .Sender.DisambiguatedName - The disambiguated name of the sender. This will be the displayname if set,
122 # plus the user ID in parentheses if the displayname is not unique.
123 # If the displayname is not set, this is just the user ID.
124 # .Message - The `formatted_body` field of the message.
125 # .Caption - The `formatted_body` field of the message, if it's a caption. Otherwise an empty string.
126 # .FileName - The name of the file being sent.
127 message_formats:
128 m.text: "<b>{{ .Sender.DisambiguatedName }}</b>: {{ .Message }}"
129 m.notice: "<b>{{ .Sender.DisambiguatedName }}</b>: {{ .Message }}"
130 m.emote: "* <b>{{ .Sender.DisambiguatedName }}</b> {{ .Message }}"
131 m.file: "<b>{{ .Sender.DisambiguatedName }}</b> sent a file{{ if .Caption }}: {{ .Caption }}{{ end }}"
132 m.image: "<b>{{ .Sender.DisambiguatedName }}</b> sent an image{{ if .Caption }}: {{ .Caption }}{{ end }}"
133 m.audio: "<b>{{ .Sender.DisambiguatedName }}</b> sent an audio file{{ if .Caption }}: {{ .Caption }}{{ end }}"
134 m.video: "<b>{{ .Sender.DisambiguatedName }}</b> sent a video{{ if .Caption }}: {{ .Caption }}{{ end }}"
135 m.location: "<b>{{ .Sender.DisambiguatedName }}</b> sent a location{{ if .Caption }}: {{ .Caption }}{{ end }}"
136 # For networks that support per-message displaynames (i.e. Slack and Discord), the template for those names.
137 # This has all the Sender variables available under message_formats (but without the .Sender prefix).
138 # Note that you need to manually remove the displayname from message_formats above.
139 displayname_format: "{{ .DisambiguatedName }}"
140
141 # Permissions for using the bridge.
142 # Permitted values:
143 # relay - Talk through the relaybot (if enabled), no access otherwise
144 # commands - Access to use commands in the bridge, but not login.
145 # user - Access to use the bridge with puppeting.
146 # admin - Full access, user level with some additional administration tools.
147 # Permitted keys:
148 # * - All Matrix users
149 # domain - All users on that homeserver
150 # mxid - Specific user
151 permissions:
152 "*": relay
153 "example.com": user
154 "@admin:example.com": admin
155
156# Config for the bridge's database.
157database:
158 # The database type. "sqlite3-fk-wal" and "postgres" are supported.
159 type: postgres
160 # The database URI.
161 # SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended.
162 # https://github.com/mattn/go-sqlite3#connection-string
163 # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
164 # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
165 uri: postgres://user:password@host/database?sslmode=disable
166 # Maximum number of connections.
167 max_open_conns: 5
168 max_idle_conns: 1
169 # Maximum connection idle time and lifetime before they're closed. Disabled if null.
170 # Parsed with https://pkg.go.dev/time#ParseDuration
171 max_conn_idle_time: null
172 max_conn_lifetime: null
173
174# Homeserver details.
175homeserver:
176 # The address that this appservice can use to connect to the homeserver.
177 # Local addresses without HTTPS are generally recommended when the bridge is running on the same machine,
178 # but https also works if they run on different machines.
179 address: http://example.localhost:8008
180 # The domain of the homeserver (also known as server_name, used for MXIDs, etc).
181 domain: example.com
182
183 # What software is the homeserver running?
184 # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
185 software: standard
186 # The URL to push real-time bridge status to.
187 # If set, the bridge will make POST requests to this URL whenever a user's remote network connection state changes.
188 # The bridge will use the appservice as_token to authorize requests.
189 status_endpoint:
190 # Endpoint for reporting per-message status.
191 # If set, the bridge will make POST requests to this URL when processing a message from Matrix.
192 # It will make one request when receiving the message (step BRIDGE), one after decrypting if applicable
193 # (step DECRYPTED) and one after sending to the remote network (step REMOTE). Errors will also be reported.
194 # The bridge will use the appservice as_token to authorize requests.
195 message_send_checkpoint_endpoint:
196 # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246?
197 async_media: false
198
199 # Should the bridge use a websocket for connecting to the homeserver?
200 # The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy,
201 # mautrix-asmux (deprecated), and hungryserv (proprietary).
202 websocket: false
203 # How often should the websocket be pinged? Pinging will be disabled if this is zero.
204 ping_interval_seconds: 0
205
206# Application service host/registration related details.
207# Changing these values requires regeneration of the registration (except when noted otherwise)
208appservice:
209 # The address that the homeserver can use to connect to this appservice.
210 # Like the homeserver address, a local non-https address is recommended when the bridge is on the same machine.
211 # If the bridge is elsewhere, you must secure the connection yourself (e.g. with https or wireguard)
212 # If you want to use https, you need to use a reverse proxy. The bridge does not have TLS support built in.
213 address: http://localhost:29327
214 # A public address that external services can use to reach this appservice.
215 # This is only needed for things like public media. A reverse proxy is generally necessary when using this field.
216 # This value doesn't affect the registration file.
217 public_address: https://bridge.example.com
218
219 # The hostname and port where this appservice should listen.
220 # For Docker, you generally have to change the hostname to 0.0.0.0.
221 hostname: 127.0.0.1
222 port: 29327
223
224 # The unique ID of this appservice.
225 id: twitter
226 # Appservice bot details.
227 bot:
228 # Username of the appservice bot.
229 username: twitterbot
230 # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
231 # to leave display name/avatar as-is.
232 displayname: Twitter bridge bot
233 avatar: mxc://maunium.net/HVHcnusJkQcpVcsVGZRELLCn
234
235 # Whether to receive ephemeral events via appservice transactions.
236 ephemeral_events: true
237 # Should incoming events be handled asynchronously?
238 # This may be necessary for large public instances with lots of messages going through.
239 # However, messages will not be guaranteed to be bridged in the same order they were sent in.
240 # This value doesn't affect the registration file.
241 async_transactions: false
242
243 # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
244 as_token: "This value is generated when generating the registration"
245 hs_token: "This value is generated when generating the registration"
246
247 # Localpart template of MXIDs for remote users.
248 # {{.}} is replaced with the internal ID of the user.
249 username_template: twitter_{{.}}
250
251# Config options that affect the Matrix connector of the bridge.
252matrix:
253 # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
254 message_status_events: false
255 # Whether the bridge should send a read receipt after successfully bridging a message.
256 delivery_receipts: false
257 # Whether the bridge should send error notices via m.notice events when a message fails to bridge.
258 message_error_notices: true
259 # Whether the bridge should update the m.direct account data event when double puppeting is enabled.
260 sync_direct_chat_list: true
261 # Whether created rooms should have federation enabled. If false, created portal rooms
262 # will never be federated. Changing this option requires recreating rooms.
263 federate_rooms: true
264 # The threshold as bytes after which the bridge should roundtrip uploads via the disk
265 # rather than keeping the whole file in memory.
266 upload_file_threshold: 5242880
267
268# Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors.
269analytics:
270 # API key to send with tracking requests. Tracking is disabled if this is null.
271 token: null
272 # Address to send tracking requests to.
273 url: https://api.segment.io/v1/track
274 # Optional user ID for tracking events. If null, defaults to using Matrix user ID.
275 user_id: null
276
277# Settings for provisioning API
278provisioning:
279 # Shared secret for authentication. If set to "generate" or null, a random secret will be generated,
280 # or if set to "disable", the provisioning API will be disabled. Must be at least 16 characters.
281 shared_secret: generate
282 # Whether to allow provisioning API requests to be authed using Matrix access tokens.
283 # This follows the same rules as double puppeting to determine which server to contact to check the token,
284 # which means that by default, it only works for users on the same server as the bridge.
285 allow_matrix_auth: true
286 # Enable debug API at /debug with provisioning authentication.
287 debug_endpoints: false
288 # Enable session transfers between bridges. Note that this only validates Matrix or shared secret
289 # auth before passing live network client credentials down in the response.
290 enable_session_transfers: false
291
292# Some networks require publicly accessible media download links (e.g. for user avatars when using Discord webhooks).
293# These settings control whether the bridge will provide such public media access.
294public_media:
295 # Should public media be enabled at all?
296 # The public_address field under the appservice section MUST be set when enabling public media.
297 enabled: false
298 # A key for signing public media URLs.
299 # If set to "generate", a random key will be generated.
300 signing_key: generate
301 # Number of seconds that public media URLs are valid for.
302 # If set to 0, URLs will never expire.
303 expiry: 0
304 # Length of hash to use for public media URLs. Must be between 0 and 32.
305 hash_length: 32
306 # The path prefix for generated URLs. Note that this will NOT change the path where media is actually served.
307 # If you change this, you must configure your reverse proxy to rewrite the path accordingly.
308 path_prefix: /_mautrix/publicmedia
309 # Should the bridge store media metadata in the database in order to support encrypted media and generate shorter URLs?
310 # If false, the generated URLs will just have the MXC URI and a HMAC signature.
311 # The hash_length field will be used to decide the length of the generated URL.
312 # This also allows invalidating URLs by deleting the database entry.
313 use_database: false
314
315# Settings for converting remote media to custom mxc:// URIs instead of reuploading.
316# More details can be found at https://docs.mau.fi/bridges/go/discord/direct-media.html
317direct_media:
318 # Should custom mxc:// URIs be used instead of reuploading media?
319 enabled: false
320 # The server name to use for the custom mxc:// URIs.
321 # This server name will effectively be a real Matrix server, it just won't implement anything other than media.
322 # You must either set up .well-known delegation from this domain to the bridge, or proxy the domain directly to the bridge.
323 server_name: discord-media.example.com
324 # Optionally a custom .well-known response. This defaults to `server_name:443`
325 well_known_response:
326 # Optionally specify a custom prefix for the media ID part of the MXC URI.
327 media_id_prefix:
328 # If the remote network supports media downloads over HTTP, then the bridge will use MSC3860/MSC3916
329 # media download redirects if the requester supports it. Optionally, you can force redirects
330 # and not allow proxying at all by setting this to false.
331 # This option does nothing if the remote network does not support media downloads over HTTP.
332 allow_proxy: true
333 # Matrix server signing key to make the federation tester pass, same format as synapse's .signing.key file.
334 # This key is also used to sign the mxc:// URIs to ensure only the bridge can generate them.
335 server_key: generate
336
337# Settings for backfilling messages.
338# Note that the exact way settings are applied depends on the network connector.
339# See https://docs.mau.fi/bridges/general/backfill.html for more details.
340backfill:
341 # Whether to do backfilling at all.
342 enabled: false
343 # Maximum number of messages to backfill in empty rooms.
344 max_initial_messages: 50
345 # Maximum number of missed messages to backfill after bridge restarts.
346 max_catchup_messages: 500
347 # If a backfilled chat is older than this number of hours,
348 # mark it as read even if it's unread on the remote network.
349 unread_hours_threshold: 720
350 # Settings for backfilling threads within other backfills.
351 threads:
352 # Maximum number of messages to backfill in a new thread.
353 max_initial_messages: 50
354 # Settings for the backwards backfill queue. This only applies when connecting to
355 # Beeper as standard Matrix servers don't support inserting messages into history.
356 queue:
357 # Should the backfill queue be enabled?
358 enabled: false
359 # Number of messages to backfill in one batch.
360 batch_size: 100
361 # Delay between batches in seconds.
362 batch_delay: 20
363 # Maximum number of batches to backfill per portal.
364 # If set to -1, all available messages will be backfilled.
365 max_batches: -1
366 # Optional network-specific overrides for max batches.
367 # Interpretation of this field depends on the network connector.
368 max_batches_override: {}
369
370# Settings for enabling double puppeting
371double_puppet:
372 # Servers to always allow double puppeting from.
373 # This is only for other servers and should NOT contain the server the bridge is on.
374 servers:
375 anotherserver.example.org: https://matrix.anotherserver.example.org
376 # Whether to allow client API URL discovery for other servers. When using this option,
377 # users on other servers can use double puppeting even if their server URLs aren't
378 # explicitly added to the servers map above.
379 allow_discovery: false
380 # Shared secrets for automatic double puppeting.
381 # See https://docs.mau.fi/bridges/general/double-puppeting.html for instructions.
382 secrets:
383 example.com: as_token:foobar
384
385# End-to-bridge encryption support options.
386#
387# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
388encryption:
389 # Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms.
390 allow: false
391 # Whether to force-enable encryption in all bridged rooms.
392 default: false
393 # Whether to require all messages to be encrypted and drop any unencrypted messages.
394 require: false
395 # Whether to use MSC3202/MSC4203 instead of /sync long polling for receiving encryption-related data.
396 # This option is not yet compatible with standard Matrix servers like Synapse and should not be used.
397 # Changing this option requires updating the appservice registration file.
398 appservice: false
399 # Whether to use MSC4190 instead of appservice login to create the bridge bot device.
400 # Requires the homeserver to support MSC4190 and the device masquerading parts of MSC3202.
401 # Only relevant when using end-to-bridge encryption, required when using encryption with next-gen auth (MSC3861).
402 # Changing this option requires updating the appservice registration file.
403 msc4190: false
404 # Should the bridge bot generate a recovery key and cross-signing keys and verify itself?
405 # Note that without the latest version of MSC4190, this will fail if you reset the bridge database.
406 # The generated recovery key will be saved in the kv_store table under `recovery_key`.
407 self_sign: false
408 # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
409 # You must use a client that supports requesting keys from other users to use this feature.
410 allow_key_sharing: true
411 # Pickle key for encrypting encryption keys in the bridge database.
412 # If set to generate, a random key will be generated.
413 pickle_key: generate
414 # Options for deleting megolm sessions from the bridge.
415 delete_keys:
416 # Beeper-specific: delete outbound sessions when hungryserv confirms
417 # that the user has uploaded the key to key backup.
418 delete_outbound_on_ack: false
419 # Don't store outbound sessions in the inbound table.
420 dont_store_outbound: false
421 # Ratchet megolm sessions forward after decrypting messages.
422 ratchet_on_decrypt: false
423 # Delete fully used keys (index >= max_messages) after decrypting messages.
424 delete_fully_used_on_decrypt: false
425 # Delete previous megolm sessions from same device when receiving a new one.
426 delete_prev_on_new_session: false
427 # Delete megolm sessions received from a device when the device is deleted.
428 delete_on_device_delete: false
429 # Periodically delete megolm sessions when 2x max_age has passed since receiving the session.
430 periodically_delete_expired: false
431 # Delete inbound megolm sessions that don't have the received_at field used for
432 # automatic ratcheting and expired session deletion. This is meant as a migration
433 # to delete old keys prior to the bridge update.
434 delete_outdated_inbound: false
435 # What level of device verification should be required from users?
436 #
437 # Valid levels:
438 # unverified - Send keys to all device in the room.
439 # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
440 # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
441 # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
442 # Note that creating user signatures from the bridge bot is not currently possible.
443 # verified - Require manual per-device verification
444 # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
445 verification_levels:
446 # Minimum level for which the bridge should send keys to when bridging messages from the remote network to Matrix.
447 receive: unverified
448 # Minimum level that the bridge should accept for incoming Matrix messages.
449 send: unverified
450 # Minimum level that the bridge should require for accepting key requests.
451 share: cross-signed-tofu
452 # Options for Megolm room key rotation. These options allow you to configure the m.room.encryption event content.
453 # See https://spec.matrix.org/v1.10/client-server-api/#mroomencryption for more information about that event.
454 rotation:
455 # Enable custom Megolm room key rotation settings. Note that these
456 # settings will only apply to rooms created after this option is set.
457 enable_custom: false
458 # The maximum number of milliseconds a session should be used
459 # before changing it. The Matrix spec recommends 604800000 (a week)
460 # as the default.
461 milliseconds: 604800000
462 # The maximum number of messages that should be sent with a given a
463 # session before changing it. The Matrix spec recommends 100 as the
464 # default.
465 messages: 100
466 # Disable rotating keys when a user's devices change?
467 # You should not enable this option unless you understand all the implications.
468 disable_device_change_key_rotation: false
469
470# Logging config. See https://github.com/tulir/zeroconfig for details.
471logging:
472 min_level: debug
473 writers:
474 - type: stdout
475 format: pretty-colored
476 - type: file
477 format: json
478 filename: ./logs/bridge.log
479 max_size: 100
480 max_backups: 10
481 compress: false