ansible-role-matterbridge/templates/matterbridge.toml

231 lines
9.4 KiB
TOML

###################################################################
#IRC section
###################################################################
[irc]
[irc.{{ matterbridge_config['bridge_name'] }}]
Server="{{ matterbridge_config['irc']['server'] }}"
UseTLS={{ matterbridge_config['irc']['use_tls'] | lower }}
SkipTLSVerify={{ matterbridge_config['irc']['skip_tls_verify'] | lower }}
Nick="{{ matterbridge_config['bot_nick'] }}"
UseSASL={{ matterbridge_config['irc']['use_sasl'] | lower }}
NickServNick="{{ matterbridge_config['bot_nick'] }}"
NickServPassword="{{ mbridge_irc_bot_pass }}"
Label="{{ matterbridge_config['irc']['label'] }}"
StripMarkdown="{{ matterbridge_config['irc']['strip_markdown'] | lower }}"
## RELOADABLE SETTINGS
## Settings below can be reloaded by editing the file
#Split messages on MessageLength instead of showing the <message clipped>
#WARNING: this could lead to flooding
#OPTIONAL (default false)
MessageSplit={{ matterbridge_config['irc']['message_split'] | lower }}
#ColorNicks will show each nickname in a different color.
#Only works in IRC right now.
ColorNicks={{ matterbridge_config['irc']['color_nicks'] | lower }}
#Nicks you want to ignore.
#Messages from those users will not be sent to other bridges.
#OPTIONAL
IgnoreNicks="{{ matterbridge_config['irc']['ignore_nicks'] | join(',') }}"
#Enable to show users joins/parts from other bridges
#Currently works for messages from the following bridges: irc, mattermost, slack
#OPTIONAL (default false)
ShowJoinPart={{ matterbridge_config['irc']['show_join_part'] | lower }}
#Enable to show topic changes from other bridges
#Only works hiding/show topic changes from slack bridge for now
#OPTIONAL (default false)
ShowTopicChange={{ matterbridge_config['irc']['show_topic_change'] | lower }}
###################################################################
#mattermost section
###################################################################
[mattermost]
#You can configure multiple servers "[mattermost.name]" or "[mattermost.name2]"
#In this example we use [mattermost.work]
#REQUIRED
[mattermost.{{ matterbridge_config['bridge_name'] }}]
Server="{{ matterbridge_config['mattermost']['server'] }}"
Team="{{ matterbridge_config['mattermost']['team'] }}"
Token="{{ mbridge_mattermost_token }}"
NoTLS=false
SkipTLSVerify=false
## RELOADABLE SETTINGS
## Settings below can be reloaded by editing the file
#how to format the list of IRC nicks when displayed in mattermost.
#Possible options are "table" and "plain"
#OPTIONAL (default plain)
NickFormatter="table "
#How many nicks to list per row for formatters that support this.
#OPTIONAL (default 4)
NicksPerRow=4
#Skip the Mattermost server version checks that are normally done when connecting.
#The usage scenario for this feature would be when the Mattermost instance is hosted behind a
#reverse proxy that suppresses "non-standard" response headers in flight.
#OPTIONAL (default false)
SkipVersionCheck=false
#Whether to prefix messages from other bridges to mattermost with the sender's nick.
#Useful if username overrides for incoming webhooks isn't enabled on the
#mattermost server. If you set PrefixMessagesWithNick to true, each message
#from bridge to Mattermost will by default be prefixed by "bridge-" + nick. You can,
#however, modify how the messages appear, by setting (and modifying) RemoteNickFormat
#OPTIONAL (default false)
PrefixMessagesWithNick=true
#Disable sending of edits to other bridges
#OPTIONAL (default false)
EditDisable=false
#Message to be appended to every edited message
#OPTIONAL (default empty)
EditSuffix=" (edited)"
#Nicks you want to ignore.
#Regular expressions supported
#Messages from those users will not be sent to other bridges.
#OPTIONAL
IgnoreNicks="{{ mbridge_mattermost_ignore_nicks }}"
#Messages you want to ignore.
#Messages matching these regexp will be ignored and not sent to other bridges
#See https://regex-golang.appspot.com/assets/html/index.html for more regex info
#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword
IgnoreMessages=""
#messages you want to replace.
#it replaces outgoing messages from the bridge.
#so you need to place it by the sending bridge definition.
#regular expressions supported
#some examples:
#this replaces cat => dog and sleep => awake
#replacemessages=[ ["cat","dog"], ["sleep","awake"] ]
#this replaces every number with number. 123 => numbernumbernumber
#replacemessages=[ ["[0-9]","number"] ]
#optional (default empty)
ReplaceMessages=[ ]
#nicks you want to replace.
#see replacemessages for syntaxa
#optional (default empty)
ReplaceNicks=[ ]
#Extractnicks is used to for example rewrite messages from other relaybots
#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466
#some examples:
#this replaces a message like "Relaybot: <relayeduser> something interesting" to "relayeduser: something interesting"
#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ]
#you can use multiple entries for multiplebots
#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else"
#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ]
#OPTIONAL (default empty)
ExtractNicks=[ ]
#extra label that can be used in the RemoteNickFormat
#optional (default empty)
Label="{{ matterbridge_config['mattermost']['label'] }}"
#Enable to show users joins/parts from other bridges
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
#OPTIONAL (default false)
ShowJoinPart=false
#Do not send joins/parts to other bridges
#Currently works for messages from the following bridges: irc, mattermost, slack
#OPTIONAL (default false)
NoSendJoinPart=true
#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285
#It will strip other characters from the nick
#OPTIONAL (default false)
StripNick=false
#Enable to show topic changes from other bridges
#Only works hiding/show topic changes from slack bridge for now
#OPTIONAL (default false)
ShowTopicChange=false
###################################################################
#General configuration
###################################################################
# Settings here are defaults that each protocol can override
[general]
## RELOADABLE SETTINGS
## Settings below can be reloaded by editing the file
#RemoteNickFormat defines how remote users appear on this bridge
#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username.
#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge
#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge
#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge
#The string "{GATEWAY}" (case sensitive) will be replaced by the origin gateway name that is replicating the message.
#The string "{CHANNEL}" (case sensitive) will be replaced by the origin channel name used by the bridge
#OPTIONAL (default empty)
RemoteNickFormat="<{NICK}> "
#MediaServerUpload (or MediaDownloadPath) and MediaServerDownload are used for uploading
#images/files/video to a remote "mediaserver" (a webserver like caddy for example).
#When configured images/files uploaded on bridges like mattermost, slack, telegram will be
#downloaded and uploaded again to MediaServerUpload URL
#MediaDownloadPath is the filesystem path where the media file will be placed, instead of uploaded,
#for if Matterbridge has write access to the directory your webserver is serving.
#It is an alternative to MediaServerUpload.
#The MediaServerDownload will be used so that bridges without native uploading support:
#gitter, irc and xmpp will be shown links to the files on MediaServerDownload
#
#More information https://github.com/42wim/matterbridge/wiki/Mediaserver-setup-%5Badvanced%5D
#OPTIONAL (default empty)
#MediaServerUpload="https://user:pass@yourserver.com/upload"
#OPTIONAL (default empty)
#MediaDownloadPath="/srv/http/yourserver.com/public/download"
#OPTIONAL (default empty)
#MediaServerDownload="https://youserver.com/download"
#MediaDownloadSize is the maximum size of attachments, videos, images
#matterbridge will download and upload this file to bridges that also support uploading files.
#eg downloading from slack to upload it to mattermost
#
#It will only download from bridges that don't have public links available, which are for the moment
#slack, telegram, matrix and mattermost
#
#OPTIONAL (default 1000000 (1 megabyte))
#MediaDownloadSize=1000000
#MediaDownloadBlacklist allows you to blacklist specific files from being downloaded.
#Filenames matching these regexp will not be download/uploaded to the mediaserver
#You can use regex for this, see https://regex-golang.appspot.com/assets/html/index.html for more regex info
#OPTIONAL (default empty)
#MediaDownloadBlacklist=[".html$",".htm$"]
###################################################################
#Gateway configuration
###################################################################
{% for gateway in matterbridge_config['gateways'] %}
[[gateway]]
name="{{ matterbridge_config['bridge_name'] }}.{{ gateway['mattermost_channel'] }}"
enable=true
[[gateway.inout]]
account="irc.{{ matterbridge_config['bridge_name'] }}"
channel="{{ gateway['irc_channel'] }}"
[[gateway.inout]]
account="mattermost.{{ matterbridge_config['bridge_name'] }}"
channel="{{ gateway['mattermost_channel'] }}"
{% endfor %}