summary refs log tree commit diff
path: root/synapse/config/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-09-24 15:20:40 +0100
committerErik Johnston <erik@matrix.org>2019-09-24 15:53:17 +0100
commit242017db8b7b57be28a019ecbba1619d75d54889 (patch)
tree76e97a24823989e375056344d3d003b852435b27 /synapse/config/server.py
parentAdd has_completed_background_update (diff)
downloadsynapse-242017db8b7b57be28a019ecbba1619d75d54889.tar.xz
Prune rows in user_ips older than configured period
Defaults to pruning everything older than 28d.
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r--synapse/config/server.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index 7f8d315954..655e7487a4 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -172,6 +172,13 @@ class ServerConfig(Config):
         else:
             self.redaction_retention_period = None
 
+        # How long to keep entries in the `users_ips` table.
+        user_ips_max_age = config.get("user_ips_max_age", "28d")
+        if user_ips_max_age is not None:
+            self.user_ips_max_age = self.parse_duration(user_ips_max_age)
+        else:
+            self.user_ips_max_age = None
+
         # Options to disable HS
         self.hs_disabled = config.get("hs_disabled", False)
         self.hs_disabled_message = config.get("hs_disabled_message", "")
@@ -735,6 +742,12 @@ class ServerConfig(Config):
         # Defaults to `7d`. Set to `null` to disable.
         #
         redaction_retention_period: 7d
+
+        # How long to track users' last seen time and IPs in the database.
+        #
+        # Defaults to `28d`. Set to `null` to disable.
+        #
+        #user_ips_max_age: 14d
         """
             % locals()
         )