@@ -16,7 +16,7 @@ RUN set -ex \
|
||||
&& apk add --no-cache --virtual .mailman-rundeps bash sassc \
|
||||
postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \
|
||||
python3 py3-pip xapian-core xapian-bindings-python3 libffi pcre-dev \
|
||||
&& python3 -m pip install -U 'Django<3.0' pip setuptools wheel \
|
||||
&& python3 -m pip install -U 'Django<3.1' pip setuptools wheel \
|
||||
&& pip install mailmanclient==3.3.2 \
|
||||
postorius==1.3.4 \
|
||||
hyperkitty==1.3.4 \
|
||||
@@ -30,6 +30,7 @@ RUN set -ex \
|
||||
xapian-haystack \
|
||||
django-auth-ldap \
|
||||
python-memcached \
|
||||
diskcache \
|
||||
&& apk del .build-deps \
|
||||
&& addgroup -S mailman \
|
||||
&& adduser -S -G mailman mailman \
|
||||
|
||||
@@ -34,7 +34,8 @@ RUN set -ex \
|
||||
xapian-haystack \
|
||||
django-auth-ldap \
|
||||
python-memcached \
|
||||
&& python3 -m pip install -U 'Django<3.0' \
|
||||
diskcache \
|
||||
&& python3 -m pip install -U 'Django<3.1' \
|
||||
&& python3 -m pip install -U \
|
||||
git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \
|
||||
&& apk del .build-deps \
|
||||
|
||||
@@ -46,7 +46,7 @@ ADMINS = (
|
||||
SITE_ID = 1
|
||||
|
||||
# Hosts/domain names that are valid for this site; required if DEBUG is False
|
||||
# See https://docs.djangoproject.com/en/1.8/ref/settings/#allowed-hosts
|
||||
# See https://docs.djangoproject.com/en/3.1/ref/settings/#allowed-hosts
|
||||
ALLOWED_HOSTS = [
|
||||
"localhost", # Archiving API from Mailman, keep it.
|
||||
# "lists.your-domain.org",
|
||||
@@ -91,6 +91,7 @@ DEFAULT_APPS = [
|
||||
'allauth.account',
|
||||
'allauth.socialaccount',
|
||||
]
|
||||
|
||||
MAILMAN_WEB_SOCIAL_AUTH = [
|
||||
'django_mailman3.lib.auth.fedora',
|
||||
'allauth.socialaccount.providers.openid',
|
||||
@@ -143,9 +144,7 @@ WSGI_APPLICATION = 'wsgi.application'
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
|
||||
|
||||
|
||||
# This uses $DATABASE_URL from the environment variable to create a
|
||||
# dj_database_url uses $DATABASE_URL environment variable to create a
|
||||
# django-style-config-dict.
|
||||
# https://github.com/kennethreitz/dj-database-url
|
||||
DATABASES = {
|
||||
@@ -161,20 +160,16 @@ USE_X_FORWARDED_HOST = True
|
||||
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME':
|
||||
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME':
|
||||
'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME':
|
||||
'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME':
|
||||
'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -343,8 +338,6 @@ LOGGING = {
|
||||
'level': 'INFO',
|
||||
'stream': sys.stdout,
|
||||
},
|
||||
# TODO: use an environment variable $DJ_LOG_URL to configure the logging
|
||||
# using an environment variable.
|
||||
},
|
||||
'loggers': {
|
||||
'django.request': {
|
||||
@@ -376,16 +369,13 @@ LOGGING = {
|
||||
'format': '%(levelname)s %(message)s'
|
||||
},
|
||||
},
|
||||
#'root': {
|
||||
# 'handlers': ['file'],
|
||||
# 'level': 'INFO',
|
||||
#},
|
||||
}
|
||||
|
||||
|
||||
if os.environ.get('LOG_TO_CONSOLE') == 'yes':
|
||||
LOGGING['loggers']['django']['handlers'].append('console')
|
||||
LOGGING['loggers']['django.request']['handlers'].append('console')
|
||||
|
||||
# HyperKitty-specific
|
||||
#
|
||||
# Only display mailing-lists from the same virtual host as the webserver
|
||||
@@ -401,6 +391,16 @@ Q_CLUSTER = {
|
||||
|
||||
POSTORIUS_TEMPLATE_BASE_URL = os.environ.get('POSTORIUS_TEMPLATE_BASE_URL', 'http://mailman-web:8000')
|
||||
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'diskcache.DjangoCache',
|
||||
'LOCATION': '/opt/mailman-web-data/diskcache',
|
||||
'OPTIONS': {
|
||||
'size_limit': 2 ** 30 # 1 gigabyte
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
try:
|
||||
from settings_local import *
|
||||
except ImportError:
|
||||
|
||||
Reference in New Issue
Block a user