fixtures.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. 'position': 0,
  19. }),
  20. ('registrations_jams', {
  21. 'value': 1,
  22. 'default': 1,
  23. 'type': "boolean",
  24. 'input': "yesno",
  25. 'name': _("Protect register form"),
  26. '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."),
  27. 'position': 1,
  28. }),
  29. ('jams_lifetime', {
  30. 'value': 15,
  31. 'default': 15,
  32. 'type': "integer",
  33. 'input': "text",
  34. 'name': _("Automaticaly unlock jammed IPs"),
  35. '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.'),
  36. 'position': 2,
  37. }),
  38. ),
  39. }),
  40. )
  41. def load_fixtures():
  42. load_settings_fixture(settings_fixtures)
  43. def update_fixtures():
  44. update_settings_fixture(settings_fixtures)