summary refs log tree commit diff
path: root/synapse/config/captcha.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-05 22:51:11 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-05 22:51:11 -0700
commit37e53513b6789b4f9f845a26b64933f1c533ed62 (patch)
tree9ed0634ce25b52e46ca7a5b7135c1fee2f769fc8 /synapse/config/captcha.py
parentCaptchas now work on registration. Missing x-forwarded-for config arg support... (diff)
downloadsynapse-37e53513b6789b4f9f845a26b64933f1c533ed62.tar.xz
Add config opion for XFF headers when performing ReCaptcha auth.
Diffstat (limited to 'synapse/config/captcha.py')
-rw-r--r--synapse/config/captcha.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/config/captcha.py b/synapse/config/captcha.py
index 021da5c69b..a97a5bab1e 100644
--- a/synapse/config/captcha.py
+++ b/synapse/config/captcha.py
@@ -20,6 +20,7 @@ class CaptchaConfig(Config):
         super(CaptchaConfig, self).__init__(args)
         self.recaptcha_private_key = args.recaptcha_private_key
         self.enable_registration_captcha = args.enable_registration_captcha
+        self.captcha_ip_origin_is_x_forwarded = args.captcha_ip_origin_is_x_forwarded
 
     @classmethod
     def add_arguments(cls, parser):
@@ -33,4 +34,9 @@ class CaptchaConfig(Config):
             "--enable-registration-captcha", type=bool, default=False,
             help="Enables ReCaptcha checks when registering, preventing signup "+
             "unless a captcha is answered. Requires a valid ReCaptcha public/private key."
+        )
+        group.add_argument(
+            "--captcha_ip_origin_is_x_forwarded", type=bool, default=False,
+            help="When checking captchas, use the X-Forwarded-For (XFF) header as the client IP "+
+            "and not the actual client IP."
         )
\ No newline at end of file