commentail 1.3.0__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. {commentail-1.3.0 → commentail-1.3.2}/CHANGELOG.md +22 -0
  2. {commentail-1.3.0/commentail.egg-info → commentail-1.3.2}/PKG-INFO +9 -4
  3. {commentail-1.3.0 → commentail-1.3.2}/README.md +8 -3
  4. {commentail-1.3.0 → commentail-1.3.2}/README.ru.md +8 -3
  5. {commentail-1.3.0 → commentail-1.3.2}/commentail/admission.py +15 -4
  6. {commentail-1.3.0 → commentail-1.3.2}/commentail/antispam.py +16 -6
  7. {commentail-1.3.0 → commentail-1.3.2}/commentail/background.py +33 -6
  8. {commentail-1.3.0 → commentail-1.3.2}/commentail/config.py +4 -0
  9. commentail-1.3.2/commentail/fingerprints.py +33 -0
  10. {commentail-1.3.0 → commentail-1.3.2}/commentail/limits.py +28 -8
  11. commentail-1.3.2/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
  12. {commentail-1.3.0 → commentail-1.3.2}/commentail/locale/de/LC_MESSAGES/django.po +3 -0
  13. commentail-1.3.2/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
  14. {commentail-1.3.0 → commentail-1.3.2}/commentail/locale/es/LC_MESSAGES/django.po +3 -0
  15. commentail-1.3.2/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
  16. {commentail-1.3.0 → commentail-1.3.2}/commentail/locale/fr/LC_MESSAGES/django.po +3 -0
  17. commentail-1.3.2/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  18. {commentail-1.3.0 → commentail-1.3.2}/commentail/locale/pt_BR/LC_MESSAGES/django.po +3 -0
  19. commentail-1.3.2/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
  20. {commentail-1.3.0 → commentail-1.3.2}/commentail/locale/ru/LC_MESSAGES/django.po +3 -0
  21. {commentail-1.3.0 → commentail-1.3.2}/commentail/mail_access.py +4 -1
  22. commentail-1.3.2/commentail/migrations/0018_private_fingerprints.py +56 -0
  23. {commentail-1.3.0 → commentail-1.3.2}/commentail/objects.py +51 -33
  24. commentail-1.3.2/commentail/page_access.py +19 -0
  25. {commentail-1.3.0 → commentail-1.3.2}/commentail/public.py +5 -1
  26. {commentail-1.3.0 → commentail-1.3.2}/commentail/recent.py +9 -6
  27. {commentail-1.3.0 → commentail-1.3.2}/commentail/services.py +14 -14
  28. commentail-1.3.2/commentail/templates/commentail/form.html +1 -0
  29. {commentail-1.3.0 → commentail-1.3.2}/commentail/widget.py +22 -17
  30. {commentail-1.3.0 → commentail-1.3.2/commentail.egg-info}/PKG-INFO +9 -4
  31. {commentail-1.3.0 → commentail-1.3.2}/commentail.egg-info/SOURCES.txt +12 -0
  32. commentail-1.3.2/docs/releases/1.3.1.md +78 -0
  33. commentail-1.3.2/docs/releases/1.3.2.md +54 -0
  34. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Changelog.md +22 -0
  35. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Configuration.md +3 -1
  36. commentail-1.3.2/docs/wiki/Deployment.md +109 -0
  37. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Email-and-worker.md +6 -1
  38. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Example-and-testing.md +1 -1
  39. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Home.md +5 -3
  40. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Installation.md +17 -4
  41. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Object-adapters.md +5 -0
  42. commentail-1.3.2/docs/wiki/Release-1.3.1.md +78 -0
  43. commentail-1.3.2/docs/wiki/Release-1.3.2.md +54 -0
  44. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Security-and-privacy.md +39 -0
  45. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Styling.md +1 -1
  46. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/_Sidebar.md +2 -0
  47. {commentail-1.3.0 → commentail-1.3.2}/pyproject.toml +1 -1
  48. commentail-1.3.2/tests/test_background.py +351 -0
  49. {commentail-1.3.0 → commentail-1.3.2}/tests/test_cleanup.py +4 -2
  50. {commentail-1.3.0 → commentail-1.3.2}/tests/test_concurrency.py +13 -1
  51. commentail-1.3.2/tests/test_fingerprints.py +257 -0
  52. commentail-1.3.2/tests/test_form_issuance_limits.py +119 -0
  53. commentail-1.3.2/tests/test_registry_diagnostics.py +89 -0
  54. commentail-1.3.2/tests/test_security_boundaries.py +86 -0
  55. commentail-1.3.2/tests/test_translated_site_roots.py +222 -0
  56. commentail-1.3.0/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
  57. commentail-1.3.0/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
  58. commentail-1.3.0/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
  59. commentail-1.3.0/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  60. commentail-1.3.0/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
  61. commentail-1.3.0/commentail/templates/commentail/form.html +0 -1
  62. commentail-1.3.0/docs/wiki/Deployment.md +0 -44
  63. commentail-1.3.0/tests/test_background.py +0 -174
  64. {commentail-1.3.0 → commentail-1.3.2}/LICENSE +0 -0
  65. {commentail-1.3.0 → commentail-1.3.2}/MANIFEST.in +0 -0
  66. {commentail-1.3.0 → commentail-1.3.2}/commentail/__init__.py +0 -0
  67. {commentail-1.3.0 → commentail-1.3.2}/commentail/admin_queries.py +0 -0
  68. {commentail-1.3.0 → commentail-1.3.2}/commentail/admin_settings.py +0 -0
  69. {commentail-1.3.0 → commentail-1.3.2}/commentail/admin_urls.py +0 -0
  70. {commentail-1.3.0 → commentail-1.3.2}/commentail/admin_views.py +0 -0
  71. {commentail-1.3.0 → commentail-1.3.2}/commentail/apps.py +0 -0
  72. {commentail-1.3.0 → commentail-1.3.2}/commentail/assets.py +0 -0
  73. {commentail-1.3.0 → commentail-1.3.2}/commentail/author_access.py +0 -0
  74. {commentail-1.3.0 → commentail-1.3.2}/commentail/avatars.py +0 -0
  75. {commentail-1.3.0 → commentail-1.3.2}/commentail/captcha_providers.py +0 -0
  76. {commentail-1.3.0 → commentail-1.3.2}/commentail/checks.py +0 -0
  77. {commentail-1.3.0 → commentail-1.3.2}/commentail/content_checks.py +0 -0
  78. {commentail-1.3.0 → commentail-1.3.2}/commentail/detection.py +0 -0
  79. {commentail-1.3.0 → commentail-1.3.2}/commentail/drafts.py +0 -0
  80. {commentail-1.3.0 → commentail-1.3.2}/commentail/forms.py +0 -0
  81. {commentail-1.3.0 → commentail-1.3.2}/commentail/group_permissions.py +0 -0
  82. {commentail-1.3.0 → commentail-1.3.2}/commentail/logging.py +0 -0
  83. {commentail-1.3.0 → commentail-1.3.2}/commentail/management/__init__.py +0 -0
  84. {commentail-1.3.0 → commentail-1.3.2}/commentail/management/commands/__init__.py +0 -0
  85. {commentail-1.3.0 → commentail-1.3.2}/commentail/management/commands/process_commentail.py +0 -0
  86. {commentail-1.3.0 → commentail-1.3.2}/commentail/middleware.py +0 -0
  87. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0001_initial.py +0 -0
  88. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0002_sitegrouppermission_hide_sitegrouppermission_view.py +0 -0
  89. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0003_actiontoken_captchachallenge_guestgrant.py +0 -0
  90. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0004_submissionrecord.py +0 -0
  91. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0005_rateevent.py +0 -0
  92. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0006_alter_comment_guest_name_and_more.py +0 -0
  93. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0007_actiontoken_nonce_replysubscription_mailjob.py +0 -0
  94. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0008_mailjob_revision.py +0 -0
  95. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0009_formticket.py +0 -0
  96. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0010_captchachallenge_backend_and_more.py +0 -0
  97. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0011_discussion_content_type_discussion_object_id_and_more.py +0 -0
  98. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0012_formticket_draft.py +0 -0
  99. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0013_sitecommentsettings_email_enabled.py +0 -0
  100. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0014_reading_indexes.py +0 -0
  101. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0015_sitecommentsettings_highlight_staff.py +0 -0
  102. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0016_guest_antispam.py +0 -0
  103. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/0017_revision_spam_signals.py +0 -0
  104. {commentail-1.3.0 → commentail-1.3.2}/commentail/migrations/__init__.py +0 -0
  105. {commentail-1.3.0 → commentail-1.3.2}/commentail/models.py +0 -0
  106. {commentail-1.3.0 → commentail-1.3.2}/commentail/outbox.py +0 -0
  107. {commentail-1.3.0 → commentail-1.3.2}/commentail/page_integration.py +0 -0
  108. {commentail-1.3.0 → commentail-1.3.2}/commentail/panels.py +0 -0
  109. {commentail-1.3.0 → commentail-1.3.2}/commentail/permissions.py +0 -0
  110. {commentail-1.3.0 → commentail-1.3.2}/commentail/policies.py +0 -0
  111. {commentail-1.3.0 → commentail-1.3.2}/commentail/presentation.py +0 -0
  112. {commentail-1.3.0 → commentail-1.3.2}/commentail/reading.py +0 -0
  113. {commentail-1.3.0 → commentail-1.3.2}/commentail/rules_csv.py +0 -0
  114. {commentail-1.3.0 → commentail-1.3.2}/commentail/security.py +0 -0
  115. {commentail-1.3.0 → commentail-1.3.2}/commentail/signals.py +0 -0
  116. {commentail-1.3.0 → commentail-1.3.2}/commentail/static/commentail/admin.css +0 -0
  117. {commentail-1.3.0 → commentail-1.3.2}/commentail/static/commentail/admin.js +0 -0
  118. {commentail-1.3.0 → commentail-1.3.2}/commentail/static/commentail/commentail.css +0 -0
  119. {commentail-1.3.0 → commentail-1.3.2}/commentail/static/commentail/commentail.js +0 -0
  120. {commentail-1.3.0 → commentail-1.3.2}/commentail/structured.py +0 -0
  121. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/action.html +0 -0
  122. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/action_error.html +0 -0
  123. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/base.html +0 -0
  124. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/confirm_delete.html +0 -0
  125. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/detail.html +0 -0
  126. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/field.html +0 -0
  127. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/form.html +0 -0
  128. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/group_permission_row.html +0 -0
  129. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/group_permissions.html +0 -0
  130. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/heading.html +0 -0
  131. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/list.html +0 -0
  132. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/mail.html +0 -0
  133. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/management.html +0 -0
  134. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/objects.html +0 -0
  135. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/page_panel.html +0 -0
  136. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/rules.html +0 -0
  137. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/rules_import.html +0 -0
  138. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/admin/selection.html +0 -0
  139. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/author.html +0 -0
  140. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/avatar.html +0 -0
  141. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/base.html +0 -0
  142. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/block.html +0 -0
  143. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/captcha.html +0 -0
  144. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/comment.html +0 -0
  145. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/edit-form.html +0 -0
  146. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/base.html +0 -0
  147. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/button.html +0 -0
  148. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/confirm.html +0 -0
  149. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/confirm.txt +0 -0
  150. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/confirm_subject.txt +0 -0
  151. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/edit.html +0 -0
  152. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/edit.txt +0 -0
  153. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/edit_subject.txt +0 -0
  154. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/published.html +0 -0
  155. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/published.txt +0 -0
  156. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/published_subject.txt +0 -0
  157. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/rejected.html +0 -0
  158. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/rejected.txt +0 -0
  159. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/rejected_subject.txt +0 -0
  160. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/reply.html +0 -0
  161. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/reply.txt +0 -0
  162. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/emails/reply_subject.txt +0 -0
  163. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/provider-captcha.html +0 -0
  164. {commentail-1.3.0 → commentail-1.3.2}/commentail/templates/commentail/replies.html +0 -0
  165. {commentail-1.3.0 → commentail-1.3.2}/commentail/templatetags/__init__.py +0 -0
  166. {commentail-1.3.0 → commentail-1.3.2}/commentail/templatetags/commentail_admin.py +0 -0
  167. {commentail-1.3.0 → commentail-1.3.2}/commentail/templatetags/commentail_tags.py +0 -0
  168. {commentail-1.3.0 → commentail-1.3.2}/commentail/text.py +0 -0
  169. {commentail-1.3.0 → commentail-1.3.2}/commentail/urls.py +0 -0
  170. {commentail-1.3.0 → commentail-1.3.2}/commentail/validation.py +0 -0
  171. {commentail-1.3.0 → commentail-1.3.2}/commentail/views.py +0 -0
  172. {commentail-1.3.0 → commentail-1.3.2}/commentail/wagtail_hooks.py +0 -0
  173. {commentail-1.3.0 → commentail-1.3.2}/commentail.egg-info/dependency_links.txt +0 -0
  174. {commentail-1.3.0 → commentail-1.3.2}/commentail.egg-info/requires.txt +0 -0
  175. {commentail-1.3.0 → commentail-1.3.2}/commentail.egg-info/top_level.txt +0 -0
  176. {commentail-1.3.0 → commentail-1.3.2}/docs/assets/commentail-preview.png +0 -0
  177. {commentail-1.3.0 → commentail-1.3.2}/docs/assets/support-qr.png +0 -0
  178. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/0.1.0.md +0 -0
  179. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/0.1.1.md +0 -0
  180. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/0.2.0.md +0 -0
  181. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/1.0.0.md +0 -0
  182. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/1.1.0.md +0 -0
  183. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/1.2.0.md +0 -0
  184. {commentail-1.3.0 → commentail-1.3.2}/docs/releases/1.3.0.md +0 -0
  185. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Callbacks.md +0 -0
  186. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Guest-comments.md +0 -0
  187. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Moderation.md +0 -0
  188. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Performance.md +0 -0
  189. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Recent-comments.md +0 -0
  190. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-0.1.0.md +0 -0
  191. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-0.1.1.md +0 -0
  192. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-0.2.0.md +0 -0
  193. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-1.0.0.md +0 -0
  194. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-1.1.0.md +0 -0
  195. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-1.2.0.md +0 -0
  196. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Release-1.3.0.md +0 -0
  197. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Replies-and-editing.md +0 -0
  198. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Roadmap.md +0 -0
  199. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Rules-and-CSV.md +0 -0
  200. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Stability.md +0 -0
  201. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Structured-data.md +0 -0
  202. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Support.md +0 -0
  203. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Template-contract.md +0 -0
  204. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Templates.md +0 -0
  205. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/Troubleshooting.md +0 -0
  206. {commentail-1.3.0 → commentail-1.3.2}/docs/wiki/_Footer.md +0 -0
  207. {commentail-1.3.0 → commentail-1.3.2}/example/README.md +0 -0
  208. {commentail-1.3.0 → commentail-1.3.2}/example/demo/__init__.py +0 -0
  209. {commentail-1.3.0 → commentail-1.3.2}/example/demo/settings.py +0 -0
  210. {commentail-1.3.0 → commentail-1.3.2}/example/demo/urls.py +0 -0
  211. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/__init__.py +0 -0
  212. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/comments.py +0 -0
  213. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/management/__init__.py +0 -0
  214. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/management/commands/__init__.py +0 -0
  215. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/management/commands/bootstrap_demo.py +0 -0
  216. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/migrations/0001_initial.py +0 -0
  217. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/migrations/0002_product.py +0 -0
  218. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/migrations/__init__.py +0 -0
  219. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/models.py +0 -0
  220. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/templates/demo_home/home_page.html +0 -0
  221. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/templates/demo_home/product.html +0 -0
  222. {commentail-1.3.0 → commentail-1.3.2}/example/demo_home/views.py +0 -0
  223. {commentail-1.3.0 → commentail-1.3.2}/example/manage.py +0 -0
  224. {commentail-1.3.0 → commentail-1.3.2}/requirements-test-common.txt +0 -0
  225. {commentail-1.3.0 → commentail-1.3.2}/requirements-test.txt +0 -0
  226. {commentail-1.3.0 → commentail-1.3.2}/setup.cfg +0 -0
  227. {commentail-1.3.0 → commentail-1.3.2}/tests/__init__.py +0 -0
  228. {commentail-1.3.0 → commentail-1.3.2}/tests/settings.py +0 -0
  229. {commentail-1.3.0 → commentail-1.3.2}/tests/targets/__init__.py +0 -0
  230. {commentail-1.3.0 → commentail-1.3.2}/tests/targets/apps.py +0 -0
  231. {commentail-1.3.0 → commentail-1.3.2}/tests/targets/migrations/0001_initial.py +0 -0
  232. {commentail-1.3.0 → commentail-1.3.2}/tests/targets/migrations/__init__.py +0 -0
  233. {commentail-1.3.0 → commentail-1.3.2}/tests/targets/models.py +0 -0
  234. {commentail-1.3.0 → commentail-1.3.2}/tests/templates/wagtailcore/page.html +0 -0
  235. {commentail-1.3.0 → commentail-1.3.2}/tests/test_actions.py +0 -0
  236. {commentail-1.3.0 → commentail-1.3.2}/tests/test_admin.js +0 -0
  237. {commentail-1.3.0 → commentail-1.3.2}/tests/test_admin_ui.py +0 -0
  238. {commentail-1.3.0 → commentail-1.3.2}/tests/test_admission.py +0 -0
  239. {commentail-1.3.0 → commentail-1.3.2}/tests/test_antispam.py +0 -0
  240. {commentail-1.3.0 → commentail-1.3.2}/tests/test_avatars.py +0 -0
  241. {commentail-1.3.0 → commentail-1.3.2}/tests/test_capability_access.py +0 -0
  242. {commentail-1.3.0 → commentail-1.3.2}/tests/test_captcha_backend.py +0 -0
  243. {commentail-1.3.0 → commentail-1.3.2}/tests/test_captcha_providers.py +0 -0
  244. {commentail-1.3.0 → commentail-1.3.2}/tests/test_content_checks.py +0 -0
  245. {commentail-1.3.0 → commentail-1.3.2}/tests/test_detection.py +0 -0
  246. {commentail-1.3.0 → commentail-1.3.2}/tests/test_email_backends.py +0 -0
  247. {commentail-1.3.0 → commentail-1.3.2}/tests/test_email_presentation.py +0 -0
  248. {commentail-1.3.0 → commentail-1.3.2}/tests/test_extension_contracts.py +0 -0
  249. {commentail-1.3.0 → commentail-1.3.2}/tests/test_group_panel.py +0 -0
  250. {commentail-1.3.0 → commentail-1.3.2}/tests/test_inline_edit.py +0 -0
  251. {commentail-1.3.0 → commentail-1.3.2}/tests/test_input_boundaries.py +0 -0
  252. {commentail-1.3.0 → commentail-1.3.2}/tests/test_lifecycle.py +0 -0
  253. {commentail-1.3.0 → commentail-1.3.2}/tests/test_localization.py +0 -0
  254. {commentail-1.3.0 → commentail-1.3.2}/tests/test_mail_admin.py +0 -0
  255. {commentail-1.3.0 → commentail-1.3.2}/tests/test_name_limit.js +0 -0
  256. {commentail-1.3.0 → commentail-1.3.2}/tests/test_notifications.py +0 -0
  257. {commentail-1.3.0 → commentail-1.3.2}/tests/test_object_adapters.py +0 -0
  258. {commentail-1.3.0 → commentail-1.3.2}/tests/test_outbox.py +0 -0
  259. {commentail-1.3.0 → commentail-1.3.2}/tests/test_performance.py +0 -0
  260. {commentail-1.3.0 → commentail-1.3.2}/tests/test_presentation_contracts.py +0 -0
  261. {commentail-1.3.0 → commentail-1.3.2}/tests/test_progressive.js +0 -0
  262. {commentail-1.3.0 → commentail-1.3.2}/tests/test_provider_widgets.js +0 -0
  263. {commentail-1.3.0 → commentail-1.3.2}/tests/test_public_ui.py +0 -0
  264. {commentail-1.3.0 → commentail-1.3.2}/tests/test_rate_limits.py +0 -0
  265. {commentail-1.3.0 → commentail-1.3.2}/tests/test_reading_contracts.py +0 -0
  266. {commentail-1.3.0 → commentail-1.3.2}/tests/test_recent_comments.py +0 -0
  267. {commentail-1.3.0 → commentail-1.3.2}/tests/test_release_gaps.py +0 -0
  268. {commentail-1.3.0 → commentail-1.3.2}/tests/test_reply.js +0 -0
  269. {commentail-1.3.0 → commentail-1.3.2}/tests/test_rules_admin.py +0 -0
  270. {commentail-1.3.0 → commentail-1.3.2}/tests/test_rules_csv.py +0 -0
  271. {commentail-1.3.0 → commentail-1.3.2}/tests/test_security.py +0 -0
  272. {commentail-1.3.0 → commentail-1.3.2}/tests/test_smtp_chain.py +0 -0
  273. {commentail-1.3.0 → commentail-1.3.2}/tests/test_staff_authors.py +0 -0
  274. {commentail-1.3.0 → commentail-1.3.2}/tests/test_structured_data.py +0 -0
  275. {commentail-1.3.0 → commentail-1.3.2}/tests/test_submission.py +0 -0
  276. {commentail-1.3.0 → commentail-1.3.2}/tests/test_transaction_contracts.py +0 -0
  277. {commentail-1.3.0 → commentail-1.3.2}/tests/urls.py +0 -0
  278. {commentail-1.3.0 → commentail-1.3.2}/tests/urls_custom_prefix.py +0 -0
  279. {commentail-1.3.0 → commentail-1.3.2}/tools/benchmark_performance.py +0 -0
  280. {commentail-1.3.0 → commentail-1.3.2}/tools/check_dist.py +0 -0
  281. {commentail-1.3.0 → commentail-1.3.2}/tools/check_translations.py +0 -0
