Skip to content

Commit 183b9ba

Browse files
authored
Merge in newer matterbridge config (#111)
* update IRC nick * hook up nickserv information for IRC * include protocol in IRC nicks, while still overriding so that the nicks dont ping * add a discord section to the config, using a nested structure like the gateways portion This is because each server is essentially its own "network". While they all currently share the same bot token they don't have to * add some explaination to the structure of the config * add docs links for discord bot setup * telegram section * matrix section * move enabled values into main vars file * add additional channels to fossrit main bridge * slack is probably dead * dedup * fossrit infra bridge * add config for the discord bridge group * update the vault credentials too * adjust comment format to be valid toml
1 parent 2461ba7 commit 183b9ba

File tree

3 files changed

+322
-24
lines changed

3 files changed

+322
-24
lines changed

roles/matterbridge/templates/matterbridge.toml

Lines changed: 172 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ UseSASL=false
1111

1212
Nick="{{ default_irc_bot_nick }}"
1313
#UseSASL=true
14-
#NickServNick=""
15-
#NickServPassword=""
14+
NickServNick="NickServ"
15+
NickServPassword="{{ default_irc_bot_nickserv_pass }}"
1616

1717
## RELOADABLE SETTINGS
1818
## Settings below can be reloaded by editing the file
@@ -32,7 +32,7 @@ ColorNicks=true
3232
IgnoreNicks="{{ default_irc_ignore_nicks }}"
3333

3434
#RemoteNickFormat defines how remote users appear on this bridge
35-
RemoteNickFormat="<{NOPINGNICK}> "
35+
RemoteNickFormat="[{PROTOCOL}] <{NOPINGNICK}> "
3636

3737
#Enable to show users joins/parts from other bridges
3838
#Currently works for messages from the following bridges: irc, mattermost, slack
@@ -87,6 +87,111 @@ IgnoreNicks="{{ default_slack_ignore_nicks }}"
8787
PreserveThreading=true
8888

8989

90+
###################################################################
91+
#discord section
92+
###################################################################
93+
# Setting up a new discord bot
94+
# You can get your token by following the instructions on
95+
# https://github.com/42wim/matterbridge/wiki/Discord-bot-setup
96+
# in particular that the "Members Intent" checkbox is important.
97+
# If you want roles/groups mentions to be shown with names instead of ID,
98+
# you'll need to give your bot the "Manage Roles" permission.
99+
# the oauth url to invite the bot to your server is also availble in this discord developer page
100+
101+
[discord]
102+
[discord.{{matterbridge_networks.fossrit_discord.network_name}}]
103+
Label="{{matterbridge_networks.fossrit_discord.label}}" # discord doesnt like having the word "discord" in the usernames when the bot proxies them.
104+
Token="{{matterbridge_networks.fossrit_discord.bot_token}}"
105+
Server="{{matterbridge_networks.fossrit_discord.server_id}}"
106+
AutoWebhooks=true
107+
# Map threads from other bridges on discord replies
108+
PreserveThreading=true
109+
# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user.
110+
# At the moment, this setting is only available for Discord.
111+
UseLocalAvatar=["discord"]
112+
# here we override the default RemoteNickFormat so we can use labels to differentiate the different discord servers
113+
RemoteNickFormat="[{LABEL}] <{NICK}> "
114+
115+
116+
[discord.{{matterbridge_networks.rit_framework_discord.network_name}}]
117+
Label="{{matterbridge_networks.rit_framework_discord.label}}" # discord doesnt like having the word "discord" in the usernames when the bot proxies them.
118+
Token="{{matterbridge_networks.rit_framework_discord.bot_token}}"
119+
Server="{{matterbridge_networks.rit_framework_discord.server_id}}"
120+
AutoWebhooks=true
121+
# Map threads from other bridges on discord replies
122+
PreserveThreading=true
123+
# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user.
124+
# At the moment, this setting is only available for Discord.
125+
UseLocalAvatar=["discord"]
126+
# here we override the default RemoteNickFormat so we can use labels to differentiate the different discord servers
127+
RemoteNickFormat="[{LABEL}] <{NICK}> "
128+
129+
[discord.{{matterbridge_networks.ritsec_discord.network_name}}]
130+
Label="{{matterbridge_networks.ritsec_discord.label}}" # discord doesnt like having the word "discord" in the usernames when the bot proxies them.
131+
Token="{{matterbridge_networks.ritsec_discord.bot_token}}"
132+
Server="{{matterbridge_networks.ritsec_discord.server_id}}"
133+
AutoWebhooks=true
134+
# Map threads from other bridges on discord replies
135+
PreserveThreading=true
136+
# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user.
137+
# At the moment, this setting is only available for Discord.
138+
UseLocalAvatar=["discord"]
139+
# here we override the default RemoteNickFormat so we can use labels to differentiate the different discord servers
140+
RemoteNickFormat="[{LABEL}] <{NICK}> "
141+
142+
[discord.{{matterbridge_networks.nexthop_discord.network_name}}]
143+
Label="{{matterbridge_networks.nexthop_discord.label}}" # discord doesnt like having the word "discord" in the usernames when the bot proxies them.
144+
Token="{{matterbridge_networks.nexthop_discord.bot_token}}"
145+
Server="{{matterbridge_networks.nexthop_discord.server_id}}"
146+
AutoWebhooks=true
147+
# Map threads from other bridges on discord replies
148+
PreserveThreading=true
149+
# UseLocalAvatar specifies source bridges for which an avatar should be 'guessed' when an incoming message has no avatar. This works by comparing the username of the message to an existing Discord user, and using the avatar of the Discord user.
150+
# At the moment, this setting is only available for Discord.
151+
UseLocalAvatar=["discord"]
152+
# here we override the default RemoteNickFormat so we can use labels to differentiate the different discord servers
153+
RemoteNickFormat="[{LABEL}] <{NICK}> "
154+
155+
###################################################################
156+
#telegram section
157+
###################################################################
158+
#See https://core.telegram.org/bots#6-botfather
159+
#and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau for more information on how to create a telegram bot
160+
[telegram]
161+
[telegram.{{matterbridge_networks.fossrit_telegram.network_name}}]
162+
Label="{{matterbridge_networks.fossrit_telegram.label}}"
163+
Token="{{matterbridge_networks.fossrit_telegram.bot_token}}"
164+
165+
#QuoteFormat="{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
166+
QuoteLengthLimit=46
167+
UseFirstName=true
168+
169+
###################################################################
170+
#matrix section
171+
###################################################################
172+
[matrix]
173+
[matrix.{{matterbridge_networks.fossrit_matrix.network_name}}]
174+
Label="{{matterbridge_networks.fossrit_matrix.label}}"
175+
Server="{{matterbridge_networks.fossrit_matrix.homeserver}}"
176+
177+
#login/pass of your bot.
178+
#Use a dedicated user for this and not your own!
179+
#Messages sent from this user will not be relayed to avoid loops.
180+
Login="fossrit_bridge"
181+
Password="{{matterbridge_networks.fossrit_matrix.matrix_password}}"
182+
183+
#Alternatively you can use MXID and access token (open https://app.element.io/
184+
#in INCOGNITO mode, open Settings -> lowest tab and above "clear cache and reload"
185+
#you can find the access token. Close the window without logging out
186+
#(or the token gets invalid (if it leaks, it can be removed by logging in and using the sessions menu))
187+
#MxID="@yourbot:example.net"
188+
#Token="tokenforthebotuser"
189+
190+
#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org
191+
#to other bridges, or only send "username".(true only sends username)
192+
#OPTIONAL (default false)
193+
NoHomeServerSuffix=false
194+
90195
###################################################################
91196
#General configuration
92197
###################################################################
@@ -147,7 +252,7 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
147252

148253
[[gateway]]
149254
name="gateway_rit"
150-
enable=true
255+
enable={{ matterbridge_config.rit.enabled }}
151256

152257
[[gateway.inout]]
153258
account="irc.{{ default_irc_network_name }}"
@@ -157,21 +262,75 @@ enable=true
157262
account="slack.{{ default_slack_team_name }}"
158263
channel="{{ matterbridge_config.rit.slack.channel }}"
159264

265+
[[gateway]]
266+
name="gateway_rit_foss_infra"
267+
enable={{ matterbridge_config.rit_foss_infra.enabled }}
268+
269+
[[gateway.inout]]
270+
account="irc.{{ default_irc_network_name }}"
271+
channel="{{ matterbridge_config.rit_foss_infra.irc.channel }}"
272+
273+
[[gateway.inout]]
274+
account="discord.{{ matterbridge_networks.fossrit_discord.network_name }}"
275+
channel="{{ matterbridge_config.rit_foss_infra.discord.channel }}"
276+
277+
[[gateway.inout]]
278+
account="telegram.{{ matterbridge_networks.fossrit_telegram.network_name }}"
279+
channel="{{ matterbridge_config.rit_foss_infra.telegram.channel }}"
280+
281+
[[gateway.inout]]
282+
account="matrix.{{ matterbridge_networks.fossrit_discord.network_name }}"
283+
channel="{{ matterbridge_config.rit_foss_infra.matrix.channel }}"
284+
160285
[[gateway]]
161286
name="gateway_rit_foss"
162-
enable=true
287+
enable={{ matterbridge_config.rit_foss.enabled }}
163288

164289
[[gateway.inout]]
165290
account="irc.{{ default_irc_network_name }}"
166291
channel="{{ matterbridge_config.rit_foss.irc.channel }}"
167292

293+
# [[gateway.inout]]
294+
# account="slack.{{ default_slack_team_name }}"
295+
# channel="{{ matterbridge_config.rit_foss.slack.channel }}"
296+
168297
[[gateway.inout]]
169-
account="slack.{{ default_slack_team_name }}"
170-
channel="{{ matterbridge_config.rit_foss.slack.channel }}"
298+
account="discord.{{ matterbridge_networks.fossrit_discord.network_name }}"
299+
channel="{{ matterbridge_config.rit_foss.discord.channel }}"
300+
301+
[[gateway.inout]]
302+
account="telegram.{{ matterbridge_networks.fossrit_telegram.network_name }}"
303+
channel="{{ matterbridge_config.rit_foss.telegram.channel }}"
304+
305+
[[gateway.inout]]
306+
account="matrix.{{ matterbridge_networks.fossrit_discord.network_name }}"
307+
channel="{{ matterbridge_config.rit_foss.matrix.channel }}"
308+
309+
# this is a bridge between the #foss channels in many different RIT discord servers
310+
[[gateway]]
311+
name="gateway_rit_foss_discord_bridge"
312+
enable={{ matterbridge_config.rit_foss_discord_bridge.enabled }}
313+
314+
[[gateway.inout]]
315+
account="discord.{{ matterbridge_networks.fossrit_discord.network_name }}"
316+
channel="{{ matterbridge_config.rit_foss_discord_bridge.fossrit.channel }}"
317+
318+
[[gateway.inout]]
319+
account="discord.{{ matterbridge_networks.rit_framework_discord.network_name }}"
320+
channel="{{ matterbridge_config.rit_foss_discord_bridge.ritframework.channel }}"
321+
322+
[[gateway.inout]]
323+
account="discord.{{ matterbridge_networks.ritsec_discord.network_name }}"
324+
channel="{{ matterbridge_config.rit_foss_discord_bridge.ritsec.channel }}"
325+
326+
[[gateway.inout]]
327+
account="discord.{{ matterbridge_networks.nexthop_discord.network_name }}"
328+
channel="{{ matterbridge_config.rit_foss_discord_bridge.nexthop.channel }}"
329+
171330

172331
[[gateway]]
173332
name="gateway_rit_lug"
174-
enable=true
333+
enable={{ matterbridge_config.rit_lug.enabled }}
175334

176335
[[gateway.inout]]
177336
account="irc.{{ default_irc_network_name }}"
@@ -183,7 +342,7 @@ enable=true
183342

184343
[[gateway]]
185344
name="gateway_rit_lug_projects"
186-
enable=true
345+
enable={{ matterbridge_config.rit_lug_projects.enabled }}
187346

188347
[[gateway.inout]]
189348
account="irc.{{ default_irc_network_name }}"
@@ -195,7 +354,7 @@ enable=true
195354

196355
[[gateway]]
197356
name="gateway_rit_lug_sysadmin"
198-
enable=true
357+
enable={{ matterbridge_config.rit_lug_sysadmin.enabled }}
199358

200359
[[gateway.inout]]
201360
account="irc.{{ default_irc_network_name }}"
@@ -207,7 +366,7 @@ enable=true
207366

208367
[[gateway]]
209368
name="gateway_rit_lug_teleirc"
210-
enable=true
369+
enable={{ matterbridge_config.rit_lug_teleirc.enabled }}
211370

212371
[[gateway.inout]]
213372
account="irc.{{ default_irc_network_name }}"
@@ -219,7 +378,7 @@ enable=true
219378

220379
[[gateway]]
221380
name="gateway_rit_python"
222-
enable=true
381+
enable={{ matterbridge_config.rit_python.enabled }}
223382

224383
[[gateway.inout]]
225384
account="irc.{{ default_irc_network_name }}"
@@ -231,7 +390,7 @@ enable=true
231390

232391
[[gateway]]
233392
name="gateway_rit_tigeros"
234-
enable=true
393+
enable={{ matterbridge_config.rit_tigeros.enabled }}
235394

236395
[[gateway.inout]]
237396
account="irc.{{ default_irc_network_name }}"

0 commit comments

Comments
 (0)