')
+@@ -62,7 +61,10 @@ class MyRenderer(mistune.HTMLRenderer):
+ URLs (text=None) so text is same as URL.
+ It also adds target=“_blank” so that the URLs open in a new tab.
+ """
+- if text is None:
++ # text can be none of same as url in case of autolink parsing. This
++ # will truncate the length of the URL in both cases but preserve
++ # the actual URL destination in the hyperlink.
++ if text is None or text == url:
+ text = url
+ if len(text) > 76:
+ text = url[:76] + '...'
+@@ -103,26 +105,26 @@ class BlockParser(mistune.block_parser.BlockParser):
+ mistune.block_parser.BlockParser.DEFAULT_RULES)
+
+
+-OUTLOOK_REPLY_PATTERN = re.compile(
++OUTLOOK_REPLY_PATTERN = (
+ r'^-------- Original message --------\n'
+- r'([\s\S]+)', # everything after newline.
+- re.M
++ r'(?P[\s\S]+)' # everything after newline
+ )
+
+
+ def parse_outlook_reply(block, m, state):
+ """Parser for outlook style replies."""
+- text = m.group(0)
+- return {
++ text = m.group('reply_text')
++ reply_token = '-------- Original message --------\n'
++ state.append_token({
+ 'type': 'block_quote',
+- 'children': [{'type': 'paragraph', 'text': text}]
+- }
++ 'children': [{'type': 'paragraph', 'text': reply_token + text}],
++ })
++ return m.end() + 1
+
+
+ def plugin_outlook_reply(md):
+- md.block.register_rule(
++ md.block.register(
+ 'outlook_reply', OUTLOOK_REPLY_PATTERN, parse_outlook_reply)
+- md.block.rules.insert(-1, 'outlook_reply')
+
+
+ # Signature Plugin looks for signature pattern in email content and converts it
+@@ -209,12 +211,11 @@ markdown_renderer = mistune.Markdown(
+ renderer=renderer,
+ inline=InlineParser(hard_wrap=False),
+ block=BlockParser(),
+-
+ plugins=[
++ plugin_outlook_reply,
+ plugin_pgp_signature,
+ plugin_signature,
+- plugin_outlook_reply,
+- url
++ url,
+ ])
+
+
+diff --git a/hyperkitty/tests/test_templatetags.py b/hyperkitty/tests/test_templatetags.py
+index b1d83177..f567388d 100644
+--- a/hyperkitty/tests/test_templatetags.py
++++ b/hyperkitty/tests/test_templatetags.py
+@@ -147,9 +147,6 @@ class TestGravatar(TestCase):
class TestDecorate(TestCase):
@@ -280,14 +512,16 @@ Index: HyperKitty-1.3.7/hyperkitty/tests/test_templatetags.py
def test_parse_quote(self):
contents = """
On Fri, 09.11.12 11:27, Someone wrote:
- > This is the first quoted line
- > On Fri 07.25.12, Aperson wrote:
- >> This is the second quoted line.
-+
- This is the response.
- """
- expected = (
-@@ -184,7 +182,7 @@ https://some.url/llasdfjaksdgfjsdfgkjasd
+@@ -168,8 +165,6 @@ This is the response.
+ ''
+ '
This is the response.
\n')
+ result = markdown_renderer(contents)
+- print('----------'*10)
+- print(result)
+ self.assertEqual(result.strip(), expected.strip())
+
+ def test_parse_heading_normal(self):
+@@ -187,7 +182,7 @@ https://some.url/llasdfjaksdgfjsdfgkjasdfbgksdfjgbsdfkgjbsdflkgjbsdflgksjdhfbgks
result = markdown_renderer(contents)
self.assertEqual(
result.strip(),
@@ -296,11 +530,67 @@ Index: HyperKitty-1.3.7/hyperkitty/tests/test_templatetags.py
def test_autolink_small_url(self):
# Test that autolink doesn't add ... to URLs that aren't truncated.
-@@ -219,6 +217,7 @@ https://some.url/example
- # This is another sample text.
+@@ -241,6 +236,7 @@ Subject: Testing if the quoted reply works with Outlook style.
+ This is the original text *with* some __markup__.
"""
result = markdown_renderer(contents)
+ print(result)
self.assertEqual(
result.strip(),
- '
# This is another sample text.
')
+ """
This is the replied text.
+@@ -250,9 +246,7 @@ From: A person <person(a)example.com>
+ Date: 6/26/23 16:23 (GMT-05:00)
+ To: mytestlist@example.com
+ Subject: Testing if the quoted reply works with Outlook style.
+-
+-This is the original text *with* some __markup__.
+-
++This is the original text *with* some __markup__.
+ """) # noqa: E501
+
+
+--
+GitLab
+
+
+From af17c334a2a35d672c9c732ed9a37bc780fdb64d Mon Sep 17 00:00:00 2001
+From: Abhilash Raj
+Date: Wed, 12 Jul 2023 14:14:00 +0530
+Subject: [PATCH 6/6] qa fixes
+
+---
+ hyperkitty/lib/renderer.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hyperkitty/lib/renderer.py b/hyperkitty/lib/renderer.py
+index ddb2a77d..7f1a3230 100644
+--- a/hyperkitty/lib/renderer.py
++++ b/hyperkitty/lib/renderer.py
+@@ -4,7 +4,6 @@ from django.conf import settings
+
+ import mistune
+ from mistune.plugins.url import url
+-from mistune.util import escape as escape_html
+ from mistune.util import safe_entity
+
+
+@@ -91,6 +90,7 @@ class InlineParser(mistune.inline_parser.InlineParser):
+ state.tokens[-1] = last_token
+ return end_pos
+
++
+ def remove_header_rules(rules):
+ rules = list(rules)
+ for rule in ('setex_header', 'axt_heading'):
+@@ -107,7 +107,7 @@ class BlockParser(mistune.block_parser.BlockParser):
+
+ OUTLOOK_REPLY_PATTERN = (
+ r'^-------- Original message --------\n'
+- r'(?P[\s\S]+)' # everything after newline
++ r'(?P[\s\S]+)' # everything after newline
+ )
+
+
+--
+GitLab
+
diff --git a/python-HyperKitty.changes b/python-HyperKitty.changes
index 35e752c..3d96ece 100644
--- a/python-HyperKitty.changes
+++ b/python-HyperKitty.changes
@@ -1,3 +1,12 @@
+-------------------------------------------------------------------
+Thu Nov 2 09:27:37 UTC 2023 - Andreas Schneider
+
+- Update to version 1.3.8
+ * See https://gitlab.com/mailman/hyperkitty/-/blob/v1.3.8/doc/news.rst
+ or the file news.ret included in this package
+- Removed fix-elasticsearch8.patch
+- Updated mistune3.patch
+
-------------------------------------------------------------------
Thu Oct 5 08:21:08 UTC 2023 - Markéta Machová
diff --git a/python-HyperKitty.spec b/python-HyperKitty.spec
index 01f3555..f1cd895 100644
--- a/python-HyperKitty.spec
+++ b/python-HyperKitty.spec
@@ -47,7 +47,7 @@
%endif
Name: python-HyperKitty
-Version: 1.3.7
+Version: 1.3.8
Release: 0
Summary: A web interface to access GNU Mailman v3 archives
License: GPL-3.0-only
@@ -68,8 +68,6 @@ Source30: README.SUSE.md
# PATCH-FIX-OPENSUSE hyperkitty-settings.patch mcepl@suse.com
# hard-code locations of configuration files
Patch0: hyperkitty-settings.patch
-# PATCH-FIX-UPSTREAM fix-elasticsearch8.patch gl#mailman/hyperkitty#468
-Patch1: fix-elasticsearch8.patch
# PATCH-FIX-UPSTREAM mistune3.patch gl#mailman/hyperkitty#541
Patch2: mistune3.patch
#
From ff92243f44724835a3064e088a83906dee0e572eb744f00462801b62bf23b7e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?=
Date: Thu, 2 Nov 2023 12:33:49 +0000
Subject: [PATCH 2/4] fix deps
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-HyperKitty?expand=0&rev=71
---
python-HyperKitty.spec | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/python-HyperKitty.spec b/python-HyperKitty.spec
index f1cd895..36d2dfa 100644
--- a/python-HyperKitty.spec
+++ b/python-HyperKitty.spec
@@ -77,7 +77,6 @@ BuildRequires: %{python_module django-debug-toolbar >= 2.2}
BuildRequires: %{python_module django-extensions >= 1.3.7}
BuildRequires: %{python_module django-gravatar2 >= 1.0.6}
BuildRequires: %{python_module isort}
-BuildRequires: %{python_module libsass}
BuildRequires: %{python_module mailmanclient >= 3.3.2}
BuildRequires: %{python_module mistune >= 2.0}
BuildRequires: %{python_module setuptools}
@@ -95,11 +94,11 @@ BuildArch: noarch
BuildRequires: python3-packaging
%endif
# SECTION test requirements
-BuildRequires: %{python_module Django >= 1.11}
+BuildRequires: %{python_module Django >= 3.2}
BuildRequires: %{python_module Whoosh >= 2.5.7}
BuildRequires: %{python_module beautifulsoup4 >= 4.3.2}
BuildRequires: %{python_module django-haystack >= 2.8.0}
-BuildRequires: %{python_module django-mailman3 >= 1.3.8}
+BuildRequires: %{python_module django-mailman3 >= 1.3.10}
BuildRequires: %{python_module django-q >= 1.3.9}
BuildRequires: %{python_module djangorestframework >= 3.0.0}
BuildRequires: %{python_module elasticsearch}
@@ -119,18 +118,17 @@ A web interface to access GNU Mailman v3 archives.
%package -n %{hyperkitty_pkgname}
Summary: A web interface to access GNU Mailman v3 archives
-Requires: %{mypython}-Django >= 1.11
+Requires: %{mypython}-Django >= 3.2
Requires: %{mypython}-Whoosh
Requires: %{mypython}-django-compressor >= 1.3
Requires: %{mypython}-django-debug-toolbar >= 2.2
Requires: %{mypython}-django-extensions >= 1.3.7
Requires: %{mypython}-django-gravatar2 >= 1.0.6
Requires: %{mypython}-django-haystack >= 2.8.0
-Requires: %{mypython}-django-mailman3 >= 1.3.7
+Requires: %{mypython}-django-mailman3 >= 1.3.10
Requires: %{mypython}-django-q >= 1.3.9
Requires: %{mypython}-djangorestframework >= 3.0.0
Requires: %{mypython}-flufl.lock
-Requires: %{mypython}-libsass
Requires: %{mypython}-mailmanclient >= 3.3.2
Requires: %{mypython}-mistune
Requires: %{mypython}-networkx >= 1.9.1
From 6d791e7c8e7a373863477dffd285c6c88e607604f03a8e0756b8f13d580c1fc1 Mon Sep 17 00:00:00 2001
From: Andreas Schneider
Date: Mon, 6 Nov 2023 08:25:07 +0000
Subject: [PATCH 3/4] Accepting request 1123458 from
home:darix:branches:devel:languages:python:mailman
- ensure that we can create the user and group
- make user and group creation verbose so we actually see errors
- make it easier to notice to keep buildrequires and runtime
requires version limits in sync. This will also help us to notice
early when the version of other libraries do not match the
requires encoded in the source code.
OBS-URL: https://build.opensuse.org/request/show/1123458
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-HyperKitty?expand=0&rev=72
---
python-HyperKitty.changes | 18 +++++++++
python-HyperKitty.spec | 81 ++++++++++++++++++++++++---------------
2 files changed, 69 insertions(+), 30 deletions(-)
diff --git a/python-HyperKitty.changes b/python-HyperKitty.changes
index 3d96ece..ea1abe4 100644
--- a/python-HyperKitty.changes
+++ b/python-HyperKitty.changes
@@ -1,3 +1,21 @@
+-------------------------------------------------------------------
+Mon Nov 6 01:20:05 UTC 2023 - Marcus Rueckert
+
+- ensure that we can create the user and group
+
+-------------------------------------------------------------------
+Mon Nov 6 01:10:25 UTC 2023 - Marcus Rueckert
+
+- make user and group creation verbose so we actually see errors
+
+-------------------------------------------------------------------
+Mon Nov 6 00:05:35 UTC 2023 - Marcus Rueckert
+
+- make it easier to notice to keep buildrequires and runtime
+ requires version limits in sync. This will also help us to notice
+ early when the version of other libraries do not match the
+ requires encoded in the source code.
+
-------------------------------------------------------------------
Thu Nov 2 09:27:37 UTC 2023 - Andreas Schneider
diff --git a/python-HyperKitty.spec b/python-HyperKitty.spec
index 36d2dfa..4b1a323 100644
--- a/python-HyperKitty.spec
+++ b/python-HyperKitty.spec
@@ -15,6 +15,25 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
+# keep in sync with setup.py
+%global django_min_version 3.2
+%global django_max_version 4.3
+%global django_mailman3_min_version 1.3.10
+%global django_gravatar2_min_version 1.0.6
+%global djangorestframework_min_version 3.0.0
+%global robot_detection_min_version 0.3
+%global pytz_min_version 2012
+%global django_compressor_min_version 1.3
+%global mailmanclient_min_version 3.3.3
+# original this was >= 2.0.0, < 3.0 but overwritten by mistune3.patch
+%global mistune_min_version 3.0
+%global python_dateutil_min_version 2.0
+%global networkx_min_version 2.0
+%global django_haystack_min_version 2.8.0
+%global django_extensions_min_version 1.3.7
+%global flufl_lock_min_version 4.0
+%global django_q_min_version 1.0.0
+
%{?sle15_python_module_pythons}
%global webapps_dir /srv/www/webapps
@@ -71,14 +90,15 @@ Patch0: hyperkitty-settings.patch
# PATCH-FIX-UPSTREAM mistune3.patch gl#mailman/hyperkitty#541
Patch2: mistune3.patch
#
-BuildRequires: %{python_module django-compressor >= 1.3}
+BuildRequires: %{python_module Django >= %{django_min_version}}
+BuildRequires: %{python_module django-compressor >= %{django_compressor_min_version}}
BuildRequires: %{python_module Whoosh}
BuildRequires: %{python_module django-debug-toolbar >= 2.2}
BuildRequires: %{python_module django-extensions >= 1.3.7}
-BuildRequires: %{python_module django-gravatar2 >= 1.0.6}
+BuildRequires: %{python_module django-gravatar2 >= %{django_gravatar2_min_version}}
BuildRequires: %{python_module isort}
-BuildRequires: %{python_module mailmanclient >= 3.3.2}
-BuildRequires: %{python_module mistune >= 2.0}
+BuildRequires: %{python_module mailmanclient >= %{mailmanclient_min_version}}
+BuildRequires: %{python_module mistune >= %{mistune_min_version}}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module xapian-haystack >= 2.1.0}
BuildRequires: acl
@@ -94,23 +114,22 @@ BuildArch: noarch
BuildRequires: python3-packaging
%endif
# SECTION test requirements
-BuildRequires: %{python_module Django >= 3.2}
BuildRequires: %{python_module Whoosh >= 2.5.7}
BuildRequires: %{python_module beautifulsoup4 >= 4.3.2}
BuildRequires: %{python_module django-haystack >= 2.8.0}
-BuildRequires: %{python_module django-mailman3 >= 1.3.10}
-BuildRequires: %{python_module django-q >= 1.3.9}
-BuildRequires: %{python_module djangorestframework >= 3.0.0}
+BuildRequires: %{python_module django-mailman3 >= %{django_mailman3_min_version}}
+BuildRequires: %{python_module django-q >= %{django_q_min_version}}
+BuildRequires: %{python_module djangorestframework >= %{djangorestframework_min_version}}
BuildRequires: %{python_module elasticsearch}
-BuildRequires: %{python_module flufl.lock}
+BuildRequires: %{python_module flufl.lock >= %{flufl_lock_min_version}}
BuildRequires: %{python_module lxml}
-BuildRequires: %{python_module mistune}
-BuildRequires: %{python_module networkx >= 1.9.1}
+BuildRequires: %{python_module mistune >= %{mistune_min_version}}
+BuildRequires: %{python_module networkx >= %{networkx_min_version}}
BuildRequires: %{python_module pytest-django}
BuildRequires: %{python_module pytest}
-BuildRequires: %{python_module python-dateutil >= 2.0}
-BuildRequires: %{python_module pytz >= 2012}
-BuildRequires: %{python_module robot-detection >= 0.3}
+BuildRequires: %{python_module python-dateutil >= %{python_dateutil_min_version}}
+BuildRequires: %{python_module pytz >= %{pytz_min_version}}
+BuildRequires: %{python_module robot-detection >= %{robot_detection_min_version}}
# /SECTION
%description
@@ -118,23 +137,23 @@ A web interface to access GNU Mailman v3 archives.
%package -n %{hyperkitty_pkgname}
Summary: A web interface to access GNU Mailman v3 archives
-Requires: %{mypython}-Django >= 3.2
-Requires: %{mypython}-Whoosh
-Requires: %{mypython}-django-compressor >= 1.3
+# important sync with
+Requires: (%{mypython}-Django >= %{django_min_version} with %{mypython}-Django < %{django_max_version})
+Requires: %{mypython}-django-compressor >= %{django_compressor_min_version}
Requires: %{mypython}-django-debug-toolbar >= 2.2
Requires: %{mypython}-django-extensions >= 1.3.7
-Requires: %{mypython}-django-gravatar2 >= 1.0.6
+Requires: %{mypython}-django-gravatar2 >= %{django_gravatar2_min_version}
Requires: %{mypython}-django-haystack >= 2.8.0
-Requires: %{mypython}-django-mailman3 >= 1.3.10
-Requires: %{mypython}-django-q >= 1.3.9
-Requires: %{mypython}-djangorestframework >= 3.0.0
-Requires: %{mypython}-flufl.lock
-Requires: %{mypython}-mailmanclient >= 3.3.2
-Requires: %{mypython}-mistune
-Requires: %{mypython}-networkx >= 1.9.1
-Requires: %{mypython}-python-dateutil >= 2.0
-Requires: %{mypython}-pytz >= 2012
-Requires: %{mypython}-robot-detection >= 0.3
+Requires: %{mypython}-django-mailman3 >= %{django_mailman3_min_version}
+Requires: %{mypython}-django-q >= %{django_q_min_version}
+Requires: %{mypython}-djangorestframework >= %{djangorestframework_min_version}
+Requires: %{mypython}-flufl.lock >= %{flufl_lock_min_version}
+Requires: %{mypython}-mailmanclient >= %{mailmanclient_min_version}
+Requires: %{mypython}-mistune >= %{mistune_min_version}
+Requires: %{mypython}-networkx >= %{networkx_min_version}
+Requires: %{mypython}-python-dateutil >= %{python_dateutil_min_version}
+Requires: %{mypython}-pytz >= %{pytz_min_version}
+Requires: %{mypython}-robot-detection >= %{robot_detection_min_version}
Requires: %{mypython}-xapian-haystack >= 2.1.0
%if "%{expand:%%%{mypython}_provides}" == "python3"
Provides: python3-%{hyperkitty_pkgname} = %{version}-%{release}
@@ -155,6 +174,8 @@ Requires: %{hyperkitty_pkgname}
Requires: acl
Requires: openssl
Requires: sudo
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
%description -n %{hyperkitty_pkgname}-web
A web user interface for GNU Mailman.
@@ -293,8 +314,8 @@ export LANG=C.UTF-8
%pytest
%pre -n %{hyperkitty_pkgname}-web
-/usr/sbin/groupadd -r hyperkitty &>/dev/null || :
-/usr/sbin/useradd -g hyperkitty -s /bin/false -r -c "HyperKitty" -d %{hyperkitty_basedir} hyperkitty &>/dev/null || :
+/usr/sbin/groupadd -r hyperkitty || :
+/usr/sbin/useradd -g hyperkitty -s /bin/false -r -c "HyperKitty" -d %{hyperkitty_basedir} hyperkitty || :
%service_add_pre %{hyperkitty_services}
From 1cb450d3b0fbba05119a8784fa4db58b41f435375adf6d07bee33907087764ff Mon Sep 17 00:00:00 2001
From: Andreas Schneider
Date: Mon, 6 Nov 2023 13:53:03 +0000
Subject: [PATCH 4/4] Accepting request 1123579 from
openSUSE:infrastructure:mailman3
- forgot to use 2 defined variables:
%{django_haystack_min_version}
%{django_extensions_min_version}
- make it easy to run a build without testsuite
osc build --without=testsuite
- refresh gl-mr300-add-opengraph-metadata.patch for version update
- Add upstream patch gl-mr300-add-opengraph-metadata.patch:
* Add OpenGraph Metadata (https://gitlab.com/mailman/hyperkitty/-/merge_requests/300)
- Add upstream patch gl-mr470-introduce-feed-filtering.patch:
* Introduce feed filtering (https://gitlab.com/mailman/hyperkitty/-/merge_requests/470)
OBS-URL: https://build.opensuse.org/request/show/1123579
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-HyperKitty?expand=0&rev=73
---
gl-mr300-add-opengraph-metadata.patch | 302 ++++++++++++++++++++++++
gl-mr470-introduce-feed-filtering.patch | 51 ++++
python-HyperKitty.changes | 26 ++
python-HyperKitty.spec | 21 +-
4 files changed, 394 insertions(+), 6 deletions(-)
create mode 100644 gl-mr300-add-opengraph-metadata.patch
create mode 100644 gl-mr470-introduce-feed-filtering.patch
diff --git a/gl-mr300-add-opengraph-metadata.patch b/gl-mr300-add-opengraph-metadata.patch
new file mode 100644
index 0000000..661fcec
--- /dev/null
+++ b/gl-mr300-add-opengraph-metadata.patch
@@ -0,0 +1,302 @@
+# Rewritten from upstream .patch to avoid fuzzing
+Index: HyperKitty-1.3.8/hyperkitty/templates/hyperkitty/base.html
+===================================================================
+--- HyperKitty-1.3.8.orig/hyperkitty/templates/hyperkitty/base.html
++++ HyperKitty-1.3.8/hyperkitty/templates/hyperkitty/base.html
+@@ -24,6 +24,11 @@
+ {% block additional_stylesheets %} {% endblock %}
+ {% block head_feed %}{% endblock %}
+ {% include 'hyperkitty/headers.html' %}
++
++ {% block additional_og %}{% endblock %}
++
++
++
+
+
+
+Index: HyperKitty-1.3.8/hyperkitty/templates/hyperkitty/errors/notimplemented.html
+===================================================================
+--- HyperKitty-1.3.8.orig/hyperkitty/templates/hyperkitty/errors/notimplemented.html
++++ HyperKitty-1.3.8/hyperkitty/templates/hyperkitty/errors/notimplemented.html
+@@ -7,6 +7,11 @@
+ {% trans "Not implemented yet" %} - {{ block.super }}
+ {% endblock %}
+
++{% block additional_og %}
++
++
++{% endblock %}
++
+ {% block content %}
+
+