commentail 1.3.0__tar.gz → 1.3.1__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.
- {commentail-1.3.0 → commentail-1.3.1}/CHANGELOG.md +15 -0
- {commentail-1.3.0/commentail.egg-info → commentail-1.3.1}/PKG-INFO +8 -4
- {commentail-1.3.0 → commentail-1.3.1}/README.md +7 -3
- {commentail-1.3.0 → commentail-1.3.1}/README.ru.md +7 -3
- {commentail-1.3.0 → commentail-1.3.1}/commentail/admission.py +14 -4
- {commentail-1.3.0 → commentail-1.3.1}/commentail/antispam.py +16 -6
- {commentail-1.3.0 → commentail-1.3.1}/commentail/background.py +33 -6
- {commentail-1.3.0 → commentail-1.3.1}/commentail/config.py +4 -0
- commentail-1.3.1/commentail/fingerprints.py +33 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/limits.py +28 -8
- commentail-1.3.1/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/locale/de/LC_MESSAGES/django.po +3 -0
- commentail-1.3.1/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/locale/es/LC_MESSAGES/django.po +3 -0
- commentail-1.3.1/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/locale/fr/LC_MESSAGES/django.po +3 -0
- commentail-1.3.1/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/locale/pt_BR/LC_MESSAGES/django.po +3 -0
- commentail-1.3.1/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/locale/ru/LC_MESSAGES/django.po +3 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/mail_access.py +3 -1
- commentail-1.3.1/commentail/migrations/0018_private_fingerprints.py +56 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/objects.py +51 -33
- {commentail-1.3.0 → commentail-1.3.1}/commentail/public.py +5 -1
- {commentail-1.3.0 → commentail-1.3.1}/commentail/services.py +14 -14
- commentail-1.3.1/commentail/templates/commentail/form.html +1 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/widget.py +22 -17
- {commentail-1.3.0 → commentail-1.3.1/commentail.egg-info}/PKG-INFO +8 -4
- {commentail-1.3.0 → commentail-1.3.1}/commentail.egg-info/SOURCES.txt +8 -0
- commentail-1.3.1/docs/releases/1.3.1.md +78 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Changelog.md +15 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Configuration.md +2 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Deployment.md +23 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Email-and-worker.md +6 -1
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Example-and-testing.md +1 -1
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Home.md +4 -3
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Installation.md +5 -4
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Object-adapters.md +5 -0
- commentail-1.3.1/docs/wiki/Release-1.3.1.md +78 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Security-and-privacy.md +32 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Styling.md +1 -1
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/_Sidebar.md +1 -0
- {commentail-1.3.0 → commentail-1.3.1}/pyproject.toml +1 -1
- commentail-1.3.1/tests/test_background.py +351 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_cleanup.py +4 -2
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_concurrency.py +13 -1
- commentail-1.3.1/tests/test_fingerprints.py +257 -0
- commentail-1.3.1/tests/test_form_issuance_limits.py +119 -0
- commentail-1.3.1/tests/test_registry_diagnostics.py +89 -0
- commentail-1.3.1/tests/test_security_boundaries.py +86 -0
- commentail-1.3.0/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
- commentail-1.3.0/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
- commentail-1.3.0/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
- commentail-1.3.0/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- commentail-1.3.0/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
- commentail-1.3.0/commentail/templates/commentail/form.html +0 -1
- commentail-1.3.0/tests/test_background.py +0 -174
- {commentail-1.3.0 → commentail-1.3.1}/LICENSE +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/MANIFEST.in +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/admin_queries.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/admin_settings.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/admin_urls.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/admin_views.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/apps.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/assets.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/author_access.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/avatars.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/captcha_providers.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/checks.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/content_checks.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/detection.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/drafts.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/forms.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/group_permissions.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/logging.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/management/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/management/commands/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/management/commands/process_commentail.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/middleware.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0001_initial.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0002_sitegrouppermission_hide_sitegrouppermission_view.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0003_actiontoken_captchachallenge_guestgrant.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0004_submissionrecord.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0005_rateevent.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0006_alter_comment_guest_name_and_more.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0007_actiontoken_nonce_replysubscription_mailjob.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0008_mailjob_revision.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0009_formticket.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0010_captchachallenge_backend_and_more.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0011_discussion_content_type_discussion_object_id_and_more.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0012_formticket_draft.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0013_sitecommentsettings_email_enabled.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0014_reading_indexes.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0015_sitecommentsettings_highlight_staff.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0016_guest_antispam.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/0017_revision_spam_signals.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/migrations/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/models.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/outbox.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/page_integration.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/panels.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/permissions.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/policies.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/presentation.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/reading.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/recent.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/rules_csv.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/security.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/signals.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/static/commentail/admin.css +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/static/commentail/admin.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/static/commentail/commentail.css +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/static/commentail/commentail.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/structured.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/action.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/action_error.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/base.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/confirm_delete.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/detail.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/field.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/form.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/group_permission_row.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/group_permissions.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/heading.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/list.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/mail.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/management.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/objects.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/page_panel.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/rules.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/rules_import.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/admin/selection.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/author.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/avatar.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/base.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/block.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/captcha.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/comment.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/edit-form.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/base.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/button.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/confirm.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/confirm.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/confirm_subject.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/edit.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/edit.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/edit_subject.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/published.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/published.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/published_subject.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/rejected.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/rejected.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/rejected_subject.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/reply.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/reply.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/emails/reply_subject.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/provider-captcha.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templates/commentail/replies.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templatetags/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templatetags/commentail_admin.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/templatetags/commentail_tags.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/text.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/urls.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/validation.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/views.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail/wagtail_hooks.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail.egg-info/dependency_links.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail.egg-info/requires.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/commentail.egg-info/top_level.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/assets/commentail-preview.png +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/assets/support-qr.png +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/0.1.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/0.1.1.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/0.2.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/1.0.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/1.1.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/1.2.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/releases/1.3.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Callbacks.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Guest-comments.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Moderation.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Performance.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Recent-comments.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-0.1.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-0.1.1.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-0.2.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-1.0.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-1.1.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-1.2.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Release-1.3.0.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Replies-and-editing.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Roadmap.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Rules-and-CSV.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Stability.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Structured-data.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Support.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Template-contract.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Templates.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/Troubleshooting.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/docs/wiki/_Footer.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/README.md +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo/settings.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo/urls.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/comments.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/management/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/management/commands/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/management/commands/bootstrap_demo.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/migrations/0001_initial.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/migrations/0002_product.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/migrations/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/models.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/templates/demo_home/home_page.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/templates/demo_home/product.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/demo_home/views.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/example/manage.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/requirements-test-common.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/requirements-test.txt +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/setup.cfg +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/settings.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/targets/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/targets/apps.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/targets/migrations/0001_initial.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/targets/migrations/__init__.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/targets/models.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/templates/wagtailcore/page.html +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_actions.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_admin.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_admin_ui.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_admission.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_antispam.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_avatars.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_capability_access.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_captcha_backend.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_captcha_providers.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_content_checks.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_detection.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_email_backends.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_email_presentation.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_extension_contracts.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_group_panel.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_inline_edit.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_input_boundaries.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_lifecycle.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_localization.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_mail_admin.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_name_limit.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_notifications.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_object_adapters.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_outbox.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_performance.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_presentation_contracts.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_progressive.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_provider_widgets.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_public_ui.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_rate_limits.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_reading_contracts.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_recent_comments.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_release_gaps.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_reply.js +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_rules_admin.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_rules_csv.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_security.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_smtp_chain.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_staff_authors.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_structured_data.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_submission.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/test_transaction_contracts.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/urls.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tests/urls_custom_prefix.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tools/benchmark_performance.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tools/check_dist.py +0 -0
- {commentail-1.3.0 → commentail-1.3.1}/tools/check_translations.py +0 -0
|
@@ -3,6 +3,20 @@
|
|
|
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.1] — 2026-10-23 · Security update
|
|
7
|
+
|
|
8
|
+
- Key quota identities and submission actor/payload fingerprints with purpose-scoped
|
|
9
|
+
HMAC; migrate existing records without resetting quotas or accepted retries.
|
|
10
|
+
- Deny Page discussions, protected links and mail outside the saved Site root.
|
|
11
|
+
- Limit form/recovery ticket issuance per Site/IP while preserving reading,
|
|
12
|
+
submitted drafts and existing valid tickets; translate refusal in all UI languages.
|
|
13
|
+
- Report distinct object-adapter validation causes without private exception text.
|
|
14
|
+
- Clean expired CAPTCHA, guest grants, form tickets and rate events in batches
|
|
15
|
+
of at most 500, committing each batch independently and preserving live records.
|
|
16
|
+
|
|
17
|
+
Migration `0018` is irreversible: stop writers and back up database/key/package
|
|
18
|
+
before upgrading. See the [1.3.1 upgrade notes](docs/releases/1.3.1.md).
|
|
19
|
+
|
|
6
20
|
## [1.3.0] — 2026-10-22 · Stable
|
|
7
21
|
|
|
8
22
|
- Keep bundled external CAPTCHA bindings valid for the form lifetime, allowing
|
|
@@ -227,5 +241,6 @@ See [0.1.0 release notes](docs/releases/0.1.0.md).
|
|
|
227
241
|
|
|
228
242
|
[1.1.0]: https://github.com/hardcodd/Commentail/compare/v1.0.0...v1.1.0
|
|
229
243
|
|
|
244
|
+
[1.3.1]: https://github.com/hardcodd/Commentail/compare/v1.3.0...v1.3.1
|
|
230
245
|
[1.3.0]: https://github.com/hardcodd/Commentail/compare/v1.2.0...v1.3.0
|
|
231
246
|
[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.
|
|
3
|
+
Version: 1.3.1
|
|
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,11 @@ 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.
|
|
37
|
+
**Current release: [1.3.1](https://github.com/hardcodd/Commentail/releases/tag/v1.3.1)** · [PyPI](https://pypi.org/project/commentail/1.3.1/)
|
|
38
|
+
|
|
39
|
+
[1.3.1 is a security update](docs/releases/1.3.1.md). Upgrading requires an
|
|
40
|
+
irreversible fingerprint data migration; review the backup, downtime and
|
|
41
|
+
form-quota guidance before upgrading.
|
|
38
42
|
|
|
39
43
|
[](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
|
|
40
44
|
[](https://djangopackages.org/packages/p/commentail/)
|
|
@@ -171,11 +175,11 @@ The guides are in English; this README is also [available in Russian](README.ru.
|
|
|
171
175
|
In your existing Wagtail site's virtual environment, install the published release:
|
|
172
176
|
|
|
173
177
|
```sh
|
|
174
|
-
python -m pip install commentail==1.3.
|
|
178
|
+
python -m pip install commentail==1.3.1
|
|
175
179
|
```
|
|
176
180
|
|
|
177
181
|
For the optional PostgreSQL driver, use
|
|
178
|
-
`python -m pip install 'commentail[postgres]==1.3.
|
|
182
|
+
`python -m pip install 'commentail[postgres]==1.3.1'`.
|
|
179
183
|
For an existing installation, follow
|
|
180
184
|
the [upgrade guide](docs/wiki/Installation.md#upgrading-and-restoring) for your target version.
|
|
181
185
|
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Moderated discussions, verified guests and inline replies — styled by your site.
|
|
8
8
|
|
|
9
|
-
**Current release: [1.3.
|
|
9
|
+
**Current release: [1.3.1](https://github.com/hardcodd/Commentail/releases/tag/v1.3.1)** · [PyPI](https://pypi.org/project/commentail/1.3.1/)
|
|
10
|
+
|
|
11
|
+
[1.3.1 is a security update](docs/releases/1.3.1.md). Upgrading requires an
|
|
12
|
+
irreversible fingerprint data migration; review the backup, downtime and
|
|
13
|
+
form-quota guidance before upgrading.
|
|
10
14
|
|
|
11
15
|
[](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
|
|
12
16
|
[](https://djangopackages.org/packages/p/commentail/)
|
|
@@ -143,11 +147,11 @@ The guides are in English; this README is also [available in Russian](README.ru.
|
|
|
143
147
|
In your existing Wagtail site's virtual environment, install the published release:
|
|
144
148
|
|
|
145
149
|
```sh
|
|
146
|
-
python -m pip install commentail==1.3.
|
|
150
|
+
python -m pip install commentail==1.3.1
|
|
147
151
|
```
|
|
148
152
|
|
|
149
153
|
For the optional PostgreSQL driver, use
|
|
150
|
-
`python -m pip install 'commentail[postgres]==1.3.
|
|
154
|
+
`python -m pip install 'commentail[postgres]==1.3.1'`.
|
|
151
155
|
For an existing installation, follow
|
|
152
156
|
the [upgrade guide](docs/wiki/Installation.md#upgrading-and-restoring) for your target version.
|
|
153
157
|
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Модерация обсуждений, подтверждённые гости и ответы рядом с комментарием — в стиле вашего сайта.
|
|
8
8
|
|
|
9
|
-
**Текущая версия: [1.3.
|
|
9
|
+
**Текущая версия: [1.3.1](https://github.com/hardcodd/Commentail/releases/tag/v1.3.1)** · [PyPI](https://pypi.org/project/commentail/1.3.1/)
|
|
10
|
+
|
|
11
|
+
[1.3.1 — обновление безопасности](docs/releases/1.3.1.md). Обновление требует
|
|
12
|
+
необратимой миграции отпечатков; заранее проверьте рекомендации о резервной
|
|
13
|
+
копии, остановке записи и лимитах выдачи форм.
|
|
10
14
|
|
|
11
15
|
[](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
|
|
12
16
|
[](https://djangopackages.org/packages/p/commentail/)
|
|
@@ -144,11 +148,11 @@ CDN и CAPTCHA-сервисов нет. См. [настройку писем](do
|
|
|
144
148
|
В виртуальном окружении существующего сайта Wagtail установите опубликованный выпуск:
|
|
145
149
|
|
|
146
150
|
```sh
|
|
147
|
-
python -m pip install commentail==1.3.
|
|
151
|
+
python -m pip install commentail==1.3.1
|
|
148
152
|
```
|
|
149
153
|
|
|
150
154
|
Для необязательного драйвера PostgreSQL используйте
|
|
151
|
-
`python -m pip install 'commentail[postgres]==1.3.
|
|
155
|
+
`python -m pip install 'commentail[postgres]==1.3.1'`.
|
|
152
156
|
Для существующей установки следуйте [инструкции обновления](docs/wiki/Installation.md#upgrading-and-restoring)
|
|
153
157
|
до нужной версии.
|
|
154
158
|
|
|
@@ -20,6 +20,7 @@ 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
|
|
25
26
|
from .policies import editorial_settings, email_enabled
|
|
@@ -47,9 +48,13 @@ def can_view(request: HttpRequest, discussion: Discussion) -> bool:
|
|
|
47
48
|
except ObjectAccessError:
|
|
48
49
|
return False
|
|
49
50
|
page = discussion.page
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
return (
|
|
52
|
+
page.live
|
|
53
|
+
and page.path.startswith(discussion.site.root_page.path)
|
|
54
|
+
and all(
|
|
55
|
+
restriction.accept_request(request)
|
|
56
|
+
for restriction in page.get_view_restrictions()
|
|
57
|
+
)
|
|
53
58
|
)
|
|
54
59
|
|
|
55
60
|
|
|
@@ -79,6 +84,7 @@ def issue_form(
|
|
|
79
84
|
"""
|
|
80
85
|
if not can_view(request, discussion):
|
|
81
86
|
raise DomainError("Page access is required")
|
|
87
|
+
consume(discussion.site, "form", "", client_ip(request, discussion.site))
|
|
82
88
|
session = session_digest(request)
|
|
83
89
|
now = timezone.now()
|
|
84
90
|
prior = FormTicket.objects.filter(
|
|
@@ -191,7 +197,11 @@ def accept_request(
|
|
|
191
197
|
|
|
192
198
|
def recorded() -> bool:
|
|
193
199
|
return SubmissionRecord.objects.filter(
|
|
194
|
-
discussion=discussion,
|
|
200
|
+
discussion=discussion,
|
|
201
|
+
actor_digest__in=fingerprint_candidates(
|
|
202
|
+
actor, f"submission.actor.{discussion.pk}"
|
|
203
|
+
),
|
|
204
|
+
key_digest=digest(key),
|
|
195
205
|
).exists()
|
|
196
206
|
|
|
197
207
|
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 =
|
|
75
|
-
address =
|
|
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
|
-
|
|
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(
|
|
100
|
-
|
|
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)
|
|
43
|
-
GuestGrant.objects.filter(expires_at__lte=now)
|
|
44
|
-
FormTicket.objects.filter(expires_at__lte=now)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
|
104
|
-
if count(ip_kind, ip, 60) >= options["
|
|
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,
|
|
128
|
+
site=site,
|
|
129
|
+
kind=author_kind,
|
|
130
|
+
subject_digest=fingerprint(author, f"rate.{site.pk}.{author_kind}"),
|
|
115
131
|
)
|
|
116
|
-
RateEvent.objects.create(
|
|
132
|
+
RateEvent.objects.create(
|
|
133
|
+
site=site,
|
|
134
|
+
kind=ip_kind,
|
|
135
|
+
subject_digest=fingerprint(ip, f"rate.{site.pk}.{ip_kind}"),
|
|
136
|
+
)
|
|
Binary file
|
|
@@ -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."
|
|
Binary file
|
|
@@ -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."
|
|
Binary file
|
|
@@ -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é."
|
|
Binary file
|
|
@@ -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."
|
|
Binary file
|
|
@@ -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 "Слишком много запросов формы. Подождите и повторите проверку. Ваш черновик сохранён."
|
|
@@ -68,7 +68,9 @@ def _can_receive(recipient: Comment) -> bool:
|
|
|
68
68
|
return False
|
|
69
69
|
return _guest_can_receive(recipient, target)
|
|
70
70
|
page = recipient.discussion.page
|
|
71
|
-
if not page.live
|
|
71
|
+
if not page.live or not page.path.startswith(
|
|
72
|
+
recipient.discussion.site.root_page.path
|
|
73
|
+
):
|
|
72
74
|
return False
|
|
73
75
|
restrictions = list(page.get_view_restrictions())
|
|
74
76
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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", {})
|
|
@@ -40,7 +40,11 @@ def _draft_redirect(
|
|
|
40
40
|
if not is_document(request):
|
|
41
41
|
return None
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
try:
|
|
44
|
+
destination = save_draft(request, discussion, error)
|
|
45
|
+
except DomainError:
|
|
46
|
+
# Render the submitted values when recovery cannot issue another ticket.
|
|
47
|
+
return None
|
|
44
48
|
if destination is None:
|
|
45
49
|
raise Http404
|
|
46
50
|
|