diff --git a/docker/mailman/core/Dockerfile b/docker/mailman/core/Dockerfile index 71c9952593..aa65927941 100644 --- a/docker/mailman/core/Dockerfile +++ b/docker/mailman/core/Dockerfile @@ -1,4 +1,3 @@ -# 2023-08-25T16:35:09 UTC - trigger rebuild # syntax = docker/dockerfile:1.3 # Use 3.15 for Core since it has Python 3.9 FROM alpine:3.18 @@ -22,6 +21,7 @@ RUN --mount=type=cache,target=/root/.cache \ gunicorn==19.9.0 \ pymysql \ -r /tmp/requirements.txt \ + 'importlib-resources<6.0.0' \ && apk del build-deps \ && adduser -S mailman diff --git a/docker/mailman/core/docker-entrypoint.sh b/docker/mailman/core/docker-entrypoint.sh index 254df08414..d0bd089b0f 100755 --- a/docker/mailman/core/docker-entrypoint.sh +++ b/docker/mailman/core/docker-entrypoint.sh @@ -67,7 +67,7 @@ function setup_database () { # Translate mysql:// urls to mysql+mysql:// backend: if [[ "$DATABASE_URL" == mysql://* ]]; then DATABASE_URL="mysql+pymysql://${DATABASE_URL:8}" - echo "Database URL was automatically rewritten to: $DATABASE_URL" + echo "Database URL prefix was automatically rewritten to: mysql+pymysql://" fi # If DATABASE_CLASS is not set, guess it for common databases: diff --git a/docker/mailman/core/requirements.txt b/docker/mailman/core/requirements.txt index ed51820df0..b100b911b6 100644 --- a/docker/mailman/core/requirements.txt +++ b/docker/mailman/core/requirements.txt @@ -1,8 +1,5 @@ # This is a separate file from Dockerfile so that we can use dependabot # for version updates that isn't supported for contents inside the # Dockerfile. -mailman==3.3.8 -mailman-hyperkitty==1.2.1 -# mailman/config/config.py "from importlib_resources import path" ImportError -# remove when https://gitlab.com/mailman/mailman/-/issues/1093 is solved -importlib_resources<6 +mailman==3.3.9 +mailman-hyperkitty==1.2.1 \ No newline at end of file diff --git a/docker/mailman/web/Dockerfile b/docker/mailman/web/Dockerfile index 6f8978f411..c440f8ece5 100644 --- a/docker/mailman/web/Dockerfile +++ b/docker/mailman/web/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.3 -FROM alpine:3.18.2 +FROM alpine:3.18.4 # Add needed files for uwsgi server + settings for django COPY mailman-web /opt/mailman-web diff --git a/docker/mailman/web/docker-entrypoint.sh b/docker/mailman/web/docker-entrypoint.sh index 09124c97e6..3324d0556e 100755 --- a/docker/mailman/web/docker-entrypoint.sh +++ b/docker/mailman/web/docker-entrypoint.sh @@ -118,12 +118,12 @@ echo "Compiling locale files in $SITE_DIR" cd $SITE_DIR && /opt/mailman-web/manage.py compilemessages && cd - # Compress static files. -python3 manage.py compress --force +python3 /opt/mailman-web/manage.py compress --force # Migrate all the data to the database if this is a new installation, otherwise # this command will upgrade the database. -python3 manage.py migrate +python3 /opt/mailman-web/manage.py migrate # If MAILMAN_ADMIN_USER and MAILMAN_ADMIN_EMAIL is defined create a new # superuser for Django. There is no password setup so it can't login yet unless @@ -131,7 +131,7 @@ python3 manage.py migrate if [[ -v MAILMAN_ADMIN_USER ]] && [[ -v MAILMAN_ADMIN_EMAIL ]]; then echo "Creating admin user $MAILMAN_ADMIN_USER ..." - python3 manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\ + python3 /opt/mailman-web/manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\ --email "$MAILMAN_ADMIN_EMAIL" 2> /dev/null || \ echo "Superuser $MAILMAN_ADMIN_USER already exists" fi @@ -141,7 +141,7 @@ fi if [[ -v SERVE_FROM_DOMAIN ]]; then echo "Setting $SERVE_FROM_DOMAIN as the default domain ..." - python3 manage.py shell -c \ + python3 /opt/mailman-web/manage.py shell -c \ "from django.contrib.sites.models import Site; Site.objects.filter(domain='example.com').update(domain='$SERVE_FROM_DOMAIN', name='$SERVE_FROM_DOMAIN')" fi diff --git a/docker/mailman/web/mailman-web/settings.py b/docker/mailman/web/mailman-web/settings.py index ae0365356d..4903645652 100644 --- a/docker/mailman/web/mailman-web/settings.py +++ b/docker/mailman/web/mailman-web/settings.py @@ -107,6 +107,7 @@ MIDDLEWARE = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', + 'allauth.account.middleware.AccountMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware', ) diff --git a/docker/mailman/web/requirements.txt b/docker/mailman/web/requirements.txt index 407c45dad3..c157bc651c 100644 --- a/docker/mailman/web/requirements.txt +++ b/docker/mailman/web/requirements.txt @@ -1,4 +1,4 @@ mailmanclient==3.3.5 -postorius==1.3.8 -hyperkitty==1.3.7 -django-mailman3==1.3.9 +postorius==1.3.10 +hyperkitty==1.3.8 +django-mailman3==1.3.11 \ No newline at end of file diff --git a/playbooks/roles/mailman3/files/web-settings.py b/playbooks/roles/mailman3/files/web-settings.py index 88397b323c..b6dcf7e580 100644 --- a/playbooks/roles/mailman3/files/web-settings.py +++ b/playbooks/roles/mailman3/files/web-settings.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file has been copied from: -# https://github.com/maxking/docker-mailman/blob/57a2f54/web/mailman-web/settings.py +# https://github.com/maxking/docker-mailman/blob/ab8dfb3/web/mailman-web/settings.py # In order to override the ALLOWED_HOSTS and SITE_ID settings. # # Copyright (C) 1998-2016 by the Free Software Foundation, Inc. @@ -114,6 +114,7 @@ MIDDLEWARE = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', + 'allauth.account.middleware.AccountMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware', )