From ccbda8d987b6cefd158dab2bd091384f0c67cf91 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Thu, 21 Oct 2021 22:42:01 +0200
Subject: [PATCH] matrix: Update bridge to 0.32.0

---
 roles/matrix/tasks/main.yml               |  2 +-
 roles/matrix/templates/irc-bridge.yaml.j2 | 26 ++++++++++++++++++++---
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/roles/matrix/tasks/main.yml b/roles/matrix/tasks/main.yml
index bc75b464e..76810cd91 100644
--- a/roles/matrix/tasks/main.yml
+++ b/roles/matrix/tasks/main.yml
@@ -147,7 +147,7 @@
   git:
     repo: https://github.com/matrix-org/matrix-appservice-irc
     dest: /var/lib/synapse/matrix-appservice-irc
-    version: 0.31.0
+    version: 0.32.0
   become: true
   become_user: synapse
   become_method: sudo
diff --git a/roles/matrix/templates/irc-bridge.yaml.j2 b/roles/matrix/templates/irc-bridge.yaml.j2
index 8a902e30e..988907c86 100644
--- a/roles/matrix/templates/irc-bridge.yaml.j2
+++ b/roles/matrix/templates/irc-bridge.yaml.j2
@@ -514,9 +514,20 @@ ircService:
     # allotted time period, the provisioning request will fail.
     # Default: 300 seconds (5 mins)
     requestTimeoutSeconds: 300
-    # A file defining the provisioning rules for rooms. Format is documented
-    # in rules.sample.yaml. Leave undefined to not specify any rules.
-    ruleFile: "./provisioning.rules.yaml"
+    # When provisioning a room, disallow rooms that match these critera
+    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"
+
     # Watch the file for changes, and apply the rules. Default: false
     enableReload: true
     # Number of channels allowed to be bridged
@@ -549,6 +560,15 @@ ircService:
     # how much time needs to pass between the reply and the original message to switch to the long format
     shortReplyTresholdSeconds: 300
 
+  # Maximum number of montly active users, beyond which the bridge gets blocked (both ways)
+  # RMAUlimit: 100
+
+  # userActivity:
+    # The "grace period" before we start counting users as active
+    # minUserActiveDays: 1
+    # Time before users are considered inactive again
+    # inactiveAfterDays: 30
+
   ircHandler:
     # Should we attempt to match an IRC side mention (nickaname match)
     # with the nickname's owner's matrixId, if we are bridging them?
-- 
GitLab