· 6 years ago · Mar 23, 2020, 01:54 PM
1ircService:
2 servers:
3 # The address of the server to connect to.
4 irc.freenode.net:
5 # A human-readable short name. This is used to label IRC status rooms
6 # where matrix users control their connections.
7 # E.g. 'ExampleNet IRC Bridge status'.
8 # It is also used in the Third Party Lookup API as the instance `desc`
9 # property, where each server is an instance.
10 name: "freenode"
11
12 #additionalAddresses: [ "irc2.example.com" ]
13 #
14 # [DEPRECATED] Use `name`, above, instead.
15 # A human-readable description string
16 # description: "Example.com IRC network"
17
18 # An ID for uniquely identifying this server amongst other servers being bridged.
19 # networkId: "example"
20
21 # URL to an icon used as the network icon whenever this network appear in
22 # a network list. (Like in the riot room directory, for instance.)
23 # icon: https://example.com/images/hash.png
24
25 # The port to connect to. Optional.
26 port: 6697
27 # Whether to use SSL or not. Default: false.
28 ssl: true
29 # Whether or not IRC server is using a self-signed cert or not providing CA Chain
30 sslselfsign: false
31 # Should the connection attempt to identify via SASL (if a server or user password is given)
32 # If false, this will use PASS instead. If SASL fails, we do not fallback to PASS.
33 sasl: false
34 # Whether to allow expired certs when connecting to the IRC server.
35 # Usually this should be off. Default: false.
36 allowExpiredCerts: false
37 # A specific CA to trust instead of the default CAs. Optional.
38 #ca: |
39 # -----BEGIN CERTIFICATE-----
40 # ...
41 # -----END CERTIFICATE-----
42
43 #
44 # The connection password to send for all clients as a PASS (or SASL, if enabled above) command. Optional.
45 # password: 'pa$$w0rd'
46 #
47 # Whether or not to send connection/error notices to real Matrix users. Default: true.
48 sendConnectionMessages: true
49
50 quitDebounce:
51 # Whether parts due to net-splits are debounced for delayMs, to allow
52 # time for the netsplit to resolve itself. A netsplit is detected as being
53 # a QUIT rate higher than quitsPerSecond. Default: false.
54 enabled: false
55 # The maximum number of quits per second acceptable above which a netsplit is
56 # considered ongoing. Default: 5.
57 quitsPerSecond: 5
58 # The time window in which to wait before bridging a QUIT to Matrix that occurred during
59 # a netsplit. Debouncing is jittered randomly between delayMinMs and delayMaxMs so that the HS
60 # is not sent many requests to leave rooms all at once if a netsplit occurs and many
61 # people to not rejoin.
62 # If the user with the same IRC nick as the one who sent the quit rejoins a channel
63 # they are considered back online and the quit is not bridged, so long as the rejoin
64 # occurs before the randomly-jittered timeout is not reached.
65 # Default: 3600000, = 1h
66 delayMinMs: 3600000 # 1h
67 # Default: 7200000, = 2h
68 delayMaxMs: 7200000 # 2h
69
70 # A map for conversion of IRC user modes to Matrix power levels. This enables bridging
71 # of IRC ops to Matrix power levels only, it does not enable the reverse. If a user has
72 # been given multiple modes, the one that maps to the highest power level will be used.
73 modePowerMap:
74 o: 50
75 v: 1
76
77 botConfig:
78 # Enable the presence of the bot in IRC channels. The bot serves as the entity
79 # which maps from IRC -> Matrix. You can disable the bot entirely which
80 # means IRC -> Matrix chat will be shared by active "M-Nick" connections
81 # in the room. If there are no users in the room (or if there are users
82 # but their connections are not on IRC) then nothing will be bridged to
83 # Matrix. If you're concerned about the bot being treated as a "logger"
84 # entity, then you may want to disable the bot. If you want IRC->Matrix
85 # but don't want to have TCP connections to IRC unless a Matrix user speaks
86 # (because your client connection limit is low), then you may want to keep
87 # the bot enabled. Default: true.
88 # NB: If the bot is disabled, you SHOULD have matrix-to-IRC syncing turned
89 # on, else there will be no users and no bot in a channel (meaning no
90 # messages to Matrix!) until a Matrix user speaks which makes a client
91 # join the target IRC channel.
92 # NBB: The bridge bot IRC client will still join the target IRC network so
93 # it can service bridge-specific queries from the IRC-side e.g. so
94 # real IRC clients have a way to change their Matrix display name.
95 # See https://github.com/matrix-org/matrix-appservice-irc/issues/55
96 enabled: true
97 # The nickname to give the AS bot.
98 nick: "MatrixBot"
99 # The password to give to NickServ or IRC Server for this nick. Optional.
100 # password: "helloworld"
101 #
102 # Join channels even if there are no Matrix users on the other side of
103 # the bridge. Set to false to prevent the bot from joining channels which have no
104 # real matrix users in them, even if there is a mapping for the channel.
105 # Default: true
106 joinChannelsIfNoUsers: true
107
108 # Configuration for PMs / private 1:1 communications between users.
109 privateMessages:
110 # Enable the ability for PMs to be sent to/from IRC/Matrix.
111 # Default: true.
112 enabled: true
113 # Prevent Matrix users from sending PMs to the following IRC nicks.
114 # Optional. Default: [].
115 # exclude: ["Alice", "Bob"] # NOT YET IMPLEMENTED
116
117 # Should created Matrix PM rooms be federated? If false, only users on the
118 # HS attached to this AS will be able to interact with this room.
119 # Optional. Default: true.
120 federate: true
121
122 # Configuration for mappings not explicitly listed in the 'mappings'
123 # section.
124 dynamicChannels:
125 # Enable the ability for Matrix users to join *any* channel on this IRC
126 # network.
127 # Default: false.
128 enabled: true
129 # Should the AS create a room alias for the new Matrix room? The form of
130 # the alias can be modified via 'aliasTemplate'. Default: true.
131 createAlias: true
132 # Should the AS publish the new Matrix room to the public room list so
133 # anyone can see it? Default: true.
134 published: true
135 # What should the join_rule be for the new Matrix room? If 'public',
136 # anyone can join the room. If 'invite', only users with an invite can
137 # join the room. Note that if an IRC channel has +k or +i set on it,
138 # join_rules will be set to 'invite' until these modes are removed.
139 # Default: "public".
140 joinRule: public
141 # This will set the m.room.related_groups state event in newly created rooms
142 # with the given groupId. This means flares will show up on IRC users in those rooms.
143 # This should be set to the same thing as namespaces.users.group_id in irc_registration.
144 # This does not alter existing rooms.
145 # Leaving this option empty will not set the event.
146 groupId: +myircnetwork:localhost
147 # Should created Matrix rooms be federated? If false, only users on the
148 # HS attached to this AS will be able to interact with this room.
149 # Default: true.
150 federate: true
151 # Force this room version when creating IRC channels. Beware if the homeserver doesn't
152 # support the room version then the request will fail. By default, no version is requested.
153 # roomVersion: "1"
154 # The room alias template to apply when creating new aliases. This only
155 # applies if createAlias is 'true'. The following variables are exposed:
156 # $SERVER => The IRC server address (e.g. "irc.example.com")
157 # $CHANNEL => The IRC channel (e.g. "#python")
158 # This MUST have $CHANNEL somewhere in it.
159 # Default: '#irc_$SERVER_$CHANNEL'
160 aliasTemplate: "#irc_$CHANNEL"
161 # A list of user IDs which the AS bot will send invites to in response
162 # to a !join. Only applies if joinRule is 'invite'. Default: []
163 # whitelist:
164 # - "@foo:example.com"
165 # - "@bar:example.com"
166 #
167 # Prevent the given list of channels from being mapped under any
168 # circumstances.
169 # exclude: ["#foo", "#bar"]
170
171 # excludedUsers:
172 # - regex: "@.*:evilcorp.com"
173 # kickReason: "We don't like Evilcorp"
174
175 # Configuration for controlling how Matrix and IRC membership lists are
176 # synced.
177 membershipLists:
178 # Enable the syncing of membership lists between IRC and Matrix. This
179 # can have a significant effect on performance on startup as the lists are
180 # synced. This must be enabled for anything else in this section to take
181 # effect. Default: false.
182 enabled: false
183
184 # Syncing membership lists at startup can result in hundreds of members to
185 # process all at once. This timer drip feeds membership entries at the
186 # specified rate. Default: 10000. (10s)
187 floodDelayMs: 10000
188
189 global:
190 ircToMatrix:
191 # Get a snapshot of all real IRC users on a channel (via NAMES) and
192 # join their virtual matrix clients to the room.
193 initial: false
194 # Make virtual matrix clients join and leave rooms as their real IRC
195 # counterparts join/part channels. Default: false.
196 incremental: false
197
198 matrixToIrc:
199 # Get a snapshot of all real Matrix users in the room and join all of
200 # them to the mapped IRC channel on startup. Default: false.
201 initial: false
202 # Make virtual IRC clients join and leave channels as their real Matrix
203 # counterparts join/leave rooms. Make sure your 'maxClients' value is
204 # high enough! Default: false.
205 incremental: false
206
207 # Apply specific rules to Matrix rooms. Only matrix-to-IRC takes effect.
208 rooms:
209 - room: "!fuasirouddJoxtwfge:localhost"
210 matrixToIrc:
211 initial: false
212 incremental: false
213
214 # Apply specific rules to IRC channels. Only IRC-to-matrix takes effect.
215 channels:
216 - channel: "#foo"
217 ircToMatrix:
218 initial: false
219 incremental: false
220
221 mappings:
222 # 1:many mappings from IRC channels to room IDs on this IRC server.
223 # The matrix room must already exist. Your matrix client should expose
224 # the room ID in a "settings" page for the room.
225 "#thepub":
226 roomIds: ["!kieouiJuedJoxtVdaG:localhost"]
227 # Channel key/password to use. Optional. If provided, matrix users do
228 # not need to know the channel key in order to join the channel.
229 # key: "secret"
230
231 # Configuration for virtual matrix users. The following variables are
232 # exposed:
233 # $NICK => The IRC nick
234 # $SERVER => The IRC server address (e.g. "irc.example.com")
235 matrixClients:
236 # The user ID template to use when creating virtual matrix users. This
237 # MUST have $NICK somewhere in it.
238 # Optional. Default: "@$SERVER_$NICK".
239 # Example: "@irc.example.com_Alice:example.com"
240 userTemplate: "@irc_$NICK"
241 # The display name to use for created matrix clients. This should have
242 # $NICK somewhere in it if it is specified. Can also use $SERVER to
243 # insert the IRC domain.
244 # Optional. Default: "$NICK (IRC)". Example: "Alice (IRC)"
245 displayName: "$NICK (IRC)"
246 # Number of tries a client can attempt to join a room before the request
247 # is discarded. You can also use -1 to never retry or 0 to never give up.
248 # Optional. Default: -1
249 joinAttempts: -1
250
251 # Configuration for virtual IRC users. The following variables are exposed:
252 # $LOCALPART => The user ID localpart ("alice" in @alice:localhost)
253 # $USERID => The user ID
254 # $DISPLAY => The display name of this user, with excluded characters
255 # (e.g. space) removed. If the user has no display name, this
256 # falls back to $LOCALPART.
257 ircClients:
258 # The template to apply to every IRC client nick. This MUST have either
259 # $DISPLAY or $USERID or $LOCALPART somewhere in it.
260 # Optional. Default: "M-$DISPLAY". Example: "M-Alice".
261 nickTemplate: "$DISPLAY[m]"
262 # True to allow virtual IRC clients to change their nick on this server
263 # by issuing !nick <server> <nick> commands to the IRC AS bot.
264 # This is completely freeform: it will NOT follow the nickTemplate.
265 allowNickChanges: true
266 # The max number of IRC clients that will connect. If the limit is
267 # reached, the client that spoke the longest time ago will be
268 # disconnected and replaced.
269 # Optional. Default: 30.
270 maxClients: 30
271 # IPv6 configuration.
272 ipv6:
273 # Optional. Set to true to force IPv6 for outgoing connections.
274 only: false
275 # Optional. The IPv6 prefix to use for generating unique addresses for each
276 # connected user. If not specified, all users will connect from the same
277 # (default) address. This may require additional OS-specific work to allow
278 # for the node process to bind to multiple different source addresses
279 # Linux kernels 4.3+ support sysctl net.ipv6.ip_nonlocal_bind=1
280 # Older kernels will need IP_FREEBIND, which requires an LD_PRELOAD with the library
281 # https://github.com/matrix-org/freebindfree as Node does not expose setsockopt.
282 # prefix: "2001:0db8:85a3::" # modify appropriately
283 #
284 # The maximum amount of time in seconds that the client can exist
285 # without sending another message before being disconnected. Use 0 to
286 # not apply an idle timeout. This value is ignored if this IRC server is
287 # mirroring matrix membership lists to IRC. Default: 172800 (48 hours)
288 idleTimeout: 10800
289 # The number of millseconds to wait between consecutive reconnections if a
290 # client gets disconnected. Setting to 0 will cause the scheduling to be
291 # disabled, i.e. it will be scheduled immediately (with jitter.
292 # Otherwise, the scheduling interval will be used such that one client
293 # reconnect for this server will be handled every reconnectIntervalMs ms using
294 # a FIFO queue.
295 # Default: 5000 (5 seconds)
296 reconnectIntervalMs: 5000
297 # The number of concurrent reconnects if a user has been disconnected unexpectedly
298 # (e.g. a netsplit). You should set this to a reasonably high number so that
299 # bridges are not waiting an eternity to reconnect all its clients if
300 # we see a massive number of disconnect. This is unrelated to the reconnectIntervalMs
301 # setting above which is for connecting on restart of the bridge. Set to 0 to
302 # immediately try to reconnect all users.
303 # Default: 50
304 concurrentReconnectLimit: 50
305 # The number of lines to allow being sent by the IRC client that has received
306 # a large block of text to send from matrix. If the number of lines that would
307 # be sent is > lineLimit, the text will instead be uploaded to matrix and the
308 # resulting URI is treated as a file. As such, a link will be sent to the IRC
309 # side instead of potentially spamming IRC and getting the IRC client kicked.
310 # Default: 3.
311 lineLimit: 3
312 # A list of user modes to set on every IRC client. For example, "RiG" would set
313 # +R, +i and +G on every IRC connection when they have successfully connected.
314 # User modes vary wildly depending on the IRC network you're connecting to,
315 # so check before setting this value. Some modes may not work as intended
316 # through the bridge e.g. caller ID as there is no way to /ACCEPT.
317 # Default: "" (no user modes)
318 # userModes: "R"
319 # Set information about the bridged channel in the room state, so that client's may
320 # present relevant UI to the user. MSC2346
321 bridgeInfoState:
322 enabled: false
323 initial: false
324 # Configuration for an ident server. If you are running a public bridge it is
325 # advised you setup an ident server so IRC mods can ban specific matrix users
326 # rather than the application service itself.
327 ident:
328 # True to listen for Ident requests and respond with the
329 # matrix user's user_id (converted to ASCII, respecting RFC 1413).
330 # Default: false.
331 enabled: false
332 # The port to listen on for incoming ident requests.
333 # Ports below 1024 require root to listen on, and you may not want this to
334 # run as root. Instead, you can get something like an Apache to yank up
335 # incoming requests to 113 to a high numbered port. Set the port to listen
336 # on instead of 113 here.
337 # Default: 113.
338 port: 1113
339 # The address to listen on for incoming ident requests.
340 # Default: 0.0.0.0
341 address: "::"
342
343 # Configuration for logging. Optional. Default: console debug level logging
344 # only.
345 logging:
346 # Level to log on console/logfile. One of error|warn|info|debug
347 level: "debug"
348 # The file location to log to. This is relative to the project directory.
349 logfile: "debug.log"
350 # The file location to log errors to. This is relative to the project
351 # directory.
352 errfile: "errors.log"
353 # Whether to log to the console or not.
354 toConsole: true
355 # The max number of files to keep. Files will be overwritten eventually due
356 # to rotations.
357 maxFiles: 5
358
359 # Metrics will then be available via GET /metrics on the bridge listening port (-p).
360 metrics:
361 # Whether to actually enable the metric endpoint. Default: false
362 enabled: true
363 # When collecting remote user active times, which "buckets" should be used. Defaults are given below.
364 # The bucket name is formed of a duration and a period. (h=hours,d=days,w=weeks).
365 remoteUserAgeBuckets:
366 - "1h"
367 - "1d"
368 - "1w"
369
370 # Configuration options for the debug HTTP API. To access this API, you must
371 # append ?access_token=$APPSERVICE_TOKEN (from the registration file) to the requests.
372 #
373 # The debug API exposes the following endpoints:
374 #
375 # GET /irc/$domain/user/$user_id => Return internal state for the IRC client for this user ID.
376 #
377 # POST /irc/$domain/user/$user_id => Issue a raw IRC command down this connection.
378 # Format: new line delimited commands as per IRC protocol.
379 #
380 debugApi:
381 # True to enable the HTTP API endpoint. Default: false.
382 enabled: false
383 # The port to host the HTTP API.
384 port: 11100
385
386 # Configuration for the provisioning API.
387 #
388 # GET /_matrix/provision/link
389 # GET /_matrix/provision/unlink
390 # GET /_matrix/provision/listlinks
391 #
392 provisioning:
393 # True to enable the provisioning HTTP endpoint. Default: false.
394 enabled: false
395 # The number of seconds to wait before giving up on getting a response from
396 # an IRC channel operator. If the channel operator does not respond within the
397 # allotted time period, the provisioning request will fail.
398 # Default: 300 seconds (5 mins)
399 requestTimeoutSeconds: 300
400 # A file defining the provisioning rules for rooms. Format is documented
401 # in rules.sample.yaml. Leave undefined to not specify any rules.
402 ruleFile: "./provisioning.rules.yaml"
403 # Watch the file for changes, and apply the rules. Default: false
404 enableReload: true
405
406 # WARNING: The bridge needs to send plaintext passwords to the IRC server, it cannot
407 # send a password hash. As a result, passwords (NOT hashes) are stored encrypted in
408 # the database.
409 #
410 # To generate a .pem file:
411 # $ openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048
412 #
413 # The path to the RSA PEM-formatted private key to use when encrypting IRC passwords
414 # for storage in the database. Passwords are stored by using the admin room command
415 # `!storepass server.name passw0rd. When a connection is made to IRC on behalf of
416 # the Matrix user, this password will be sent as the server password (PASS command).
417 passwordEncryptionKeyPath: "passkey.pem"
418
419 # Config for Matrix -> IRC bridging
420 matrixHandler:
421 # Cache this many matrix events in memory to be used for m.relates_to messages (usually replies).
422 eventCacheSize: 4096
423
424 ircHandler:
425 # How many /leave requests can be ongoing at a time.
426 # This is used to stem the flow of requests in case of a mass quit/leave, which might
427 # slow down the homeserver.
428 leaveConcurrency: 10
429 # Should we attempt to match an IRC side mention (nickaname match)
430 # with the nickname's owner's matrixId, if we are bridging them?
431 # "on" - Defaults to enabled, users can choose to disable.
432 # "off" - Defaults to disabled, users can choose to enable.
433 # "force-off" - Disabled, cannot be enabled.
434 mapIrcMentionsToMatrix: "on" # This can be "on", "off", "force-off".
435# Options here are generally only applicable to large-scale bridges and may have
436# consequences greater than other options in this configuration file.
437advanced:
438 # The maximum number of HTTP(S) sockets to maintain. Usually this is unlimited
439 # however for large bridges it is important to rate limit the bridge to avoid
440 # accidentally overloading the homeserver. Defaults to 1000, which should be
441 # enough for the vast majority of use cases.
442 maxHttpSockets: 1000
443 # Max size of an appservice transaction payload, in bytes. Defaults to 10Mb
444 maxTxnSize: 10000000
445
446# Capture information to a sentry.io instance
447sentry:
448 enabled: false
449 dsn: "https://<key>@sentry.io/<project>"
450 # Optional. A tag to specify the production environment. Not set by default
451 # environment: ""
452 # Optional. A tag to specify the server name. Not set by default
453 # serverName: ""