-
Notifications
You must be signed in to change notification settings - Fork 8
/
rdircd.defaults.ini
347 lines (317 loc) · 17.3 KB
/
rdircd.defaults.ini
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
;;;; List of ALL default configuration options as of version in "api-user-agent" below.
;; Do not overly rely on these being accurate, run "rdircd --conf-dump-defaults" yourself,
;; to get same exact thing, but 100% correct and up-to-date for the local/current version.
;; Don't copy/use this config as-is, just the values you set, to allow defaults to change.
;; Some optional sections like [replacements] or [unmonitor] are not represented here at all.
;; See also README.md file for better documentation on how to use most of these options.
;; ----------
;; Default configuration options
; This is a regular ini file with key=value lines under couple sections and ;-comments.
; String time intervals can be either simple floats (seconds) or stuff like
; "30s", "10min", "1h 20m", "1mo3d5h", etc - see parse_duration func for that.
; For values ending with whitespace (like prefixes) in ini config files,
; add backslash ("\") at the end after spaces, for example: prefix-edit = E: \
; Values starting with spaces/tabs should be prefixed
; with a backslash too. Example: prefix-guild-event = \ - ev
; "<xyz>-tbf" rate-limits are token-bucket specs in "interval[/rate][:burst]" format,
; where "interval[/rate]" part can be just interval in seconds (integer or real number),
; for example: 1/4:5 (interval=0.25s, rate=4/s, burst=5), 5 (burst=1), 0.5:10, 20:30,
; and also special "0" value can be used as "no rate limit", or "inf" for "always block".
[auth]
; email: discord account email, used to login there
email =
password =
; token: auto-fetched using email/password, unless mfa/captcha is in the way
token =
; token-manual: never fetch/refresh auth token, for captcha/mfa logins
token-manual = no
[irc]
; password-hash: use -H/--conf-pw-scrypt option to generate hash for this
password-hash =
; password: for plaintext password - do not use, use password-hash instead
password =
; port: irc listening port, can be set in -i/--irc-bind, see also TLS opts below
port = 6667
; host: socket bind addr, can be set via -i/--irc-bind cli option
host = 127.0.0.1
; host-af: address family - 0=any (auto-picked by getaddrinfo) 2=IPv4 10=IPv6
host-af = 0
; uid-seed: determines all generated unique-id tokens, like discord chan prefixes
uid-seed =
; uid-len: can be made longer to avoid clashes in various uid-tokens
uid-len = 4
; tls-pem-file: path to PEM file with cert and key to use TLS
; for all IRC connections, with default python/openssl server-side parameters.
; If file is specified but missing, it will be auto-generated by default.
tls-pem-file =
; tls-pem-gen-subj: "openssl req -subj" value to generate
; cert PEM file with, if specified path is missing. Empty - disabled.
tls-pem-gen-subj = /CN=rdircd
; motd-file-path: file path to read for motd command
motd-file-path =
; names-timeout: time since last activity to "forget" channel /names
names-timeout = 1d
; names-join: send irc-join msgs, for new channel users within names-timeout
names-join = yes
; nick-sys: nick used as source for info/error notice-msgs
nick-sys = core
; auth-tbf: token-bucket login-attempt rate-limiter, rate=1/30s burst=8
auth-tbf = 30:8
prefix-edit = [edit] \
prefix-attachment = [att] \
prefix-embed = [em.{}] \
prefix-sticker = [sticker] \
prefix-uis = [UIs] \
prefix-interact = [cmd] \
prefix-poll = [poll.{}] \
prefix-pinned = [pin] \
; prefix-guild-event: user bans, friend statuses, scheduled guild events, etc
prefix-guild-event = --- \
; prefix-event: user/chan events - reactions, voice-chats, statuses, gifts, etc
prefix-event = --- \
; prefix-all: universal prefix to add to all non-notice incoming messages
prefix-all =
; prefix-all-private: universal prefix to include in all incoming private-chat msgs
prefix-all-private =
; len-hwm: split irc lines when they're longer than hwm to lwm length
len-hwm = 450
len-lwm = 300
; len-dont-split-re: terminal links to avoid splitting
len-dont-split-re = \x1b\\(.*?)\x1b]8;;\x1b\\
; len-topic: cannot be split, so is truncated instead
len-topic = 300
; len-monitor: to tuncate long lines in #rdircd.monitor/leftover channels
len-monitor = 350
; len-monitor-lines: to limit multiline msgs in #rdircd.monitor/leftover channels
len-monitor-lines = 4
; chan-modes: causes needless spam on ZNC reconnects
chan-modes = no
; chan-auto-join-re: regexp to match against irc chan names to auto-join
chan-auto-join-re =
; disable-reactions: disables all "--- reacts" messages
disable-reactions = no
; inline-reply-quote-len: limits length of replied-to msgs, 0 = disable it
inline-reply-quote-len = 90
; ref-quote-len: len-limit on referenced msgs in reactions and such, 0 = hide those
ref-quote-len = 70
; private-chat-min-others-to-use-id-name: for #me.chat.user1+user2+... vs #me.chat.<id>
private-chat-min-others-to-use-id-name = 2
; private-chat-name-len: long userlist-name will truncate usernames, depends on client
private-chat-name-len = 120
; private-chat-name-user-min-len: don't truncate usernames in userlist-name beyond that
private-chat-name-user-min-len = 20
; thread-chan-name-len: truncate thread-name to this len in thread-chans, 0 = just id
thread-chan-name-len = 30
; chan-sys: name format for type=control and type=debug channels
chan-sys = rdircd.{type}
; chan-private: name format (python str.format) for private chat channels.
; {names} or {id} can be used instead of {names_or_id} to force e.g. #me.chat.<id> format.
; Formatting keys allowed here: names, id, names_or_id, chat_name
chan-private = chat.{names_or_id}
; chan-monitor: name of catch-all "monitor" channel for all msgs. Empty value - won't be created.
chan-monitor = rdircd.monitor
; chan-monitor-guild: name format of per-discord
; "monitor" channels for all msgs in there. Empty - disabled.
chan-monitor-guild = rdircd.monitor.{prefix}
; chan-leftover: name of "leftover" channel for any discord messages in channels that
; IRC client is not connected to. "monitor" channels don't count. Empty - won't be created.
chan-leftover = rdircd.leftover
; chan-leftover-guild: name of "leftover" chan for msgs in any
; non-joined channels of one specific discord server/guild. Empty - disable.
chan-leftover-guild = rdircd.leftover.{prefix}
; chan-voice: name for a global voice-chat notifications channel. Empty - won't be created.
chan-voice = rdircd.voice
; chan-voice-guild: per-discord voice-mon chans are default-disabled, set e.g. rdircd.voice.{prefix} to enable.
chan-voice-guild =
; typing-interval: interval (seconds) to repeat discord typing notifications, if client supports them.
; Discord sends typing notifications every ~10s, ircv3 requires these to be every 3-6s.
; Default is "repeat +1 notification 4.5s after one from discord", so that in
; ~10s irc client either assumes that typing stopped or gets new one from discord.
; Setting interval to 0 hard-disables all typing notifications entirely.
; Setting timeout to 0 will only proxy notifications from discord as-is.
typing-interval = 4.5
; typing-timeout: timeout after which typing-notification repeats stop
typing-timeout = 6.0
; topic-*: topic templates for all channels, using python str.format templating
; Following template-vars are available, where they make sense, empty strings otherwise:
; guild_id, guild_name, guild_prefix, chan_id, chan_tags, chan_topic
topic-control = rdircd: control channel, type "help" for more info
topic-debug = rdircd: debug logging channel, type "help" for more info
topic-monitor = rdircd: read-only catch-all channel with messages from everywhere
topic-monitor-guild = rdircd: [ {guild_name} ] read-only catch-all channel for discord
topic-leftover = rdircd: read-only channel for any discord messages in channels that IRC client is not connected to
topic-leftover-guild = rdircd: [ {guild_name} ] read-only msgs for non-joined channels of discord
topic-voice = rdircd: read-only voice-chat notifications from all discords/channels
topic-voice-guild = rdircd: [ {guild_name} ] read-only voice-chat events for discord
topic-channel = {guild_name}: {chan_tags}{chan_topic}
[discord]
auto-connect = yes
api-url = https://discord.com/api/v{api_ver}/
api-user-agent = rdircd/24.08.14 (reliable-discord-irc-client) aiohttp/3.10.3
ws-conn-timeout = 20.0
ws-heartbeat = 15.0
; ws-auth-timeout: reconnect websocket if auth process lags too badly
ws-auth-timeout = 60.0
ws-reconnect-min = 70s
ws-reconnect-max = 12min
ws-reconnect-factor = 1.6
; ws-reconnect-warn-tbf: rate-limit to filter-out expected reconnects
ws-reconnect-warn-tbf = 1800:6
; ws-reconnect-warn-max-delay: log warnings when reconnects reached max delay
ws-reconnect-warn-max-delay = yes
; ws-reconnect-warn-always: log warning with session info on every reconnect
ws-reconnect-warn-always = no
; ws-reconnect-on-auth-fail: useful for discord service disruptions
ws-reconnect-on-auth-fail = no
; http-delay-padding: added to retry_after
http-delay-padding = 10.0
http-timeout-conn = 40.0
http-timeout-conn-sock = 30.0
; gateway: fetched and stored in last config, region-specific
gateway =
; name-preference-order: determines which name is used for discord users on IRC.
; Following name options are available: login display nick
; "login" is always used as a fallback, if no other names are set,
; but otherwise names above can be listed in order to attempt using them.
; For example, "nick display" value will try discord/friend nickname,
; then name that user set in account settings, and login name if there aren't any of those.
name-preference-order = nick display login
; msg-mention-re should match only discord user mentions.
; "nick" group must be irc nick, to be replaced with
; discord user-id tag, all other capturing groups are replaced by "".
; Don't use repeating/overlapping capturing groups (w/o "?:"). Empty value - disable.
msg-mention-re = (?:^|\s)(@)(?P<nick>[^\s,;@+]+)
; msg-mention-re-ignore is matched
; against full capture of the regexp above, not full line.
msg-mention-re-ignore = @(?:everyone|here)
; msg-mention-irc-decode: try irc_name_revert on mention-matches from irc
msg-mention-irc-decode = yes
; msg-confirm-timeout: can include extra requests to resolve user-mentions
msg-confirm-timeout = 25.0
; user-mention-cache-timeout: to remember nicks for user-mentions
user-mention-cache-timeout = 3d
user-query-timeout = 60.0
; user-query-limit: max results to return for mentions and /who queries
user-query-limit = 5
; media-info-timeout: ignore no-author attachment updates for old msgs
media-info-timeout = 30m
; msg-edit-re is a regexp to match follow-up last-message edits, e.g. s/aaa/bbb/.
; "aaa" group is used as a python regexp to match what to replace, "bbb" - replacement.
; Any msg matched by this regexp is treated as edit for re.sub(), never sent to channel.
; If re.sub() with these parameters makes no replacement(s), error notice is generated.
; Default regex matches s/A/B/ or s|A|B| or s:A:B: - sed/perl-like regexp-replace expressions.
msg-edit-re = ^\s*s(?P<sep>[/|:])(?P<aaa>.*)(?P=sep)(?P<bbb>.*)(?P=sep)\s*$
; msg-del-re: deletes last-sent msg, if matched, never sent to channel
msg-del-re = ^\s*//del\s*$
; msg-flag-silent-re: suppress push notifications for this message and remove regexp-matched part.
; Default is to match same @silent prefix as is used by the official discord client.
msg-flag-silent-re = ^@silent(\s|$)
; thread-id-prefix: prefix for thread-id values, used in thread-chan names
; and msg prefixes if propagation from these to parent channel is enabled.
thread-id-prefix = =
; thread-msgs-in-parent-chan: propagates messages from threads to a parent channel,
; adding thread-id prefix, through which response can be redirected as well, if enabled.
thread-msgs-in-parent-chan = yes
; thread-msgs-in-parent-chan-monitor: enable to see mirrored msgs
; in #rdircd.monitor channel(s) too - e.g. to have it all there as-is.
thread-msgs-in-parent-chan-monitor = no
; thread-msgs-in-parent-chan-full-prefix: enable to use full
; chan-name prefix instead of shorter thread-id, for IRC clients with easy click-to-join.
thread-msgs-in-parent-chan-full-prefix = no
; thread-redirect-prefixed-responses-from-parent-chan allows to send msgs
; to threads from parent channel by prepending thread-id prefix to each one of these.
; For example "=vot5 hi!" will send "hi!" msg to =vot5 thread
; sub-channel only, or print an error if such thread-id is not recognized.
thread-redirect-prefixed-responses-from-parent-chan = yes
; embed-info: print info for some embedded youtube, twitter, etc links, if/when discord provides it
embed-info = yes
; embed-info-buffer: last N links to remember for delayed annotation updates
embed-info-buffer = 40
; embed-info-len: will truncate long youtube titles and twitter msgs
embed-info-len = 250
; terminal-links: replace attachment URLs with OSC 8 terminal links, if enabled.
terminal-links = no
; terminal-links-re: regexp for which parts of the URL to use in OSC 8 hyperlink names.
; Can have "name" and "hash" capture groups, with only "name" being mandatory.
; Non-empty "hash" group will be hashed to short tag to tell same-name links apart.
terminal-links-re = ^https://cdn\.discordapp\.com/attachments/(?P<hash>[\d/]+/(?P<name>.+?)\?.*)
; terminal-links-emojis: use links for posted emoji-images instead of long CDN URLs, if enabled.
terminal-links-emojis = yes
; terminal-links-tpl: template for OSC 8 terminal hyperlink. Should have "url" and "name" keys in it.
; See also corresponding [irc] len-dont-split-re opt to avoid breaking these links in long msgs.
terminal-links-tpl = \e]8;;{url}\e\{name}\e]8;;\e\
; chan-dedup-fmt: how same-irc-name discord chans get disambiguated
chan-dedup-fmt = {name}.{id_hash}
; chan-dedup-hash-len: length of id_hash part in chan-dedup-fmt
chan-dedup-hash-len = 4
; msg-interact-cache: in-memory cache(s) to "remember" messages to provide context
; for various interactions with those - reactions, some bot-annotations and deletions.
; Disable this option to not use such caches, and flush them if done at runtime.
; These caches can hold/share ref to same msgs, any cache keeping the ref will be used.
; This does not affect edits or replies. See also "cache-stats" in the control channel.
; Large cache sizes with many joined discords can use significant amount of memory,
; e.g. with rough estimate around 200B per cached msg, full default ~10K cache is ~2 MiB.
msg-interact-cache = yes
; msg-interact-cache-hot: for N last-interacted-with msgs
msg-interact-cache-hot = 1000
; msg-interact-cache-shared: last N msgs to keep in general
msg-interact-cache-shared = 10000
; msg-interact-cache-per-discord: keeps last N msgs per-discord
msg-interact-cache-per-discord = 1000
; msg-interact-cache-per-chan: last N msgs per-discord-channel buffer
msg-interact-cache-per-chan = 100
; msg-interact-cache-expire: forget cached msgs older than this
msg-interact-cache-expire = 2d16h
; voice-notify-after-inactivity: issue notices in *.vc chans for voice-chats after inactivity.
; Otherwise notices are only sent when voice chat toggles between empty/non-empty.
; Can be set to 0 to notify about every voice event (spammy), or to e.g. 1y
; (any large timespan) to notify only when voice-chat changes between empty/non-empty.
voice-notify-after-inactivity = 20m
; voice-notify-rate-limit-tbf: token-bucket rate limit on all voice-chat notices in vc-channel.
; Can be used with after-inactivity=0 to send simple
; rate-limited notifications instead of tracking active/inactive state.
; Value like 300:3 means "token-bucket algorithm with rate=1/300s burst=5".
voice-notify-rate-limit-tbf = 300:5
; voice-join-left-cache-expire: used to cleanup user-joined/left tracking info
voice-join-left-cache-expire = 7d
; match-counters: timespan-counters to keep for last per-pattern matches of [unmonitor],
; [send-replacements], [recv-regexp-filters] and other rules in similar config sections.
; Value should be a space-separated list of intervals, or a special "runtime" span.
; Counters for rule hits within "last N" interval are printed in control-channel rule listings.
; Example counter values, with a setting like this: match-counters = 2h30m 1d 2w runtime
; [ rule hits: 2h30m=505 1d=46,933 2w=679,853 runtime=10,184,461 ]
; ...where "2h30m=505" means "505 rule hits within last 2 hours 30 minutes" and so on.
match-counters =
[debug]
; verbose: for debug-level stderr and debug channel, same as --debug option
verbose = no
; err-cut: for various error messages from discord, which can be long html junk
err-cut = 150
; msg-cut: message part length in debug logs
msg-cut = 50
; proto-log-shared: send protocol logs to normal debug logging and log-file too
proto-log-shared = yes
; proto-cut: cut-length for irc/discord protocol msgs in debug logs, if shared
proto-cut = 90
; proto-log-file: log file(s) for all irc/discord protocol messages
proto-log-file =
proto-log-file-size = 1500000
proto-log-file-count = 9
; proto-log-filter-ws: space-separated received ws events to drop from protocol logs
proto-log-filter-ws = guild_member_list_update typing_start
; proto-aiohttp: log aiohttp request/response info in proto-log
proto-aiohttp = yes
; log-file: debug-level log, not affected by "verbose" option
log-file =
log-file-size = 1500000
log-file-count = 9
; chan-proto-cut: limit for printing protocol msgs via debug-channel command
chan-proto-cut = 230
chan-proto-tail = 50
; asyncio-logs: debug= value in asyncio.run()
asyncio-logs = no
; dev-cmds: enables developer-aid state-save/load cmds in control-channel
dev-cmds = no
; mean-minutes-to-segfault: randomly segfault-crash every 1<n<2*mmts
; minutes, for backwards-compatibility with various legacy C daemons :)
mean-minutes-to-segfault = 0.0