[mailman3] Disable signup on mailman
This module disables signup on mailman web UI. Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
parent
d9f1031dbc
commit
cf48dec0eb
3 changed files with 33 additions and 3 deletions
14
roles/mailman3/files/django_fedora_nosignup.py
Normal file
14
roles/mailman3/files/django_fedora_nosignup.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Disable local signup
|
||||||
|
|
||||||
|
from allauth.account.adapter import DefaultAccountAdapter
|
||||||
|
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
||||||
|
|
||||||
|
class NoLocalSignUpAdapter(DefaultAccountAdapter):
|
||||||
|
|
||||||
|
def is_open_for_signup(self, request):
|
||||||
|
return False
|
||||||
|
|
||||||
|
class SignUpEnabledSocialAdapter(DefaultSocialAccountAdapter):
|
||||||
|
|
||||||
|
def is_open_for_signup(self, request, sociallogin):
|
||||||
|
return True
|
|
@ -285,6 +285,19 @@
|
||||||
- mailman
|
- mailman
|
||||||
- db
|
- db
|
||||||
|
|
||||||
|
- name: Install the fedora-specific modules
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: django_fedora_nosignup.py
|
||||||
|
dest: "{{ mailman_webui_confdir }}/django_fedora_nosignup.py"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
- mailman
|
||||||
|
notify:
|
||||||
|
- reload apache
|
||||||
|
|
||||||
#
|
#
|
||||||
# Plug HyperKitty into Mailman
|
# Plug HyperKitty into Mailman
|
||||||
#
|
#
|
||||||
|
|
|
@ -68,10 +68,10 @@ INSTALLED_APPS = (
|
||||||
'django_q',
|
'django_q',
|
||||||
'hyperkitty',
|
'hyperkitty',
|
||||||
'postorius',
|
'postorius',
|
||||||
{% for service_name, service_data in mailman_login.items() %}
|
{% for service_name, service_data in mailman_login.items() %}
|
||||||
'allauth.socialaccount.providers.{{ service_data.provider }}',
|
'allauth.socialaccount.providers.{{ service_data.provider }}',
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
'allauth.socialaccount.providers.openid',
|
'allauth.socialaccount.providers.openid_connect',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,6 +223,9 @@ ACCOUNT_EMAIL_REQUIRED = True
|
||||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
|
||||||
ACCOUNT_UNIQUE_EMAIL = True
|
ACCOUNT_UNIQUE_EMAIL = True
|
||||||
|
# Disable local signup
|
||||||
|
ACCOUNT_ADAPTER = "django_fedora_nosignup.NoLocalSignUpAdapter"
|
||||||
|
SOCIALACCOUNT_ADAPTER = "django_fedora_nosignup.SignUpEnabledSocialAdapter"
|
||||||
|
|
||||||
SOCIALACCOUNT_PROVIDERS = {
|
SOCIALACCOUNT_PROVIDERS = {
|
||||||
'openid': {
|
'openid': {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue