Fixes for Postorius-only deployment
This commit is contained in:
@@ -125,11 +125,6 @@ admin_user: $MAILMAN_REST_USER
|
|||||||
admin_pass: $MAILMAN_REST_PASSWORD
|
admin_pass: $MAILMAN_REST_PASSWORD
|
||||||
configuration: /etc/gunicorn.cfg
|
configuration: /etc/gunicorn.cfg
|
||||||
|
|
||||||
[archiver.hyperkitty]
|
|
||||||
class: mailman_hyperkitty.Archiver
|
|
||||||
enable: yes
|
|
||||||
configuration: /etc/mailman-hyperkitty.cfg
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate a basic gunicorn.cfg.
|
# Generate a basic gunicorn.cfg.
|
||||||
@@ -197,11 +192,17 @@ then
|
|||||||
cat /opt/mailman/gunicorn-extra.cfg > /etc/gunicorn.cfg
|
cat /opt/mailman/gunicorn-extra.cfg > /etc/gunicorn.cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -v HYPERKITTY_API_KEY ]]; then
|
if [[ -v HYPERKITTY_API_KEY ]]; then
|
||||||
echo "HYPERKITTY_API_KEY not defined, please set this environment variable..."
|
|
||||||
echo "exiting..."
|
echo "HYPERKITTY_API_KEY found, setting up HyperKitty archiver..."
|
||||||
exit 1
|
|
||||||
fi
|
cat >> /etc/mailman.cfg << EOF
|
||||||
|
[archiver.hyperkitty]
|
||||||
|
class: mailman_hyperkitty.Archiver
|
||||||
|
enable: yes
|
||||||
|
configuration: /etc/mailman-hyperkitty.cfg
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
if [[ ! -v HYPERKITTY_URL ]]; then
|
if [[ ! -v HYPERKITTY_URL ]]; then
|
||||||
echo "HYPERKITTY_URL not set, using the default value of http://mailman-web:8000/hyperkitty"
|
echo "HYPERKITTY_URL not set, using the default value of http://mailman-web:8000/hyperkitty"
|
||||||
@@ -215,6 +216,8 @@ base_url: $HYPERKITTY_URL
|
|||||||
api_key: $HYPERKITTY_API_KEY
|
api_key: $HYPERKITTY_API_KEY
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate the LMTP files for postfix if needed.
|
# Generate the LMTP files for postfix if needed.
|
||||||
mailman aliases
|
mailman aliases
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ services:
|
|||||||
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
||||||
- DATABASE_TYPE=postgres
|
- DATABASE_TYPE=postgres
|
||||||
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
|
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
|
||||||
- HYPERKITTY_API_KEY=someapikey
|
|
||||||
networks:
|
networks:
|
||||||
mailman:
|
mailman:
|
||||||
ipv4_address: 172.19.199.2
|
ipv4_address: 172.19.199.2
|
||||||
@@ -35,7 +34,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- DATABASE_TYPE=postgres
|
- DATABASE_TYPE=postgres
|
||||||
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
||||||
- HYPERKITTY_API_KEY=someapikey
|
|
||||||
- SECRET_KEY=ksjdbaksdba
|
- SECRET_KEY=ksjdbaksdba
|
||||||
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
|
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
|
|||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
import os
|
import os
|
||||||
import socket
|
|
||||||
import dj_database_url
|
import dj_database_url
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -57,8 +56,6 @@ ALLOWED_HOSTS = [
|
|||||||
os.environ.get('DJANGO_ALLOWED_HOSTS'),
|
os.environ.get('DJANGO_ALLOWED_HOSTS'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Try to get the address of Mailman Core automatically.
|
|
||||||
|
|
||||||
# Mailman API credentials
|
# Mailman API credentials
|
||||||
MAILMAN_REST_API_URL = os.environ.get('MAILMAN_REST_URL', 'http://mailman-core:8001')
|
MAILMAN_REST_API_URL = os.environ.get('MAILMAN_REST_URL', 'http://mailman-core:8001')
|
||||||
MAILMAN_REST_API_USER = os.environ.get('MAILMAN_REST_USER', 'restadmin')
|
MAILMAN_REST_API_USER = os.environ.get('MAILMAN_REST_USER', 'restadmin')
|
||||||
@@ -67,7 +64,7 @@ MAILMAN_ARCHIVER_FROM = (os.environ.get('MAILMAN_HOST_IP', '172.19.199.2'),)
|
|||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = [
|
||||||
'postorius',
|
'postorius',
|
||||||
'django_mailman3',
|
'django_mailman3',
|
||||||
# Uncomment the next line to enable the admin:
|
# Uncomment the next line to enable the admin:
|
||||||
@@ -89,9 +86,9 @@ INSTALLED_APPS = (
|
|||||||
'allauth.socialaccount.providers.github',
|
'allauth.socialaccount.providers.github',
|
||||||
'allauth.socialaccount.providers.gitlab',
|
'allauth.socialaccount.providers.gitlab',
|
||||||
'allauth.socialaccount.providers.google',
|
'allauth.socialaccount.providers.google',
|
||||||
)
|
]
|
||||||
|
|
||||||
MIDDLEWARE = (
|
_MIDDLEWARE = (
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
@@ -104,8 +101,17 @@ MIDDLEWARE = (
|
|||||||
'postorius.middleware.PostoriusMiddleware',
|
'postorius.middleware.PostoriusMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Use old-style Middleware class in Python 2 and released versions of
|
||||||
|
# Django-mailman3 don't support new style middlewares.
|
||||||
|
|
||||||
|
if sys.version_info < (3, 0):
|
||||||
|
MIDDLEWARE_CLASSES = _MIDDLEWARE
|
||||||
|
else:
|
||||||
|
MIDDLEWARE = _MIDDLEWARE
|
||||||
|
|
||||||
ROOT_URLCONF = 'urls'
|
ROOT_URLCONF = 'urls'
|
||||||
|
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
@@ -213,9 +219,10 @@ SERVER_EMAIL = 'root@{}'.format(hostname)
|
|||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
EMAIL_HOST = os.environ.get('SMTP_HOST', '172.19.199.1')
|
EMAIL_HOST = os.environ.get('SMTP_HOST', '172.19.199.1')
|
||||||
EMAIL_PORT = os.environ.get('SMTP_PORT', 25)
|
EMAIL_PORT = os.environ.get('SMTP_PORT', 25)
|
||||||
EMAIL_HOST_USER = ''
|
EMAIL_HOST_USER = os.environ.get('SMTP_HOST_USER', '')
|
||||||
EMAIL_HOST_PASSWORD = ''
|
EMAIL_HOST_PASSWORD = os.environ.get('SMTP_HOST_PASSWORD', '')
|
||||||
EMAIL_USE_TLS = False
|
EMAIL_USE_TLS = os.environ.get('SMTP_USE_TLS', False)
|
||||||
|
|
||||||
|
|
||||||
# Compatibility with Bootstrap 3
|
# Compatibility with Bootstrap 3
|
||||||
from django.contrib.messages import constants as messages # flake8: noqa
|
from django.contrib.messages import constants as messages # flake8: noqa
|
||||||
@@ -339,6 +346,7 @@ LOGGING = {
|
|||||||
if os.environ.get('LOG_TO_CONSOLE') == 'yes':
|
if os.environ.get('LOG_TO_CONSOLE') == 'yes':
|
||||||
LOGGING['loggers']['django']['handlers'].append('console')
|
LOGGING['loggers']['django']['handlers'].append('console')
|
||||||
LOGGING['loggers']['django.request']['handlers'].append('console')
|
LOGGING['loggers']['django.request']['handlers'].append('console')
|
||||||
|
POSTORIUS_TEMPLATE_BASE_URL = os.environ.get('POSTORIUS_TEMPLATE_BASE_URL', 'http://mailman-web:8000')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from settings_local import *
|
from settings_local import *
|
||||||
|
|||||||
Reference in New Issue
Block a user