fixtures.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
  2. from misago.utils import ugettext_lazy as _
  3. from misago.utils import get_msgid
  4. settings_fixtures = (
  5. # Register and Sign-In Settings
  6. ('brute-force', {
  7. 'name': _("Brute-force Countermeasures"),
  8. 'description': _("Those settings allow you to protect your forum from brute-force attacks."),
  9. 'settings': (
  10. ('attempts_limit', {
  11. 'value': 3,
  12. 'default': 3,
  13. 'type': "integer",
  14. 'input': "text",
  15. 'separator': _("Brute-force Countermeasures"),
  16. 'name': _("IP invalid attempts limit"),
  17. 'description': _('Enter maximal number of allowed attempts before IP address "jams". Defautly forum records only failed sign-in attempts.'),
  18. }),
  19. ('registrations_jams', {
  20. 'value': False,
  21. 'default': False,
  22. 'type': "boolean",
  23. 'input': "yesno",
  24. 'name': _("Protect register form"),
  25. 'description': _("Set this setting to yes if you want failed register attempts to count into limit. Majority of failed register attempts are caused by CAPTCHA protection against spam-bots, however same protection may cause problems for users with disabilities or ones that have problems understanding Q&A challenge."),
  26. }),
  27. ('jams_lifetime', {
  28. 'value': 15,
  29. 'default': 15,
  30. 'type': "integer",
  31. 'input': "text",
  32. 'name': _("Automaticaly unlock jammed IPs"),
  33. 'description': _('Enter number of minutes since IP address "jams" to automatically unlock it, or 0 to never unlock jammed IP adresses. Jams don\'t count as bans.'),
  34. }),
  35. ),
  36. }),
  37. )
  38. def load_fixtures():
  39. load_settings_fixture(settings_fixtures)
  40. def update_fixtures():
  41. update_settings_fixture(settings_fixtures)