[arch-commits] Commit in mailman-web/trunk (4 files)

David Runge dvzrv at gemini.archlinux.org
Fri Aug 12 19:45:09 UTC 2022


    Date: Friday, August 12, 2022 @ 19:45:09
  Author: dvzrv
Revision: 1265774

upgpkg: mailman-web 0.0.5-4: Rebuild to use newer version of upstreamed patch for django>=4 support.

Use an up-to-date version of the upstreamed django>=4 support patch.
Rebase patch for file-hierarchy compliance against django patch.
Add mailman-web-qcluster.service (equivalent to hyperkitty-qcluster.service).

Added:
  mailman-web/trunk/mailman-web-qcluster.service
Modified:
  mailman-web/trunk/PKGBUILD
  mailman-web/trunk/mailman-web-0.0.5-django4.patch
  mailman-web/trunk/mailman-web-0.0.5-fhs.patch

---------------------------------+
 PKGBUILD                        |   20 -
 mailman-web-0.0.5-django4.patch |  478 ++++++--------------------------------
 mailman-web-0.0.5-fhs.patch     |   34 +-
 mailman-web-qcluster.service    |   38 +++
 4 files changed, 153 insertions(+), 417 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-08-12 19:45:09 UTC (rev 1265773)
+++ PKGBUILD	2022-08-12 19:45:09 UTC (rev 1265774)
@@ -2,7 +2,7 @@
 
 pkgname=mailman-web
 pkgver=0.0.5
-pkgrel=3
+pkgrel=4
 pkgdesc="The web interface for Mailman 3"
 arch=(any)
 url="https://gitlab.com/mailman/mailman-web"
@@ -20,6 +20,7 @@
 options=()
 source=(
   https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz
+  $pkgname-qcluster.service
   settings.py
   $pkgname.sysusers
   $pkgname.tmpfiles
@@ -28,19 +29,21 @@
   $pkgname-0.0.5-fhs.patch
 )
 sha512sums=('3a46372cbe332754e2fef4088651d6ab5c95ad90f0faaca091cd89eb69d73c8fb222861fafd8312d10b244c76a86c2e4018301fc5c18d15570c3e88c1015e9af'
+            '5440c170f50cbc4c95e0cf4c9d2c8a03759e0d13c2f9c604a6eaedfde9abcc4ae6cc9845d53d58cd4ee06373bab166f3115a59ebac3b77fe1d33ab7054c7c5d7'
             'cf255da4028a36a21473166a44c4a104b58ed824b81a08548bd89a861f9684bf89d166c4827b8dd5d9e516a9b0a30bbf26733f9a7e3f0d85f1c5c29f3929a3db'
             '4044b2500dc63ec1cea829d0189428de590755006c38d6f82e5a51af8935409a1ea5a5fb1f676d2331ceb59383cf79730837427eff32ad82f900068684aa3b45'
             '07aa2af5f72dccdfe32f3f220d798e5e6d57ed6875566e33ad610a05a063861a84aa6bb6d4c9a172711862855e7eae68a19fd6dcd098893f4a365579bd29cf57'
             '744a0f0af9c5683b50bf43816262917edeb47e954aba1ac7c9d831eddf3c5e63e307811e35161ac3a717b08f7d9c3dface0a2703a7c2a0f6d3a9882ce445109f'
-            '9aad3dda749c1dcc4513b992f1f44cc58059edd718cbd36c3682a456982b2845ee47e0889a985aba85509596f7f5531f196fd9260d1a9f19d956486c88756939'
-            '8b02038009344aeec1ec7cfb0ce5012cd7d8594bb7b80a3564fd421549e3c8ce03a8259ddf2a92c0ac9c1e44214421c8537cdaf5fd41c056f663246f66304a34')
+            'df591eb1deada23166131eb06d8dfaccfbbccf8c61d3befebedd56c6de45f02e0311d6c2d87632cffe2ba335883473de642300af192a5dc4983b6fa6c7381759'
+            '29e43714e32844175a1faab3299d6750909fc6a0a1aa1ae6893aa8ee7ad25241d00268902e963961f1024444384f500297adb360d6914abfa3d27d3eba6e6a0b')
 b2sums=('dcc5fbae4ab17b107e59f02eb83e1f1bb1662f63fb1c6c4731b6a8dec0a2eeeac1986f99022fe7e2049aebbcd8bcb682bf4454fc4691a590f31a4ed4d744f73b'
+        '48d65925bbbe4f17c1d4a656eb533621904fbffee06ff0ce09fbc9ad69cd947269998f31a9a172645d9389d98caf8395e4a3d9fbaafeedbf52b774725d446e29'
         '40c2583cf72597fbcdfeecabb8aa10cb2fe1e5f9b60669bdc933e4884899325f70ba4ab9f27dc702aacf26f0b0de400b26245c7770a9b3e8cc0b0641478028d6'
         'c57e70b949947ce3d30053886620221346d87416034cd004dcd91107e55a0123fb37a6c68796168ddabaab467b0f77dd8292e650df05e2e1eed0ec4d63becc2b'
         '80ca9c95c9bb3ce42bd4e3efbea59bc6cbbdabd35c504ee5c7414b8c657d863119921577fb618e0709631d05704d24698a2575f12aed81cf1cf16cd8ce116ed9'
         '7f39c6752f54048e1268c94010fa2fbdc6cc7db0c931c616469068ba835330b9cb8ec183978f2047fd8e0aff88b25de7437cbb112dbdad25f795e25f2419f809'
-        '05987e4a4379334117335bc7127425042589b11a6ab533d40279ecae1ad4ef612a36ae77b4fad916ef073ebc988f25796ef4282186a4748e3d260b75739592a3'
-        'e1633d246068ba56734b2cd6be29c8f151e32fabf356daddb5b1283ce237b44507d8eb29541df6a8cc657eff302d45e00b096a408dc35fb477c950ddac34e56a')
+        '71a20511842ed441269d214a58d0bd56b6d6f1c6a830463c45235e729bf8f88e22b0265be28d156509a2eeef3629db6559e69c3570cb489d87b92075f7e0edcb'
+        '31f793ec8c25248ae2631bf5cf27164e950b95caf73842b07514f22dce386fe9fda35af5f6f6aa00487d194502caa3009502db8bc37d7ed458db63edcb088d82')
 
 prepare() {
   # add patch for django >= 4.0: https://gitlab.com/mailman/mailman-web/-/merge_requests/23
@@ -66,16 +69,13 @@
   install -vDm 640 mailman_web/urls.py "$pkgdir/etc/webapps/$pkgname/urls.py"
   ln -sfv /etc/webapps/$pkgname/urls.py "$pkgdir$site_packages/${pkgname/-/_}/urls.py"
 
-  # state dirs
   install -vdm 750 "$pkgdir/var/lib/$pkgname/data/"
   install -vdm 755 "$pkgdir/var/lib/$pkgname/static/"
-  # log dir
   install -vdm 750 "$pkgdir/var/log/$pkgname/"
-  # uwsgi
+
   install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini"
-  # tmpfiles.d
+  install -vDm 644 ../$pkgname-qcluster.service -t "$pkgdir/usr/lib/systemd/system/"
   install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
-  # sysusers.d
   install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
   install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
 }