@@ -3,6 +3,27 @@
3
3
  Each release records changes relative to the previous version. Upgrade notes
4
4
  describe changes that an existing installation needs to review.
5
5
 
6
+ ## [1.3.2] — 2026-10-23 · Translated Site roots
7
+
8
+ - Restore Page discussions under translated Site homepages when Wagtail content
9
+ internationalization is enabled. Apply the same Site boundary to forms,
10
+ protected links, queued mail and recent comments while retaining live-page
11
+ and view-restriction checks. No data migration is required for this fix.
12
+
13
+ ## [1.3.1] — 2026-10-23 · Security update
14
+
15
+ - Key quota identities and submission actor/payload fingerprints with purpose-scoped
16
+ HMAC; migrate existing records without resetting quotas or accepted retries.
17
+ - Deny Page discussions, protected links and mail outside the saved Site root.
18
+ - Limit form/recovery ticket issuance per Site/IP while preserving reading,
19
+ submitted drafts and existing valid tickets; translate refusal in all UI languages.
20
+ - Report distinct object-adapter validation causes without private exception text.
21
+ - Clean expired CAPTCHA, guest grants, form tickets and rate events in batches
22
+ of at most 500, committing each batch independently and preserving live records.
23
+
24
+ Migration `0018` is irreversible: stop writers and back up database/key/package
25
+ before upgrading. See the [1.3.1 upgrade notes](docs/releases/1.3.1.md).
26
+
6
27
  ## [1.3.0] — 2026-10-22 · Stable
