-
Notifications
You must be signed in to change notification settings - Fork 1
/
mailman3-django-settings.py
161 lines (132 loc) · 5.74 KB
/
mailman3-django-settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Mailman Web configuration file.
# /etc/mailman3/settings.py
# Get the default settings from mailman_web/settings/mailman.py
from mailman_web.settings.base import *
from mailman_web.settings.mailman import *
# Settings below supplement or override the defaults.
# see also https://docs.djangoproject.com/en/4.1/ref/settings/
#: Default list of admins who receive the emails from error logging.
ADMINS = [
# ('Mailman Suite Admin', 'root@localhost'), # optional for sending exceptions via e-mail
]
# Postgresql database setup.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/@VARDIR@/db/mailman.db',
}
}
# 'collectstatic' command will copy all the static files here.
# Alias this location from your webserver to `/static`
STATIC_ROOT = '@VARDIR@/web/static'
# enable the 'compress' command.
COMPRESS_ENABLED = True
# Make sure that this directory is created or Django will fail on start.
LOGGING['handlers']['file']['filename'] = '@LOGDIR@/mailmanweb.log'
#: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = [
"localhost", # Archiving API from Mailman, keep it.
"127.0.0.1",
# "lists.your-domain.org",
# Add here all production domains you have.
]
#: See https://docs.djangoproject.com/en/dev/ref/settings/#csrf-trusted-origins
#: these are of the form 'https://lists.example.com' or
#: 'https://*.example.com' to include subdomains
CSRF_TRUSTED_ORIGINS = [
# "https://lists.your-domain.org",
# Add here all production domains you have.
]
#: Filter visible Mailing Lists based on the current host being used to serve.
#: Default: False
# FILTER_VHOST = True
#: 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/
#: in case of "FILTER_VHOST = True" consider "SITE_ID = 0" for having related site autoselected
SITE_ID = 1
# Set this to a new secret value.
SECRET_KEY = '@SECRET_KEY@'
# Set this to match the api_key setting in
# /etc/mailman3/hyperkitty.cfg (quoted here, not there).
MAILMAN_ARCHIVER_KEY = '@MAILMAN_ARCHIVER_KEY@'
# default with custom PATH
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': "@VARDIR@/archives/haystack/fulltext_index",
},
}
# The sender of emails from Django such as address confirmation requests.
# Set this to a valid email address.
DEFAULT_FROM_EMAIL = '[email protected]'
# The sender of error messages from Django. Set this to a valid email
# address.
SERVER_EMAIL = '[email protected]'
# see also
# https://docs.mailman3.org/en/latest/config-web.html
# https://docs.mailman3.org/projects/mailman-web/en/latest/settings.html
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
# EMAIL_HOST_USER = <username> # optional
# EMAIL_HOST_PASSWORD = <password> # optional
# Mailman Core default API Path
# Identical except for quoting with /etc/mailman.cfg -> [webservice]
# MAILMAN_REST_API_USER <-> admin_user
# MAILMAN_REST_API_PASS <-> admin_pass
# Must be aligned with /etc/mailman.cfg -> [webservice]
# MAILMAN_REST_API_URL <-> port
MAILMAN_REST_API_URL = 'http://localhost:@RESTAPIPORT@'
MAILMAN_REST_API_USER = 'restadmin'
MAILMAN_REST_API_PASS = '@RESTAPIPASS@'
# Postorius
POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:@WEBPORT@'
### CAPTCHA support
## Google's reCAPTCHA
# service : https://developers.google.com/recaptcha
# django-app: https://pypi.org/project/django-recaptcha/
INSTALLED_APPS.append('django_recaptcha')
# SILENCED_SYSTEM_CHECKS = ['django_recaptcha.recaptcha_test_key_error'] # enable this in case RECAPTCHA_PUBLIC_KEY+RECAPTCHA_PRIVATE_KEY are not used
RECAPTCHA_PUBLIC_KEY = '<your sitekey>'
RECAPTCHA_PRIVATE_KEY = '<your secret key>'
RECAPTCHA_PUBLIC_KEY_V2C = '<your sitekey V2 Checkbox>'
RECAPTCHA_PRIVATE_KEY_V2C = '<your secret key V2 Checkbox>'
RECAPTCHA_PUBLIC_KEY_V2I = '<your sitekey V2 Invisible>'
RECAPTCHA_PRIVATE_KEY_V2I = '<your secret key V2 Invisible>'
RECAPTCHA_PUBLIC_KEY_V3 = '<your sitekey V3>'
RECAPTCHA_PRIVATE_KEY_V3 = '<your secret key V3>'
RECAPTCHA_DOMAIN = 'www.recaptcha.net'
# RECAPTCHA_PROXY = {'http': 'http://127.0.0.1:3128', 'https': 'https://127.0.0.1:3128'} # optional
## hCaptcha
# general : https://docs.hcaptcha.com/
# django-app: https://pypi.org/project/django-hCaptcha/
INSTALLED_APPS.append('hcaptcha')
HCAPTCHA_SITEKEY = '<your sitekey>'
HCAPTCHA_SECRET = '<your secret key>'
# HCAPTCHA_PROXIES = {'http': 'http://127.0.0.1:3128', 'https': 'https://127.0.0.1:3128'} # optional
## Friendly Captcha
# service : https://docs.friendlycaptcha.com/
# django-app: https://pypi.org/project/django-friendly-captcha/
INSTALLED_APPS.append('friendly_captcha')
FRC_CAPTCHA_SITE_KEY = '<your sitekey>'
FRC_CAPTCHA_SECRET = '<your secret key>'
FRC_CAPTCHA_VERIFICATION_URL = 'https://api.friendlycaptcha.com/api/v1/siteverify'
## Cloudflare's Turnstile
# service : https://developers.cloudflare.com/turnstile
# django-app: https://pypi.org/project/django-turnstile/
INSTALLED_APPS.append('turnstile')
TURNSTILE_SITEKEY = '<your sitekey>'
TURNSTILE_SECRET = '<your secret key>'
# TURNSTILE_PROXIES = {'http': 'http://127.0.0.1:3128', 'https': 'https://127.0.0.1:3128'} # optional
## CAPTCHA selector
# CAPTCHA_SERVICE = 'recaptcha' # same as recaptchaV2C
# CAPTCHA_SERVICE = 'recaptchaV2C'
# CAPTCHA_SERVICE = 'recaptchaV2I'
# CAPTCHA_SERVICE = 'recaptchaV3'
# CAPTCHA_SERVICE = 'hcaptcha'
# CAPTCHA_SERVICE = 'friendlycaptcha'
# CAPTCHA_SERVICE = 'turnstile'
# Disable gravatar by default
HYPERKITTY_ENABLE_GRAVATAR = False
INSTALLED_APPS.remove('django_gravatar')