Modified: mailman-web-0.0.5-django4.patch
===================================================================
--- mailman-web-0.0.5-django4.patch	2022-08-12 19:45:09 UTC (rev 1265773)
+++ mailman-web-0.0.5-django4.patch	2022-08-12 19:45:09 UTC (rev 1265774)
@@ -1,9 +1,9 @@
 diff -ruN a/.flake8 b/.flake8
 --- a/.flake8	1970-01-01 01:00:00.000000000 +0100
-+++ b/.flake8	2022-05-03 12:46:44.247572069 +0200
++++ b/.flake8	2022-08-12 19:43:01.553759779 +0200
 @@ -0,0 +1,14 @@
 +[flake8]
-+max-line-length = 120
++max-line-length = 79
 +output-file = flake8.txt
 +max-complexity = 10
 +exclude =
@@ -18,7 +18,7 @@
 +    doc
 diff -ruN a/.gitignore b/.gitignore
 --- a/.gitignore	2019-03-25 02:16:20.000000000 +0100
-+++ b/.gitignore	2022-05-03 12:46:44.247572069 +0200
++++ b/.gitignore	2022-08-12 19:43:01.560426406 +0200
 @@ -1,4 +1,5 @@
  *.eggs/
 +*.egg-info/
@@ -27,7 +27,7 @@
  /mailman-web.toml
 diff -ruN a/.gitlab-ci.yml b/.gitlab-ci.yml
 --- a/.gitlab-ci.yml	2019-03-25 02:16:20.000000000 +0100
-+++ b/.gitlab-ci.yml	2022-05-03 12:46:44.247572069 +0200
++++ b/.gitlab-ci.yml	2022-08-12 19:43:01.560426406 +0200
 @@ -1,6 +1,11 @@
 +---
 +
