Mailman3: Working cas

certbot_on_virtu
Alexandre Iooss 2020-07-11 17:30:25 +02:00
parent ae36169565
commit ed40b871dc
2 changed files with 18 additions and 3 deletions

View File

@ -1,12 +1,16 @@
--- ---
# You will need to do after: sudo pip3 install django-allauth-cas
# Yes, it is horrible but we need Debian Python3 to see this django app.
- name: Install mailman3 - name: Install mailman3
apt: apt:
update_cache: true update_cache: true
name: name:
- mailman3-full - mailman3-full
- nginx - nginx
- dbconfig-no-thanks - dbconfig-no-thanks # Do not autoconfigure database
- postgresql - postgresql
- python3-pip # CAS
- python3-lxml # CAS
install_recommends: false install_recommends: false
register: apt_result register: apt_result
retries: 3 retries: 3
@ -29,6 +33,7 @@
# sudo -u postgres createuser -P mailman3web # sudo -u postgres createuser -P mailman3web
# sudo -u postgres createdb -O mailman3web mailman3web # sudo -u postgres createdb -O mailman3web mailman3web
# Test with: psql -U mailman3web -W -d mailman3web -h localhost # Test with: psql -U mailman3web -W -d mailman3web -h localhost
# Then migrate data: sudo /usr/share/mailman3-web/manage.py migrate
- name: Configure mailman3-web - name: Configure mailman3-web
template: template:
src: mailman3/mailman-web.py.j2 src: mailman3/mailman-web.py.j2

View File

@ -30,7 +30,12 @@ MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')
# Application definition # Application definition
# Add allauth_cas_crans path
import sys
sys.path.insert(0, "/usr/scripts/mailman")
INSTALLED_APPS = ( INSTALLED_APPS = (
'mailman_theme_crans', # override templates
'hyperkitty', 'hyperkitty',
'postorius', 'postorius',
'django_mailman3', 'django_mailman3',
@ -53,6 +58,8 @@ INSTALLED_APPS = (
'allauth', 'allauth',
'allauth.account', 'allauth.account',
'allauth.socialaccount', 'allauth.socialaccount',
'allauth_cas',
'allauth_cas_crans',
#'django_mailman3.lib.auth.fedora', #'django_mailman3.lib.auth.fedora',
#'allauth.socialaccount.providers.openid', #'allauth.socialaccount.providers.openid',
#'allauth.socialaccount.providers.github', #'allauth.socialaccount.providers.github',
@ -156,6 +163,7 @@ ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
# Social auth # Social auth
# #
SOCIALACCOUNT_PROVIDERS = { SOCIALACCOUNT_PROVIDERS = {
'crans': {}
#'openid': { #'openid': {
# 'SERVERS': [ # 'SERVERS': [
# dict(id='yahoo', # dict(id='yahoo',
@ -191,3 +199,5 @@ COMPRESS_OFFLINE = True
POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost/mailman3/' POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost/mailman3/'
# Use Crans SMTP for Django mails
EMAIL_HOST = 'smtp.crans.org'