Skip to main content

Setting up the IRC Bridge

Overview

The IRC bridge allows you to bridge IRC servers into your Element server.

To configure the irc bridge, beging by copying config-sample/ircbridge/bridge.yml to CONFIG_DIR/ircbridge/bridge.yml. Then edit the file and set the following settings:

  • key_file: passkey.pem To generate the passkey.pem file, please run the following in the CONFIG_DIR/ircbridge directory: openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048
  • postgres_fqdn: ircbridge-postgres Use ircbridge-postgres if using postgres-create-in-cluster otherwise point this at your external database.
  • postgres_user: ircbridge Leave this if you are using postgres-create-in-cluster.
  • postgres_db: ircbridge Leave this if you are using postgres-create-in-cluster.
  • postgres_password: postgres_password Set this to either your password for the user connecting to an existing database, or if using postgres_create_in_cluster, set this to a new password with pwgen 32 1.
  • # postgres_create_in_cluster: true # uncomment if you want the installer to install postgresql for you. Not supported with the multi-node installer, where you must use an external postgres.
  • postgres_port Can be used to specify a non-standard port. 5432 is used if not specified. Optional
  • postgres_sslmode Can be used to specify the sslmode for the Postgres connection. Options are 'disable', 'no-verify' or 'verify-full'. 'disable' is used if not specified. Optional
  • Now specify a list of Matrix IDs that have admin access to the IRC bridge such as:
    admins:
    - "@adminuser:dev.local"
    - "@adminuser2:dev2.local"
    
  • enable_presence: true This determines if presence is presented to IRC or not.
  • drop_matrix_messages_after_seconds: 0
  • bot_username: "ircbridgebot" The name of the bot.
  • enable_ident: false Whether or not to enable IRC ident.
  • ident_port_type: # HostPort or NodePort Required if enabling ident.
  • ident_port_number: 10230 Required if enabling ident.
  • logging_level: info Set the default logging level of the bridge.
  • enable_provisioning: true

Next, we have the provisioning rules section, which will make sure that rooms are not bridged if a match is made on these rules. This is useful for preventing bad actors on Matrix from flooding IRC. This section looks like:

provisioning_rules:
 # The bridge checks the joined members of a propective room and checks to see
 # if any users matching these regex sets are in the room. `exempt` users never
 # match, and will be ignored. If any user matches `conflict`, the room will not
 # be allowed to be bridged until the user is removed. Both sets take a regular expression.
 userIds:
   exempt:
     # These users never conflict, even if matching
     - "@doubleagent:badguys.com"
   conflict:
     # These users will deny a room from being bridged.
     - "@.*:badguys.com"
provisioning_room_limit: 50
  • rmau_limit: 100 Set this to the maximum number of remote monthly active users that you would like to allow in a bridged IRC room.
  • users_prefix: "irc_" Set a user prefix for irc users.
  • alias_prefix: "irc_" Set an alias prefix for irc users.
  • address: irc.someserver.net The adress of the irc server to bridge. Now for the above IRC server, we have a set of parameters that can be set:
  • name: "Server Name" The server name to show on the bridge. Now below that, you'll see the botConfig with these parameters:
  • enabled: true Leave this on.
  • nick: "MatrixBot" Nick of the bridge bot
  • username: "matrixbot" Username of the bridge bot.
  • password: "some_password" Password of the bridge bot. Generate this with pwgen 32 1

For other settings that can also be applied to this config file, please see:https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml#L52