@@ -42,7 +42,16 @@
 +    - tox -e lint
 diff -ruN a/docs/conf.py b/docs/conf.py
 --- a/docs/conf.py	2021-01-20 01:10:36.000000000 +0100
-+++ b/docs/conf.py	2022-05-03 12:46:44.250905415 +0200
++++ b/docs/conf.py	2022-08-12 19:43:01.560426406 +0200
+@@ -65,7 +65,7 @@
+ #
+ # This is also used if you do content translation via gettext catalogs.
+ # Usually you set "language" from the command line for these cases.
+-language = None
++language = 'en'
+ 
+ # List of patterns, relative to source directory, that match files and
+ # directories to ignore when looking for source files.
 @@ -194,6 +194,7 @@
  
  add_module_names = False
@@ -60,7 +69,7 @@
      app.connect('autodoc-process-docstring', process_docstring)
 diff -ruN a/docs/settings.py b/docs/settings.py
 --- a/docs/settings.py	2021-01-20 01:10:36.000000000 +0100
-+++ b/docs/settings.py	2022-05-03 12:46:44.250905415 +0200
++++ b/docs/settings.py	2022-08-12 19:43:01.560426406 +0200
 @@ -1,8 +1,8 @@
  # Mailman Web configuration file.
  # /etc/mailman3/settings.py
@@ -86,14 +95,14 @@
  
  # Make sure that this directory is created or Django will fail on start.
 -LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log'