7
28
 
8
29
  - Keep bundled external CAPTCHA bindings valid for the form lifetime, allowing
@@ -227,5 +248,6 @@ See [0.1.0 release notes](docs/releases/0.1.0.md).
227
248
 
228
249
  [1.1.0]: https://github.com/hardcodd/Commentail/compare/v1.0.0...v1.1.0
229
250
 
251
+ [1.3.1]: https://github.com/hardcodd/Commentail/compare/v1.3.0...v1.3.1
230
252
  [1.3.0]: https://github.com/hardcodd/Commentail/compare/v1.2.0...v1.3.0
231
253
  [1.2.0]: https://github.com/hardcodd/Commentail/compare/v1.1.0...v1.2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commentail
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: Self-hosted Wagtail comments with moderation, verified guests and threaded replies
5
5
  License-Expression: MIT
6
6
  Project-URL: Source, https://github.com/hardcodd/Commentail
@@ -34,7 +34,12 @@ Dynamic: license-file
34
34
 
35
35
  Moderated discussions, verified guests and inline replies — styled by your site.
36
36
 
37
- **Current release: [1.3.0](https://github.com/hardcodd/Commentail/releases/tag/v1.3.0)** · [PyPI](https://pypi.org/project/commentail/1.3.0/)
37
+ **Current release: [1.3.2](https://github.com/hardcodd/Commentail/releases/tag/v1.3.2)** · [PyPI](https://pypi.org/project/commentail/1.3.2/)
38
+
39
+ [1.3.2 restores discussions under translated Site homepages](docs/releases/1.3.2.md).
40
+ There is no new migration over 1.3.1. Upgrading from 1.3.0 or earlier includes
41
+ the [irreversible 1.3.1 fingerprint migration](docs/releases/1.3.1.md);
42
+ review its backup, downtime and form-quota guidance first.
38
43
 
39
44
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
40
45
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
@@ -171,11 +176,11 @@ The guides are in English; this README is also [available in Russian](README.ru.
171
176
  In your existing Wagtail site's virtual environment, install the published release:
172
177
 
173
178
  ```sh
174
- python -m pip install commentail==1.3.0
179
+ python -m pip install commentail==1.3.2
175
180
  ```
176
181
 
177
182
  For the optional PostgreSQL driver, use
178
- `python -m pip install 'commentail[postgres]==1.3.0'`.
183
+ `python -m pip install 'commentail[postgres]==1.3.2'`.
179
184
  For an existing installation, follow
180
185
  the [upgrade guide](docs/wiki/Installation.md#upgrading-and-restoring) for your target version.
181
186
 
@@ -6,7 +6,12 @@
6
6
 
7
7
  Moderated discussions, verified guests and inline replies — styled by your site.
8
8
 
9
- **Current release: [1.3.0](https://github.com/hardcodd/Commentail/releases/tag/v1.3.0)** · [PyPI](https://pypi.org/project/commentail/1.3.0/)
9
+ **Current release: [1.3.2](https://github.com/hardcodd/Commentail/releases/tag/v1.3.2)** · [PyPI](https://pypi.org/project/commentail/1.3.2/)
10
+
11
+ [1.3.2 restores discussions under translated Site homepages](docs/releases/1.3.2.md).
12
+ There is no new migration over 1.3.1. Upgrading from 1.3.0 or earlier includes
13
+ the [irreversible 1.3.1 fingerprint migration](docs/releases/1.3.1.md);
14
+ review its backup, downtime and form-quota guidance first.
10
15
 
11
16
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
12
17
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
@@ -143,11 +148,11 @@ The guides are in English; this README is also [available in Russian](README.ru.
143
148
  In your existing Wagtail site's virtual environment, install the published release:
144
149
 
145
150
  ```sh
146
- python -m pip install commentail==1.3.0
151
+ python -m pip install commentail==1.3.2
147
152
  ```
148
153
 
149
154
  For the optional PostgreSQL driver, use
150
- `python -m pip install 'commentail[postgres]==1.3.0'`.
155
+ `python -m pip install 'commentail[postgres]==1.3.2'`.
151
156
  For an existing installation, follow
152
157
  the [upgrade guide](docs/wiki/Installation.md#upgrading-and-restoring) for your target version.
153
158
 
@@ -6,7 +6,12 @@
6
6
 
7
7
  Модерация обсуждений, подтверждённые гости и ответы рядом с комментарием — в стиле вашего сайта.
8
8
 
9
- **Текущая версия: [1.3.0](https://github.com/hardcodd/Commentail/releases/tag/v1.3.0)** · [PyPI](https://pypi.org/project/commentail/1.3.0/)
9
+ **Текущая версия: [1.3.2](https://github.com/hardcodd/Commentail/releases/tag/v1.3.2)** · [PyPI](https://pypi.org/project/commentail/1.3.2/)
10
+
11
+ [1.3.2 восстанавливает обсуждения под переводами главной страницы Site](docs/releases/1.3.2.md).
12
+ После 1.3.1 новой миграции нет. Обновление с 1.3.0 или более ранней версии
13
+ включает [необратимую миграцию отпечатков из 1.3.1](docs/releases/1.3.1.md);
14
+ заранее проверьте рекомендации о резервной копии, остановке записи и лимитах выдачи форм.
10
15
 
11
16
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
12
17
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
@@ -144,11 +149,11 @@ CDN и CAPTCHA-сервисов нет. См. [настройку писем](do
144
149
  В виртуальном окружении существующего сайта Wagtail установите опубликованный выпуск:
145
150
 
146
151
  ```sh
147
- python -m pip install commentail==1.3.0
152
+ python -m pip install commentail==1.3.2
148
153
  ```
149
154
 
150
155
  Для необязательного драйвера PostgreSQL используйте
151
- `python -m pip install 'commentail[postgres]==1.3.0'`.
156
+ `python -m pip install 'commentail[postgres]==1.3.2'`.
152
157
  Для существующей установки следуйте [инструкции обновления](docs/wiki/Installation.md#upgrading-and-restoring)
153
158
  до нужной версии.
154
159
 
@@ -20,8 +20,10 @@ from wagtail.models import Site
20
20
 
21
21
  from .antispam import captcha_required, consume_attempt, form_signals, request_signals
22
22
  from .config import technical_settings
23
+ from .fingerprints import fingerprint_candidates
23
24
  from .limits import client_ip, consume
24
25
  from .models import Access, Comment, Discussion, FormTicket, Mode, SubmissionRecord
26
+ from .page_access import site_page_paths
25
27
  from .policies import editorial_settings, email_enabled
26
28
  from .security import digest, remembered_guest, verify_captcha
27
29
  from .services import DomainError, _text, confirm_email, submit_once
@@ -47,9 +49,13 @@ def can_view(request: HttpRequest, discussion: Discussion) -> bool:
47
49
  except ObjectAccessError:
48
50
  return False
49
51
  page = discussion.page
50
- return page.live and all(
51
- restriction.accept_request(request)
52
- for restriction in page.get_view_restrictions()
52
+ return (
53
+ page.live
54
+ and page.path.startswith(site_page_paths(discussion.site))
55
+ and all(
56
+ restriction.accept_request(request)
57
+ for restriction in page.get_view_restrictions()
58
+ )
53
59
  )
54
60
 
55
61
 
@@ -79,6 +85,7 @@ def issue_form(
79
85
  """
80
86
  if not can_view(request, discussion):
81
87
  raise DomainError("Page access is required")
88
+ consume(discussion.site, "form", "", client_ip(request, discussion.site))
82
89
  session = session_digest(request)
83
90
  now = timezone.now()
84
91
  prior = FormTicket.objects.filter(
@@ -191,7 +198,11 @@ def accept_request(
191
198
 
192
199
  def recorded() -> bool:
193
200
  return SubmissionRecord.objects.filter(
194
- discussion=discussion, actor_digest=digest(actor), key_digest=digest(key)
201
+ discussion=discussion,
202
+ actor_digest__in=fingerprint_candidates(
203
+ actor, f"submission.actor.{discussion.pk}"
204
+ ),
205
+ key_digest=digest(key),
195
206
  ).exists()
196
207
 
197
208
  def save(*, suspicious: bool = False) -> Comment:
@@ -11,8 +11,8 @@ from django.utils.translation import gettext as _
11
11
  from wagtail.models import Site
12
12
 
13
13
  from .config import technical_settings
14
+ from .fingerprints import fingerprint, fingerprint_candidates
14
15
  from .models import FormTicket, RateEvent
15
- from .security import digest
16
16
  from .services import DomainError
17
17
 
18
18
 
@@ -71,8 +71,8 @@ def consume_attempt(request: HttpRequest, site: Site, ip: str) -> None:
71
71
  Site.objects.filter(pk=site.pk).update(port=F("port"))
72
72
  options = technical_settings(site)
73
73
  now = timezone.now()
74
- session = digest(request.session.session_key)
75
- address = digest(ip)
74
+ session = request.session.session_key
75
+ address = ip
76
76
  budgets = (
77
77
  ("attempt_session", session, 60, options["GUEST_ATTEMPTS_PER_MINUTE"]),
78
78
  ("attempt_ip", address, 60, options["GUEST_IP_ATTEMPTS_PER_MINUTE"]),
@@ -83,7 +83,9 @@ def consume_attempt(request: HttpRequest, site: Site, ip: str) -> None:
83
83
  RateEvent.objects.filter(
84
84
  site=site,
85
85
  kind=kind,
86
- subject_digest=subject,
86
+ subject_digest__in=fingerprint_candidates(
87
+ subject, f"rate.{site.pk}.{kind}"
88
+ ),
87
89
  created_at__gt=now - timedelta(seconds=seconds),
88
90
  ).count()
89
91
  >= limit
@@ -96,7 +98,15 @@ def consume_attempt(request: HttpRequest, site: Site, ip: str) -> None:
96
98
  )
97
99
  RateEvent.objects.bulk_create(
98
100
  [
99
- RateEvent(site=site, kind="attempt_session", subject_digest=session),
100
- RateEvent(site=site, kind="attempt_ip", subject_digest=address),
101
+ RateEvent(
102
+ site=site,
103
+ kind="attempt_session",
104
+ subject_digest=fingerprint(session, f"rate.{site.pk}.attempt_session"),
105
+ ),
106
+ RateEvent(
107
+ site=site,
108
+ kind="attempt_ip",
109
+ subject_digest=fingerprint(address, f"rate.{site.pk}.attempt_ip"),
110
+ ),
101
111
  ]
102
112
  )
@@ -4,6 +4,7 @@ from datetime import timedelta
4
4
  from typing import TypedDict
5
5
 
6
6
  from django.db import transaction
7
+ from django.db.models import Model, QuerySet
7
8
  from django.db.transaction import TransactionManagementError
8
9
  from django.utils import timezone
9
10
 
@@ -12,6 +13,28 @@ from .models import CaptchaChallenge, FormTicket, GuestGrant, RateEvent
12
13
  from .outbox import process_mail
13
14
  from .services import cleanup_unconfirmed
14
15
 
16
+ CLEANUP_BATCH_SIZE = 500
17
+
18
+
19
+ def _delete_expired(records: QuerySet[Model]) -> None:
20
+ """Commit bounded deletes, retaining the expiry filter if a record changes.
21
+
22
+ Materialize primary-key batches before deleting so SQLite has no open read
23
+ cursor or read transaction to upgrade. Keyset traversal works for UUID and
24
+ integer keys; each batch commits before the next one is selected.
25
+ """
26
+ cursor = None
27
+ while True:
28
+ remaining = records if cursor is None else records.filter(pk__gt=cursor)
29
+ identifiers = list(
30
+ remaining.order_by("pk").values_list("pk", flat=True)[:CLEANUP_BATCH_SIZE]
31
+ )
32
+ if not identifiers:
33
+ return
34
+ with transaction.atomic(using=records.db):
35
+ records.filter(pk__in=identifiers).delete()
36
+ cursor = identifiers[-1]
37
+
15
38
 
16
39
  class ProcessingResult(TypedDict):
17
40
  """Backend-accepted mail and expired unconfirmed comments removed by this run."""
@@ -29,6 +52,8 @@ def process_pending(*, mail_limit: int = 100) -> ProcessingResult:
29
52
  repeated task execution does not resend jobs already marked sent. Transport
30
53
  acceptance is not evidence of inbox delivery. Unexpected errors propagate to
31
54
  the scheduler; earlier completed work is not rolled back as a single batch.
55
+ Expired CAPTCHA, grants, form tickets and rate events are deleted in batches
56
+ of at most 500, each independently committed, with one fixed cleanup cutoff.
32
57
  """
33
58
  if type(mail_limit) is not int or mail_limit <= 0:
34
59
  raise ValueError("mail_limit must be a positive integer")
@@ -39,10 +64,12 @@ def process_pending(*, mail_limit: int = 100) -> ProcessingResult:
39
64
  removed = cleanup_unconfirmed()
40
65
  sent = process_mail(limit=mail_limit)
41
66
  now = timezone.now()
42
- CaptchaChallenge.objects.filter(expires_at__lte=now).delete()
43
- GuestGrant.objects.filter(expires_at__lte=now).delete()
44
- FormTicket.objects.filter(expires_at__lte=now).delete()
45
- RateEvent.objects.filter(
46
- created_at__lt=now - timedelta(seconds=retention_seconds())
47
- ).delete()
67
+ _delete_expired(CaptchaChallenge.objects.filter(expires_at__lte=now))
68
+ _delete_expired(GuestGrant.objects.filter(expires_at__lte=now))
69
+ _delete_expired(FormTicket.objects.filter(expires_at__lte=now))
70
+ _delete_expired(
71
+ RateEvent.objects.filter(
72
+ created_at__lt=now - timedelta(seconds=retention_seconds())
73
+ )
74
+ )
48
75
  return {"sent": sent, "removed": removed}
@@ -31,6 +31,8 @@ class TechnicalSettings(TypedDict):
31
31
  RESEND_IP_LIMIT_PER_HOUR: int
32
32
  CAPTCHA_IP_LIMIT_PER_MINUTE: int
33
33
  CAPTCHA_IP_LIMIT_PER_HOUR: int
34
+ FORM_IP_LIMIT_PER_MINUTE: int
35
+ FORM_IP_LIMIT_PER_HOUR: int
34
36
  TRUSTED_PROXIES: list[str]
35
37
  GUEST_REQUEST_CHECKS: list[str]
36
38
  MAIL_RETENTION_SECONDS: int
@@ -81,6 +83,8 @@ DEFAULTS: TechnicalSettings = {
81
83
  "RESEND_IP_LIMIT_PER_HOUR": 20,
82
84
  "CAPTCHA_IP_LIMIT_PER_MINUTE": 10,
83
85
  "CAPTCHA_IP_LIMIT_PER_HOUR": 100,
86
+ "FORM_IP_LIMIT_PER_MINUTE": 120,
87
+ "FORM_IP_LIMIT_PER_HOUR": 1200,
84
88
  "TRUSTED_PROXIES": [],
85
89
  "GUEST_REQUEST_CHECKS": ["missing_user_agent", "cross_site"],
86
90
  "MAIL_RETENTION_SECONDS": 604800,
@@ -0,0 +1,33 @@
1
+ """Keyed, purpose-scoped fingerprints for predictable private values.
2
+
3
+ Wrap SHA-256 rather than plaintext so an upgrade can protect existing records
4
+ without recovering email, IP or submitted payloads. Random capability hashes
5
+ remain separate. Retain old keys in SECRET_KEY_FALLBACKS while their records live.
6
+ """
7
+
8
+ import hashlib
9
+
10
+ from django.conf import settings
11
+ from django.utils.crypto import salted_hmac
12
+
13
+
14
+ def _fingerprint(value: str, purpose: str, key: str) -> str:
15
+ hashed = hashlib.sha256(value.encode()).hexdigest()
16
+ return salted_hmac(
17
+ "commentail.fingerprint." + purpose, hashed, secret=key, algorithm="sha256"
18
+ ).hexdigest()
19
+
20
+
21
+ def fingerprint(value: str, purpose: str) -> str:
22
+ """Return the current key's fingerprint; purpose includes its owning scope."""
23
+ return _fingerprint(value, purpose, settings.SECRET_KEY)
24
+
25
+
26
+ def fingerprint_candidates(value: str, purpose: str) -> list[str]:
27
+ """Match current and explicitly retained fallback keys, never unkeyed hashes."""
28
+ return list(
29
+ dict.fromkeys(
30
+ _fingerprint(value, purpose, key)
31
+ for key in (settings.SECRET_KEY, *settings.SECRET_KEY_FALLBACKS)
32
+ )
33
+ )
@@ -12,8 +12,8 @@ from django.utils import timezone
12
12
  from wagtail.models import Site
13
13
 
14
14
  from .config import technical_settings
15
+ from .fingerprints import fingerprint, fingerprint_candidates
15
16
  from .models import RateEvent
16
- from .security import digest
17
17
  from .services import DomainError
18
18
 
19
19
 
@@ -66,7 +66,10 @@ def client_ip(request: HttpRequest, site: Site) -> str:
66
66
 
67
67
  @transaction.atomic
68
68
  def consume(
69
- site: Site, kind: Literal["comment", "resend", "captcha"], author: str, ip: str
69
+ site: Site,
70
+ kind: Literal["comment", "resend", "captcha", "form"],
71
+ author: str,
72
+ ip: str,
70
73
  ) -> None:
71
74
  """Count author and IP together, or reject without spending either quota.
72
75
 
@@ -74,7 +77,7 @@ def consume(
74
77
  making quotas shared across pages and serializing decisions on SQLite too.
75
78
  Prune old entries through the background cleanup command, not per request.
76
79
  """
77
- if kind not in {"comment", "resend", "captcha"}:
80
+ if kind not in {"comment", "resend", "captcha", "form"}:
78
81
  raise DomainError("Unknown rate limit")
79
82
  if not Site.objects.filter(pk=site.pk).update(port=F("port")):
80
83
  raise DomainError("Site does not exist")
@@ -87,7 +90,9 @@ def consume(
87
90
  return RateEvent.objects.filter(
88
91
  site=site,
89
92
  kind=event_kind,
90
- subject_digest=digest(subject),
93
+ subject_digest__in=fingerprint_candidates(
94
+ subject, f"rate.{site.pk}.{event_kind}"
95
+ ),
91
96
  created_at__gt=now - timedelta(seconds=seconds),
92
97
  ).count()
93
98
 
@@ -96,12 +101,21 @@ def consume(
96
101
  "comment": "IP_LIMIT_PER_HOUR",
97
102
  "resend": "RESEND_IP_LIMIT_PER_HOUR",
98
103
  "captcha": "CAPTCHA_IP_LIMIT_PER_HOUR",
104
+ "form": "FORM_IP_LIMIT_PER_HOUR",
99
105
  }[kind]
100
106
  ]
101
107
  if count(ip_kind, ip, 3600) >= ip_limit:
108
+ if kind == "form":
109
+ raise DomainError(
110
+ "Too many form requests. Please wait and retry the check. Your draft is kept."
111
+ )
102
112
  raise DomainError("IP limit exceeded")
103
- if kind == "captcha":
104
- if count(ip_kind, ip, 60) >= options["CAPTCHA_IP_LIMIT_PER_MINUTE"]:
113
+ if kind in {"captcha", "form"}:
114
+ if count(ip_kind, ip, 60) >= options[kind.upper() + "_IP_LIMIT_PER_MINUTE"]:
115
+ if kind == "form":
116
+ raise DomainError(
117
+ "Too many form requests. Please wait and retry the check. Your draft is kept."
118
+ )
105
119
  raise DomainError("Captcha limit exceeded")
106
120
  else:
107
121
  prefix = "AUTHOR" if kind == "comment" else "RESEND"
@@ -111,6 +125,12 @@ def consume(
111
125
  ):
112
126
  raise DomainError("Author limit exceeded")
113
127
  RateEvent.objects.create(
114
- site=site, kind=author_kind, subject_digest=digest(author)
128
+ site=site,
129
+ kind=author_kind,
130
+ subject_digest=fingerprint(author, f"rate.{site.pk}.{author_kind}"),
115
131
  )
116
- RateEvent.objects.create(site=site, kind=ip_kind, subject_digest=digest(ip))
132
+ RateEvent.objects.create(
133
+ site=site,
134
+ kind=ip_kind,
135
+ subject_digest=fingerprint(ip, f"rate.{site.pk}.{ip_kind}"),
136
+ )
@@ -1060,3 +1060,6 @@ msgstr "Die Anzahl der Links hat den Schwellenwert für eine Prüfung erreicht."
1060
1060
 
1061
1061
  msgid "Retry check"
1062
1062
  msgstr "Prüfung wiederholen"
1063
+
1064
+ msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
+ msgstr "Zu viele Formularanfragen. Bitte warten Sie und versuchen Sie die Prüfung erneut. Ihr Entwurf bleibt erhalten."
@@ -1060,3 +1060,6 @@ msgstr "La cantidad de enlaces alcanzó el umbral de revisión."
1060
1060
 
1061
1061
  msgid "Retry check"
1062
1062
  msgstr "Reintentar la verificación"
1063
+
1064
+ msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
+ msgstr "Demasiadas solicitudes de formulario. Espera y vuelve a intentar la verificación. Tu borrador se conserva."
@@ -1060,3 +1060,6 @@ msgstr "Le nombre de liens a atteint le seuil de vérification."
1060
1060
 
1061
1061
  msgid "Retry check"
1062
1062
  msgstr "Réessayer la vérification"
1063
+
1064
+ msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
+ msgstr "Trop de demandes de formulaire. Veuillez patienter et réessayer la vérification. Votre brouillon est conservé."
@@ -1060,3 +1060,6 @@ msgstr "A quantidade de links atingiu o limite para revisão."
1060
1060
 
1061
1061
  msgid "Retry check"
1062
1062
  msgstr "Tentar verificação novamente"
1063
+
1064
+ msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
+ msgstr "Muitas solicitações de formulário. Aguarde e tente a verificação novamente. Seu rascunho foi mantido."
@@ -1060,3 +1060,6 @@ msgstr "Количество ссылок достигло порога пров
1060
1060
 
1061
1061
  msgid "Retry check"
1062
1062
  msgstr "Повторить проверку"
1063
+
1064
+ msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
+ msgstr "Слишком много запросов формы. Подождите и повторите проверку. Ваш черновик сохранён."
@@ -8,6 +8,7 @@ from django.utils.module_loading import import_string
8
8
 
9
9
  from .config import technical_settings
10
10
  from .models import Comment
11
+ from .page_access import site_page_paths
11
12
  from .services import DomainError
12
13
 
13
14
 
@@ -68,7 +69,9 @@ def _can_receive(recipient: Comment) -> bool:
68
69
  return False
69
70
  return _guest_can_receive(recipient, target)
70
71
  page = recipient.discussion.page
71
- if not page.live:
72
+ if not page.live or not page.path.startswith(
73
+ site_page_paths(recipient.discussion.site)
74
+ ):
72
75
  return False
73
76
  restrictions = list(page.get_view_restrictions())
74
77
  if not restrictions:
@@ -0,0 +1,56 @@
1
+ """Protect legacy private hashes without recovering their original values.
2
+
3
+ Stop writers and retain the same SECRET_KEY during this atomic data migration.
4
+ The keyed wrapping is intentionally irreversible; downgrade requires a backup.
5
+ Random capability/form hashes and existing keyed content signals are unchanged.
6
+ """
7
+
8
+ from typing import ClassVar
9
+
10
+ from django.apps.registry import Apps
11
+ from django.db import migrations
12
+ from django.db.backends.base.schema import BaseDatabaseSchemaEditor
13
+ from django.db.migrations.operations.base import Operation
14
+ from django.utils.crypto import salted_hmac
15
+
16
+
17
+ def protect_fingerprints(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) -> None:
18
+ """Rekey in bounded batches using historical models and the migration alias."""
19
+ alias = schema_editor.connection.alias
20
+
21
+ def wrap(hashed: str, purpose: str) -> str:
22
+ return salted_hmac(
23
+ "commentail.fingerprint." + purpose, hashed, algorithm="sha256"
24
+ ).hexdigest()
25
+
26
+ events = apps.get_model("commentail", "RateEvent").objects.using(alias)
27
+ cursor = 0
28
+ while batch := list(
29
+ events.exclude(kind="content").filter(pk__gt=cursor).order_by("pk")[:500]
30
+ ):
31
+ for event in batch:
32
+ event.subject_digest = wrap(
33
+ event.subject_digest, f"rate.{event.site_id}.{event.kind}"
34
+ )
35
+ events.bulk_update(batch, ["subject_digest"], batch_size=500)
36
+ cursor = batch[-1].pk
37
+
38
+ records = apps.get_model("commentail", "SubmissionRecord").objects.using(alias)
39
+ cursor = 0
40
+ while batch := list(records.filter(pk__gt=cursor).order_by("pk")[:500]):
41
+ for record in batch:
42
+ record.actor_digest = wrap(
43
+ record.actor_digest, f"submission.actor.{record.discussion_id}"
44
+ )
45
+ record.payload_digest = wrap(
46
+ record.payload_digest, f"submission.payload.{record.discussion_id}"
47
+ )
48
+ records.bulk_update(batch, ["actor_digest", "payload_digest"], batch_size=500)
49
+ cursor = batch[-1].pk
50
+
51
+
52
+ class Migration(migrations.Migration):
53
+ dependencies: ClassVar[list[tuple[str, str]]] = [
54
+ ("commentail", "0017_revision_spam_signals")
55
+ ]
56
+ operations: ClassVar[list[Operation]] = [migrations.RunPython(protect_fingerprints)]
@@ -45,42 +45,60 @@ def registry_errors(value: object) -> list[str]:
45
45
  errors: list[str] = []
46
46
  seen: set[str] = set()
47
47
  for label, path in value.items():
48
- try:
49
- if not isinstance(label, str) or not isinstance(path, str):
50
- raise TypeError
51
- model = apps.get_model(label)
52
- if (
53
- model is None
54
- or issubclass(model, Page)
55
- or model._meta.abstract
56
- or model._meta.proxy
57
- or model._meta.app_label in {"commentail", "contenttypes"}
58
- ):
59
- raise ValueError
60
- if not isinstance(
61
- model._meta.pk,
62
- (
63
- models.IntegerField,
64
- models.UUIDField,
65
- models.CharField,
66
- models.TextField,
67
- ),
68
- ):
69
- raise TypeError
70
- if model._meta.label_lower in seen:
71
- raise ValueError
72
- seen.add(model._meta.label_lower)
73
- adapter = import_string(path)
74
- if not isinstance(adapter, type) or not all(
75
- callable(getattr(adapter, method, None))
76
- for method in ("get_site", "can_view", "get_url")
77
- ):
78
- raise ValueError
79
- except (ValueError, TypeError, LookupError, ImportError, AttributeError):
80
- errors.append(f"Invalid OBJECT_ADAPTERS entry: {label}")
48
+ reason = _registry_entry_error(label, path, seen)
49
+ if reason:
50
+ name = label if isinstance(label, str) else "<non-string label>"
51
+ errors.append(f"Invalid OBJECT_ADAPTERS entry: {name} ({reason})")
81
52
  return errors
82
53
 
83
54
 
55
+ def _registry_entry_error(label: object, path: object, seen: set[str]) -> str:
56
+ if not isinstance(label, str):
57
+ return "model label must be a string"
58
+ if not isinstance(path, str):
59
+ return "adapter path must be a string"
60
+ try:
61
+ model = apps.get_model(label)
62
+ except ValueError:
63
+ return "expected app_label.ModelName"
64
+ except LookupError:
65
+ return "model not found"
66
+ if model is None:
67
+ return "model not found"
68
+ if issubclass(model, Page):
69
+ return "Page models use the Page integration"
70
+ if model._meta.abstract:
71
+ return "abstract models cannot be registered"
72
+ if model._meta.proxy:
73
+ return "proxy models cannot be registered"
74
+ if model._meta.app_label in {"commentail", "contenttypes"}:
75
+ return "internal models cannot be registered"
76
+ if not isinstance(
77
+ model._meta.pk,
78
+ (models.IntegerField, models.UUIDField, models.CharField, models.TextField),
79
+ ):
80
+ return "unsupported primary key; expected integer, UUID or string"
81
+ if model._meta.label_lower in seen:
82
+ return "duplicate model registration"
83
+ seen.add(model._meta.label_lower)
84
+
85
+ try:
86
+ adapter = import_string(path)
87
+ if not isinstance(adapter, type):
88
+ return "adapter must be a class"
89
+ missing = [
90
+ method
91
+ for method in ("get_site", "can_view", "get_url")
92
+ if not callable(getattr(adapter, method, None))
93
+ ]
94
+ except (ValueError, TypeError, LookupError, ImportError, AttributeError):
95
+ # Import/descriptor exceptions may carry private configuration payloads.
96
+ return "adapter import failed"
97
+ if missing:
98
+ return "missing callable methods: " + ", ".join(missing)
99
+ return ""
100
+
101
+
84
102
  def _adapter(model: type[models.Model]) -> ObjectAdapter:
85
103
  config = getattr(settings, "COMMENTAIL", {})
86
104
  registry = config.get("default", {}).get("OBJECT_ADAPTERS", {})