Date: Tuesday, May 3, 2022 @ 10:50:32 Author: dvzrv Revision: 1192391
upgpkg: mailman-web 0.0.5-3: Rebuild for python-django >= 4.0 support. Add upstreamed patch for django >= 4.0 support (consolidating with previous django patch). Remove unneeded quotes and curly braces. Switch to PEP517. Added: mailman-web/trunk/mailman-web-0.0.5-django4.patch Modified: mailman-web/trunk/PKGBUILD Deleted: mailman-web/trunk/mailman-web-0.0.5-django.patch ---------------------------------+ PKGBUILD | 62 +-- mailman-web-0.0.5-django.patch | 12 mailman-web-0.0.5-django4.patch | 602 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 633 insertions(+), 43 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-05-03 09:45:50 UTC (rev 1192390) +++ PKGBUILD 2022-05-03 10:50:32 UTC (rev 1192391) @@ -2,30 +2,30 @@ pkgname=mailman-web pkgver=0.0.5 -pkgrel=2 +pkgrel=3 pkgdesc="The web interface for Mailman 3" arch=(any) url="https://gitlab.com/mailman/mailman-web" license=(GPL3) depends=(hyperkitty postorius python-django python-whoosh) -makedepends=(python-setuptools-scm) +makedepends=(python-build python-installer python-setuptools-scm python-wheel) optdepends=( 'mailman3: for interacting with a local mailman instance' 'uwsgi-plugin-python: for running inside uwsgi' ) backup=( - "etc/webapps/${pkgname}/settings.py" - "etc/webapps/${pkgname}/urls.py" + etc/webapps/$pkgname/settings.py + etc/webapps/$pkgname/urls.py ) options=() source=( - "https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz" - "settings.py" - "${pkgname}.sysusers" - "${pkgname}.tmpfiles" - "${pkgname}.uwsgi" - "${pkgname}-0.0.5-django.patch" - "${pkgname}-0.0.5-fhs.patch" + https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz + settings.py + $pkgname.sysusers + $pkgname.tmpfiles + $pkgname.uwsgi + $pkgname-0.0.5-django4.patch + $pkgname-0.0.5-fhs.patch ) sha512sums=('3a46372cbe332754e2fef4088651d6ab5c95ad90f0faaca091cd89eb69d73c8fb222861fafd8312d10b244c76a86c2e4018301fc5c18d15570c3e88c1015e9af' 'cf255da4028a36a21473166a44c4a104b58ed824b81a08548bd89a861f9684bf89d166c4827b8dd5d9e516a9b0a30bbf26733f9a7e3f0d85f1c5c29f3929a3db' @@ -32,7 +32,7 @@ '4044b2500dc63ec1cea829d0189428de590755006c38d6f82e5a51af8935409a1ea5a5fb1f676d2331ceb59383cf79730837427eff32ad82f900068684aa3b45' '07aa2af5f72dccdfe32f3f220d798e5e6d57ed6875566e33ad610a05a063861a84aa6bb6d4c9a172711862855e7eae68a19fd6dcd098893f4a365579bd29cf57' '744a0f0af9c5683b50bf43816262917edeb47e954aba1ac7c9d831eddf3c5e63e307811e35161ac3a717b08f7d9c3dface0a2703a7c2a0f6d3a9882ce445109f' - 'a6cea2e453a8f32ef7efa22c141cb68eb7b255e36f14b6beef46143fb2d993d72b45fd35f88bda2bc0f8e017c1240a97057b2b10fb1f5660889febf5ca83d4a0' + '9aad3dda749c1dcc4513b992f1f44cc58059edd718cbd36c3682a456982b2845ee47e0889a985aba85509596f7f5531f196fd9260d1a9f19d956486c88756939' '8b02038009344aeec1ec7cfb0ce5012cd7d8594bb7b80a3564fd421549e3c8ce03a8259ddf2a92c0ac9c1e44214421c8537cdaf5fd41c056f663246f66304a34') b2sums=('dcc5fbae4ab17b107e59f02eb83e1f1bb1662f63fb1c6c4731b6a8dec0a2eeeac1986f99022fe7e2049aebbcd8bcb682bf4454fc4691a590f31a4ed4d744f73b' '40c2583cf72597fbcdfeecabb8aa10cb2fe1e5f9b60669bdc933e4884899325f70ba4ab9f27dc702aacf26f0b0de400b26245c7770a9b3e8cc0b0641478028d6' @@ -39,43 +39,43 @@ 'c57e70b949947ce3d30053886620221346d87416034cd004dcd91107e55a0123fb37a6c68796168ddabaab467b0f77dd8292e650df05e2e1eed0ec4d63becc2b' '80ca9c95c9bb3ce42bd4e3efbea59bc6cbbdabd35c504ee5c7414b8c657d863119921577fb618e0709631d05704d24698a2575f12aed81cf1cf16cd8ce116ed9' '7f39c6752f54048e1268c94010fa2fbdc6cc7db0c931c616469068ba835330b9cb8ec183978f2047fd8e0aff88b25de7437cbb112dbdad25f795e25f2419f809' - '8613ccfdf8558c1e9ff51b9abaf6df3fa82f78f67e48d8b59cd718b1dbc57948c197513e8083d07f4f4974b4ff41e859b39e47f3d961b8d8e26469747516c80b' + '05987e4a4379334117335bc7127425042589b11a6ab533d40279ecae1ad4ef612a36ae77b4fad916ef073ebc988f25796ef4282186a4748e3d260b75739592a3' 'e1633d246068ba56734b2cd6be29c8f151e32fabf356daddb5b1283ce237b44507d8eb29541df6a8cc657eff302d45e00b096a408dc35fb477c950ddac34e56a') prepare() { - cd "$pkgname-$pkgver" - # set django version support: https://gitlab.com/mailman/mailman-web/-/merge_requests/17 - patch -Np1 -i ../"${pkgname}-0.0.5-django.patch" + # add patch for django >= 4.0: https://gitlab.com/mailman/mailman-web/-/merge_requests/23 + patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.0.5-django4.patch # set FHS and packaging compliant default locations - patch -Np1 -i ../"${pkgname}-0.0.5-fhs.patch" + patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.0.5-fhs.patch + } build() { - cd "$pkgname-$pkgver" - python setup.py build + cd $pkgname-$pkgver + python -m build --wheel --no-isolation } package() { local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") - cd "$pkgname-$pkgver" - python setup.py install --optimize=1 --root="${pkgdir}" + cd $pkgname-$pkgver + python -m installer --destdir="$pkgdir" dist/*.whl # config - install -vDm 640 ../settings.py "${pkgdir}/etc/webapps/${pkgname}/settings.py" - 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" + install -vDm 640 ../settings.py "$pkgdir/etc/webapps/$pkgname/settings.py" + 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" + 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}/" + install -vdm 750 "$pkgdir/var/log/$pkgname/" # uwsgi - install -vDm 644 "../${pkgname}.uwsgi" "${pkgdir}/etc/uwsgi/${pkgname}.ini" + install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini" # tmpfiles.d - install -vDm 644 "../${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" + 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}" + install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/" } Deleted: mailman-web-0.0.5-django.patch =================================================================== --- mailman-web-0.0.5-django.patch 2022-05-03 09:45:50 UTC (rev 1192390) +++ mailman-web-0.0.5-django.patch 2022-05-03 10:50:32 UTC (rev 1192391) @@ -1,12 +0,0 @@ -diff -ruN a/setup.cfg b/setup.cfg ---- a/setup.cfg 2021-09-17 17:03:22.707365000 +0200 -+++ b/setup.cfg 2021-12-01 21:26:25.150786080 +0100 -@@ -22,7 +22,7 @@ - setuptools - setuptools-scm - install_requires = -- Django<3.1 -+ django >= 2.2, !=3.0, <4.0 - postorius - hyperkitty - whoosh Added: mailman-web-0.0.5-django4.patch =================================================================== --- mailman-web-0.0.5-django4.patch (rev 0) +++ mailman-web-0.0.5-django4.patch 2022-05-03 10:50:32 UTC (rev 1192391) @@ -0,0 +1,602 @@ +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 +@@ -0,0 +1,14 @@ ++[flake8] ++max-line-length = 120 ++output-file = flake8.txt ++max-complexity = 10 ++exclude = ++ .git ++ .tox ++ .venv ++ .cache ++ .eggs ++ .pytest* ++ *.egg-info ++ examples ++ 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 +@@ -1,4 +1,5 @@ + *.eggs/ ++*.egg-info/ + *__pycache__/ + *.db + /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 +@@ -1,6 +1,11 @@ ++--- ++ + image: maxking/mailman-ci-runner + + + docs: + script: + - tox -e docs ++lint: ++ script: ++ - 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 +@@ -194,6 +194,7 @@ + + add_module_names = False + ++ + # -- Modify the docstring + def process_docstring(app, what, name, obj, options, lines): + if what not in ('module'): +@@ -205,5 +206,6 @@ + """.format(pp.pformat(obj)).splitlines()) + return + ++ + def setup(app): + 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 +@@ -1,8 +1,8 @@ + # Mailman Web configuration file. + # /etc/mailman3/settings.py + +-from mailman_web.settings.base import * +-from mailman_web.settings.mailman import * ++from mailman_web.settings.base import * # noqa: F403 ++from mailman_web.settings.mailman import * # noqa: F403 + + + #: Default list of admins who receive the emails from error logging. +@@ -14,7 +14,7 @@ + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', +- 'NAME': ‘mailmanweb’, ++ 'NAME': 'mailmanweb', + 'USER': '<db_username>', + 'PASSWORD': '<password>', + 'HOST': 'localhost', +@@ -28,7 +28,7 @@ + + + # 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 + + #: 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 @@ + import sys + from pathlib import Path + ++ + def setup(): + """Setup environment for Mailman web.""" + if os.getenv('DJANGO_SETTINGS_MODULE') is not None: +@@ -22,6 +23,7 @@ + + os.environ['DJANGO_SETTINGS_MODULE'] = config_path.stem + ++ + def main(): + setup() + +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 +@@ -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 pathlib import Path + + #: The base directory for logs and database. +@@ -226,8 +227,6 @@ + #: 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' + } +@@ -248,9 +247,8 @@ + 'filters': ['require_debug_false'], + 'class': 'django.utils.log.AdminEmailHandler' + }, +- 'file':{ ++ 'file': { + 'level': 'INFO', +- #'class': 'logging.handlers.RotatingFileHandler', + 'class': 'logging.handlers.WatchedFileHandler', + 'filename': os.path.join(BASE_DIR, 'logs', 'mailmanweb.log'), + 'formatter': 'verbose', +@@ -289,10 +287,6 @@ + 'format': '%(levelname)s %(message)s' + }, + }, +- #'root': { +- # 'handlers': ['file'], +- # 'level': 'INFO', +- #}, + } + + #: 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@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 = '[email protected]' ++ ++#: 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 +@@ -1,5 +1,3 @@ +-import os +- + #: Mailman Core default API Path + MAILMAN_REST_API_URL = 'http://localhost:8001' + #: Mailman Core API user +@@ -33,7 +31,7 @@ + ACCOUNT_AUTHENTICATION_METHOD = "username_email" + ACCOUNT_EMAIL_REQUIRED = True + ACCOUNT_EMAIL_VERIFICATION = "mandatory" +-ACCOUNT_UNIQUE_EMAIL = True ++ACCOUNT_UNIQUE_EMAIL = True + + #: Protocol for URLs generated for authentication, like email + #: confirmation. +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 @@ + # Postorius. If not, see <http://www.gnu.org/licenses/>. + + +-from django.conf.urls import include, url ++from django.conf.urls import include + from django.contrib import admin +-from django.urls import reverse_lazy ++from django.urls import path, reverse_lazy + from django.views.generic import RedirectView + + urlpatterns = [ +- url(r'^$', RedirectView.as_view( +- url=reverse_lazy('list_index'), +- permanent=True)), +- url(r'^mailman3/', include('postorius.urls')), +- url(r'^archives/', include('hyperkitty.urls')), +- url(r'', include('django_mailman3.urls')), +- 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), + ] +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 +@@ -7,8 +7,6 @@ + https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ + """ + +-import os +- + from django.core.wsgi import get_wsgi_application + from mailman_web.manage import setup + +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 +@@ -22,7 +22,7 @@ + setuptools + setuptools-scm + install_requires = +- Django<3.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 = [email protected] ++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 +@@ -1,5 +1,10 @@ + [tox] +-envlist = docs ++envlist = docs, lint ++ ++[testenv:lint] ++deps = flake8 ++basepython = python3 ++commands = flake8 . + + [testenv:docs] + deps = sphinx