-+LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log'  # noqa: F405
++LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log'  # noqa: F405,E501
  
  #: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
  ALLOWED_HOSTS = [
 diff -ruN a/mailman_web/manage.py b/mailman_web/manage.py
 --- a/mailman_web/manage.py	2021-02-03 06:09:38.000000000 +0100
-+++ b/mailman_web/manage.py	2022-05-03 12:46:44.250905415 +0200
-@@ -3,6 +3,7 @@
++++ b/mailman_web/manage.py	2022-08-12 19:43:01.560426406 +0200
+@@ -3,12 +3,16 @@
  import sys
  from pathlib import Path
  
@@ -101,8 +110,18 @@
  def setup():
      """Setup environment for Mailman web."""
      if os.getenv('DJANGO_SETTINGS_MODULE') is not None:
-@@ -22,6 +23,7 @@
+         return
  
+-    MAILMAN_WEB_CONFIG = os.getenv('MAILMAN_WEB_CONFIG', '/etc/mailman3/settings.py')
++    MAILMAN_WEB_CONFIG = os.getenv(
++        'MAILMAN_WEB_CONFIG',
++        '/etc/mailman3/settings.py',
++    )
+ 
+     if not os.path.exists(MAILMAN_WEB_CONFIG):
+         print('Mailman web configuration file at {} does not exist'.format(
+@@ -22,6 +26,7 @@
+ 
      os.environ['DJANGO_SETTINGS_MODULE'] = config_path.stem
  
 +
@@ -111,15 +130,36 @@
  
 diff -ruN a/mailman_web/settings/base.py b/mailman_web/settings/base.py
 --- a/mailman_web/settings/base.py	2021-01-22 22:32:26.000000000 +0100
-+++ b/mailman_web/settings/base.py	2022-05-03 12:46:44.254238763 +0200
++++ b/mailman_web/settings/base.py	2022-08-12 19:43:01.560426406 +0200
 @@ -1,5 +1,6 @@
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  import os
-+from django.contrib.messages import constants as messages  # flake8: noqa
++from django.contrib.messages import constants as messages
  from pathlib import Path
  
  #: The base directory for logs and database.
-@@ -226,8 +227,6 @@
+@@ -130,8 +131,9 @@
+ #:     'OPTIONS': {'charset': 'utf8mb4'}  # Enable utf8 4-byte encodings.
+ #:
+ #: Check out
+-#: `Django documentation <https://docs.djangoproject.com/en/3.0/ref/settings/#databases>`_
+-#: for more details.
++#: `Django documentation
++#: <https://docs.djangoproject.com/en/3.0/ref/settings/#databases>`_ for
++#: more details.
+ DATABASES = {
+     'default': {
+         'ENGINE': 'django.db.backends.sqlite3',
+@@ -146,7 +148,7 @@
+ AUTH_PASSWORD_VALIDATORS = [
+     {
+         'NAME':
+-        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
++        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',  # noqa: E501
+     },
+     {
+         'NAME':
+@@ -226,8 +228,6 @@
  #: https://docs.djangoproject.com/en/dev/topics/email/#email-backends
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  
@@ -128,7 +168,7 @@
  MESSAGE_TAGS = {
      messages.ERROR: 'danger'
  }
-@@ -248,9 +247,8 @@
+@@ -248,9 +248,8 @@
              'filters': ['require_debug_false'],
              'class': 'django.utils.log.AdminEmailHandler'
          },
@@ -139,7 +179,14 @@
              'class': 'logging.handlers.WatchedFileHandler',
              'filename': os.path.join(BASE_DIR, 'logs', 'mailmanweb.log'),
              'formatter': 'verbose',
-@@ -289,10 +287,6 @@
+@@ -283,16 +282,12 @@
+     },
+     'formatters': {
+         'verbose': {
+-            'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'
++            'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'  # noqa: E501
+         },
+         'simple': {
              'format': '%(levelname)s %(message)s'
          },
      },
@@ -150,314 +197,9 @@
  }
  
  #: Current Django Site being served. This is used to customize the web host
-diff -ruN a/mailman_web/settings/base.py.orig b/mailman_web/settings/base.py.orig
---- a/mailman_web/settings/base.py.orig	1970-01-01 01:00:00.000000000 +0100
-+++ b/mailman_web/settings/base.py.orig	2021-01-22 22:32:26.000000000 +0100
-@@ -0,0 +1,301 @@
-+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
-+import os
-+from pathlib import Path
-+
-+#: The base directory for logs and database.
-+BASE_DIR = Path('/opt/mailman/web')
-+
-+#: Default list of admins who receive the emails from error logging.
-+ADMINS = (
-+    ('Mailman Suite Admin', 'root at localhost'),
-+)
-+
-+#: Hosts/domain names that are valid for this site; required if DEBUG is False.
-+#: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
-+ALLOWED_HOSTS = [
-+    "localhost",  # Archiving API from Mailman, keep it.
-+    # "lists.your-domain.org",
-+    # Add here all production URLs you may have.
-+]
-+
-+#: Enable Development Mode.
-+DEBUG = False
-+
-+
-+#: URL Configuration for Django
-+ROOT_URLCONF = 'mailman_web.urls'
-+
-+
-+#: Default list of django applications.
-+#: Each social account provider is an application and by default no social auth
-+#: providers are enabled. To enable a social auth provider, you can add them
-+#: to list of INSTALLED_APPS. For example::
-+#:
-+#:     DJANGO_SOCIAL_AUTH_PROVIDERS = [
-+#:         'allauth.socialaccount.providers.openid',
-+#:         'django_mailman3.lib.auth.fedora',
-+#:         'allauth.socialaccount.providers.github',
-+#:         'allauth.socialaccount.providers.gitlab',
-+#:         'allauth.socialaccount.providers.google',
-+#:         'allauth.socialaccount.providers.facebook',
-+#:         'allauth.socialaccount.providers.twitter',
-+#:         'allauth.socialaccount.providers.stackexchange',
-+#:     ]
-+#:     INSTALLED_APPS += DJANGO_SOCIAL_AUTH_PROVIDERS
-+#:
-+#: A full list of providers can be found at
-+#: https://django-allauth.readthedocs.io/en/latest/providers.html
-+#: Please also note that extra configuration is required after
-+#: a provider is enabled. Django-allauth's documentation mentioned
-+#: above provides more details about how to configure one.
-+INSTALLED_APPS = [
-+    'hyperkitty',
-+    'postorius',
-+    'django_mailman3',
-+    'django.contrib.admin',
-+    'django.contrib.auth',
-+    'django.contrib.contenttypes',
-+    'django.contrib.sessions',
-+    'django.contrib.sites',
-+    'django.contrib.messages',
-+    'django.contrib.staticfiles',
-+    'rest_framework',
-+    'django_gravatar',
-+    'compressor',
-+    'haystack',
-+    'django_extensions',
-+    'django_q',
-+    'allauth',
-+    'allauth.account',
-+    'allauth.socialaccount',
-+]
-+
-+
-+#: Default Django Middlewares.
-+MIDDLEWARE = (
-+    'django.contrib.sessions.middleware.SessionMiddleware',
-+    'django.middleware.common.CommonMiddleware',
-+    'django.middleware.csrf.CsrfViewMiddleware',
-+    'django.middleware.locale.LocaleMiddleware',
-+    'django.contrib.auth.middleware.AuthenticationMiddleware',
-+    'django.contrib.messages.middleware.MessageMiddleware',
-+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
-+    'django.middleware.security.SecurityMiddleware',
-+    'django_mailman3.middleware.TimezoneMiddleware',
-+    'postorius.middleware.PostoriusMiddleware',
-+)
-+
-+#: Default Template finders.
-+TEMPLATES = [
-+    {
-+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
-+        'DIRS': [],
-+        'APP_DIRS': True,
-+        'OPTIONS': {
-+            'context_processors': [
-+                'django.template.context_processors.debug',
-+                'django.template.context_processors.i18n',
-+                'django.template.context_processors.media',
-+                'django.template.context_processors.static',
-+                'django.template.context_processors.tz',
-+                'django.template.context_processors.csrf',
-+                'django.template.context_processors.request',
-+                'django.contrib.auth.context_processors.auth',
-+                'django.contrib.messages.context_processors.messages',
-+                'django_mailman3.context_processors.common',
-+                'hyperkitty.context_processors.common',
-+                'postorius.context_processors.postorius',
-+            ],
-+        },
-+    },
-+]
-+
-+#: Wsgi application import path. This will be used by the WSGI server which
-+#: will be used to deploy this application.
-+WSGI_APPLICATION = 'mailman_web.wsgi.application'
-+
-+#: Default Database to be used.
-+#: Example for PostgreSQL (**recommanded for production**)::
-+#:
-+#:    'default': {
-+#:        'ENGINE': 'django.db.backends.postgresql_psycopg2',
-+#:        'NAME': 'database_name',
-+#:        'USER': 'database_user',
-+#:        'PASSWORD': 'database_password',
-+#:        'HOST': 'localhost',
-+#:    }
-+#:
-+#: For MySQL/MariaDB also add the following to the the configuration::
-+#:
-+#:     'OPTIONS': {'charset': 'utf8mb4'}  # Enable utf8 4-byte encodings.
-+#:
-+#: Check out
-+#: `Django documentation <https://docs.djangoproject.com/en/3.0/ref/settings/#databases>`_
-+#: for more details.
-+DATABASES = {
-+    'default': {
-+        'ENGINE': 'django.db.backends.sqlite3',
-+        'NAME': os.path.join(BASE_DIR, 'mailman-web.db'),
-+        'HOST': '',
-+        'PORT': '',
-+    }
-+}
-+
-+
-+#: Default password validators.
-+AUTH_PASSWORD_VALIDATORS = [
-+    {
-+        'NAME':
-+        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
-+    },
-+    {
-+        'NAME':
-+        'django.contrib.auth.password_validation.MinimumLengthValidator',
-+    },
-+    {
-+        'NAME':
-+        'django.contrib.auth.password_validation.CommonPasswordValidator',
-+    },
-+    {
-+        'NAME':
-+        'django.contrib.auth.password_validation.NumericPasswordValidator',
-+    },
-+]
-+
-+#: Default Language code.
-+LANGUAGE_CODE = 'en-us'
-+
-+#: Default timezone.
-+TIME_ZONE = 'UTC'
-+
-+#: Enable internationalization.
-+USE_I18N = True
-+
-+#: Enable localization.
-+USE_L10N = True
-+
-+#: Use the timezone information.
-+USE_TZ = True
-+
-+
-+#: Default path where static files will be placed.
-+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
-+
-+#: URL prefix for static files.
-+#: Example: "http://example.com/static/", "http://static.example.com/"
-+STATIC_URL = '/static/'
-+
-+#: Additional locations of static files
-+STATICFILES_DIRS = (
-+    # Put strings here, like "/home/html/static" or "C:/www/django/static".
-+    # Always use forward slashes, even on Windows.
-+    # Don't forget to use absolute paths, not relative paths.
-+    # BASE_DIR + '/static/',
-+)
-+
-+#: List of finder classes that know how to find static files in
-+#: various locations.
-+STATICFILES_FINDERS = (
-+    'django.contrib.staticfiles.finders.FileSystemFinder',
-+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-+    # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
-+    'compressor.finders.CompressorFinder',
-+)
-+
-+#: Django 1.6+ defaults to a JSON serializer, but it won't work with
-+#: django-openid, see
-+#: https://bugs.launchpad.net/django-openid-auth/+bug/1252826
-+SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
-+
-+
-+#: Default Django URL to redirect to for Login.
-+LOGIN_URL = 'account_login'
-+#: Default Django URL to redirect to after a successful login.
-+LOGIN_REDIRECT_URL = 'list_index'
-+#: Default Django URL to Logout the user.
-+LOGOUT_URL = 'account_logout'
-+
-+#: If you enable email reporting for error messages, this is where those emails
-+#: will appear to be coming from. Make sure you set a valid domain name,
-+#: otherwise the emails may get rejected.
-+#: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SERVER_EMAIL
-+SERVER_EMAIL = 'root at localhost.local'
-+
-+#: The default implementation to send out emails. This can be customized to
-+#: something else for testing purposes.
-+#: https://docs.djangoproject.com/en/dev/topics/email/#email-backends
-+EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
-+
-+# Compatibility with Bootstrap 3
-+from django.contrib.messages import constants as messages  # flake8: noqa
-+MESSAGE_TAGS = {
-+    messages.ERROR: 'danger'
-+}
-+
-+
-+#: Default Logging configuration.
-+LOGGING = {
-+    'version': 1,
-+    'disable_existing_loggers': False,
-+    'filters': {
-+        'require_debug_false': {
-+            '()': 'django.utils.log.RequireDebugFalse'
-+        }
-+    },
-+    'handlers': {
-+        'mail_admins': {
-+            'level': 'ERROR',
-+            'filters': ['require_debug_false'],
-+            'class': 'django.utils.log.AdminEmailHandler'
-+        },
-+        'file':{
-+            'level': 'INFO',
-+            #'class': 'logging.handlers.RotatingFileHandler',
-+            'class': 'logging.handlers.WatchedFileHandler',
-+            'filename': os.path.join(BASE_DIR, 'logs', 'mailmanweb.log'),
-+            'formatter': 'verbose',
-+        },
-+        'console': {
-+            'class': 'logging.StreamHandler',
-+            'formatter': 'simple',
-+        },
-+    },
-+    'loggers': {
-+        'django.request': {
-+            'handlers': ['mail_admins', 'file'],
-+            'level': 'ERROR',
-+            'propagate': True,
-+        },
-+        'django': {
-+            'handlers': ['file'],
-+            'level': 'ERROR',
-+            'propagate': True,
-+        },
-+        'hyperkitty': {
-+            'handlers': ['file'],
-+            'level': 'DEBUG',
-+            'propagate': True,
-+        },
-+        'postorius': {
-+            'handlers': ['console', 'file'],
-+            'level': 'INFO',
-+        },
-+    },
-+    'formatters': {
-+        'verbose': {
-+            'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'
-+        },
-+        'simple': {
-+            'format': '%(levelname)s %(message)s'
-+        },
-+    },
-+    #'root': {
-+    #    'handlers': ['file'],
-+    #    'level': 'INFO',
-+    #},
-+}
-+
-+#: Current Django Site being served. This is used to customize the web host
-+#: being used to serve the current website. For more details about Django
-+#: site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/
-+SITE_ID = 1
 diff -ruN a/mailman_web/settings/mailman.py b/mailman_web/settings/mailman.py
 --- a/mailman_web/settings/mailman.py	2021-04-11 07:33:12.000000000 +0200
-+++ b/mailman_web/settings/mailman.py	2022-05-03 12:46:44.254238763 +0200
++++ b/mailman_web/settings/mailman.py	2022-08-12 19:43:01.560426406 +0200
 @@ -1,5 +1,3 @@
 -import os
 -
@@ -473,10 +215,20 @@
  
  #: Protocol for URLs generated for authentication, like email
  #: confirmation.
+@@ -42,7 +40,8 @@
+ 
+ #: Extra configuration for Social auth. For these configuration to be used.
+ #: each of the social account providers must be first added in INSTALLED_APPS.
+-#: See :py:data:`mailman_web.settings.base.INSTALLED_APPS` for more configuration.
++#: See :py:data:`mailman_web.settings.base.INSTALLED_APPS` for more
++#: configuration.
+ SOCIALACCOUNT_PROVIDERS = {
+     'openid': {
+         'SERVERS': [
 diff -ruN a/mailman_web/urls.py b/mailman_web/urls.py
 --- a/mailman_web/urls.py	2020-05-26 03:34:31.000000000 +0200
-+++ b/mailman_web/urls.py	2022-05-03 12:46:44.254238763 +0200
-@@ -17,19 +17,16 @@
++++ b/mailman_web/urls.py	2022-08-12 19:43:01.560426406 +0200
+@@ -17,19 +17,19 @@
  # Postorius.  If not, see <http://www.gnu.org/licenses/>.
  
  
@@ -497,16 +249,19 @@
 -    url(r'^accounts/', include('allauth.urls')),
 -    # Django admin
 -    url(r'^admin/', admin.site.urls),
-+    path(r'^$', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True)),
-+    path(r'^mailman3/', include('postorius.urls')),
-+    path(r'^archives/', include('hyperkitty.urls')),
-+    path(r'', include('django_mailman3.urls')),
-+    path(r'^accounts/', include('allauth.urls')),
-+    path(r'^admin/', admin.site.urls),
++    path(
++        '',
++        RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True),
++    ),
++    path('mailman3/', include('postorius.urls')),
++    path('archives/', include('hyperkitty.urls')),
++    path('', include('django_mailman3.urls')),
++    path('accounts/', include('allauth.urls')),
++    path('admin/', admin.site.urls),
  ]
 diff -ruN a/mailman_web/wsgi.py b/mailman_web/wsgi.py
 --- a/mailman_web/wsgi.py	2019-10-01 03:56:13.000000000 +0200
-+++ b/mailman_web/wsgi.py	2022-05-03 12:46:44.254238763 +0200
++++ b/mailman_web/wsgi.py	2022-08-12 19:43:01.560426406 +0200
 @@ -7,8 +7,6 @@
  https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
  """
@@ -518,76 +273,19 @@
  
 diff -ruN a/setup.cfg b/setup.cfg
 --- a/setup.cfg	2021-09-17 17:03:22.707365000 +0200
-+++ b/setup.cfg	2022-05-03 12:47:14.267698527 +0200
++++ b/setup.cfg	2022-08-12 19:43:40.623515642 +0200
 @@ -22,7 +22,7 @@
  	setuptools
  	setuptools-scm
  install_requires = 
 -	Django<3.1
-+	django >= 3.2, <4.1
++	django >=3.2, <4.1
  	postorius
  	hyperkitty
  	whoosh
-diff -ruN a/setup.cfg.orig b/setup.cfg.orig
---- a/setup.cfg.orig	1970-01-01 01:00:00.000000000 +0100
-+++ b/setup.cfg.orig	2022-05-03 12:46:44.254238763 +0200
-@@ -0,0 +1,38 @@
-+[metadata]
-+name = mailman-web
-+author = Mailman Developers
-+author_email = mailman-developers at python.org
-+description = Mailman 3 Web interface.
-+long_description = file: README.rst
-+long_description_content_type = text/x-rst
-+license = GPLv3
-+url = https://gitlab.com/mailman/mailman-web
-+classifiers = 
-+	Intended Audience :: System Administrators
-+	Operating System :: POSIX
-+	Programming Language :: Python :: 3
-+	License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
-+	Topic :: Internet :: WWW/HTTP :: WSGI :: Application
-+	Development Status :: 4 - Beta
-+	Framework :: Django
-+
-+[options]
-+python_requires = >=3.6
-+setup_requires = 
-+	setuptools
-+	setuptools-scm
-+install_requires = 
-+	django >= 2.2, !=3.0, <4.0
-+	postorius
-+	hyperkitty
-+	whoosh
-+packages = find:
-+
-+[options.entry_points]
-+console_scripts = 
-+	mailman-web = mailman_web.manage:main
-+
-+[egg_info]
-+tag_build = 
-+tag_date = 0
-+
-diff -ruN a/setup.cfg.rej b/setup.cfg.rej
---- a/setup.cfg.rej	1970-01-01 01:00:00.000000000 +0100
-+++ b/setup.cfg.rej	2022-05-03 12:46:44.254238763 +0200
-@@ -0,0 +1,11 @@
-+--- setup.cfg
-++++ setup.cfg
-+@@ -22,7 +22,7 @@ setup_requires =
-+   setuptools
-+   setuptools-scm
-+ install_requires =
-+-  django >=2.2, !=3.0, <4
-++  django >=3.2, <4.1
-+   postorius
-+   hyperkitty
-+   whoosh
 diff -ruN a/tox.ini b/tox.ini
 --- a/tox.ini	2021-01-20 01:10:36.000000000 +0100
-+++ b/tox.ini	2022-05-03 12:46:44.254238763 +0200
++++ b/tox.ini	2022-08-12 19:43:01.560426406 +0200
 @@ -1,5 +1,10 @@
  [tox]
 -envlist = docs

Modified: mailman-web-0.0.5-fhs.patch
===================================================================
--- mailman-web-0.0.5-fhs.patch	2022-08-12 19:45:09 UTC (rev 1265773)
+++ mailman-web-0.0.5-fhs.patch	2022-08-12 19:45:09 UTC (rev 1265774)
@@ -1,19 +1,19 @@
 diff -ruN a/mailman_web/manage.py b/mailman_web/manage.py
---- a/mailman_web/manage.py	2021-02-03 06:09:38.000000000 +0100
-+++ b/mailman_web/manage.py	2021-12-01 21:54:42.397593088 +0100
-@@ -8,7 +8,7 @@
-     if os.getenv('DJANGO_SETTINGS_MODULE') is not None:
-         return
+--- a/mailman_web/manage.py	2022-08-12 19:43:01.560426406 +0200
++++ b/mailman_web/manage.py	2022-08-12 21:28:03.814671667 +0200
+@@ -11,7 +11,7 @@
  
--    MAILMAN_WEB_CONFIG = os.getenv('MAILMAN_WEB_CONFIG', '/etc/mailman3/settings.py')
-+    MAILMAN_WEB_CONFIG = os.getenv('MAILMAN_WEB_CONFIG', '/etc/webapps/mailman-web/settings.py')
+     MAILMAN_WEB_CONFIG = os.getenv(
+         'MAILMAN_WEB_CONFIG',
+-        '/etc/mailman3/settings.py',
++        '/etc/webapps/mailman_web/settings.py',
+     )
  
      if not os.path.exists(MAILMAN_WEB_CONFIG):
-         print('Mailman web configuration file at {} does not exist'.format(
 diff -ruN a/mailman_web/settings/base.py b/mailman_web/settings/base.py
---- a/mailman_web/settings/base.py	2021-01-22 22:32:26.000000000 +0100
-+++ b/mailman_web/settings/base.py	2021-12-01 22:14:56.713467440 +0100
-@@ -3,7 +3,7 @@
+--- a/mailman_web/settings/base.py	2022-08-12 19:43:01.560426406 +0200
++++ b/mailman_web/settings/base.py	2022-08-12 21:30:25.527237264 +0200
+@@ -4,7 +4,7 @@
  from pathlib import Path
  
  #: The base directory for logs and database.
@@ -22,16 +22,16 @@
  
  #: Default list of admins who receive the emails from error logging.
  ADMINS = (
-@@ -135,7 +135,7 @@
+@@ -137,7 +137,7 @@
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
 -        'NAME': os.path.join(BASE_DIR, 'mailman-web.db'),
-+        'NAME': BASE_DIR / 'data' / 'mailman-web.db',
++        'NAME': BASE_DIR / 'data' / 'mailman-web.de',
          'HOST': '',
          'PORT': '',
      }
-@@ -179,7 +179,7 @@
+@@ -181,7 +181,7 @@
  
  
  #: Default path where static files will be placed.
@@ -40,12 +40,12 @@
  
  #: URL prefix for static files.
  #: Example: "http://example.com/static/", "http://static.example.com/"
-@@ -252,7 +252,7 @@
+@@ -251,7 +251,7 @@
+         'file': {
              'level': 'INFO',
-             #'class': 'logging.handlers.RotatingFileHandler',
              'class': 'logging.handlers.WatchedFileHandler',
 -            'filename': os.path.join(BASE_DIR, 'logs', 'mailmanweb.log'),
-+            'filename': Path("/var/log/mailman-web/mailman-web.log"),
++            'filename': Path('/var/log/mailman-web/mailmanweb.log'),
              'formatter': 'verbose',
          },
          'console': {

Added: mailman-web-qcluster.service
===================================================================
--- mailman-web-qcluster.service	                        (rev 0)
+++ mailman-web-qcluster.service	2022-08-12 19:45:09 UTC (rev 1265774)
@@ -0,0 +1,38 @@
+[Unit]
+Description=Mailman-web async tasks runner
+Documentation=https://hyperkitty.readthedocs.io/en/latest/install.html#asynchronous-tasks
+After=network.target remote-fs.target
+
+[Service]
+User=mailman-web
+ExecStart=/usr/bin/django-admin qcluster --pythonpath /usr/share/webapps/mailman-web --settings settings
+Restart=always
+StandardError=syslog
+PrivateTmp=true
+ProtectSystem=strict
+ProtectHome=true
+PrivateDevices=true
+ProtectKernelTunables=true
+ProtectControlGroups=true
+NoNewPrivileges=true
+MemoryDenyWriteExecute=true
+LockPersonality=true
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+ProtectHostname=true
+ProtectKernelLogs=true
+ProtectKernelModules=true
+RemoveIPC=true
+RestrictAddressFamilies=~AF_PACKET
+RestrictNamespaces=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+SystemCallFilter=~@privileged @resources
+ReadOnlyPaths=/etc/webapps/mailman-web
+LogsDirectory=mailman-web
+RuntimeDirectory=mailman-web
+StateDirectory=mailman-web
+
+[Install]
+WantedBy=multi-user.target



More information about the arch-commits mailing list