Docker mailman3 delete social logins, did something change?
I want to remove the social logins from mailman3 in docker.
I found this info https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/L...
but the link to the default shows
INSTALLED_APPS = [] DEFAULT_APPS = [ 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', ]
However when I go to the bug https://github.com/maxking/docker-mailman/issues/283
it shows
INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'paintstore', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.gitlab', 'allauth.socialaccount.providers.google', )
The two examples are different so what should it be?
I tried to add it in both ways and when I do I get bad gateway and he mailman website is broke. I have not setup any domains yet, just setup the admin password,.
For example this breaks my website
cat /opt/mailman/web/settings_local.py
ALLOWED_HOSTS = ['127.0.0.1','localhost','REDACTED','REDACTED','REDACTED','REDACTED','REDACTED'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'REDACTED' EMAIL_PORT = 25 INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'paintstore', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.gitlab', 'allauth.socialaccount.providers.google', )
And I have even removed anything?
What should my /opt/mailman/web/settings_local.py look like?
On 9/15/21 7:37 AM, bob B wrote:
I want to remove the social logins from mailman3 in docker.
Which version tag are you using?
I found this info https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/L...
but the link to the default shows
INSTALLED_APPS = [] DEFAULT_APPS = [ 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', ]
The link to default is a dynamic one, so it changes as the changes are made in the repo, unfortunately, this is basically the new stuff that isn't out yet.
However when I go to the bug https://github.com/maxking/docker-mailman/issues/283
it shows
INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'paintstore', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.gitlab', 'allauth.socialaccount.providers.google', )
The two examples are different so what should it be?
If you want to remove social auth applications, you basically want to override INSTALLED_APPS configuraiton in your settings_local.py. In the list above, you want to remove everything after 'django_mailman3.lib.auth.fedora' and set that as INSTALLED_APPS in your settings_local.py.
I tried to add it in both ways and when I do I get bad gateway and he mailman website is broke. I have not setup any domains yet, just setup the admin password,.
Bad gateway usually will emit some sort of logging error in the mailman logs at /opt/mailman/web/logs/, what kind of exception are you seeing there?
The configuration above, while enables social auth, shouldn't *break* the website. There must be errors/exceptions in logs to point in the direction of what the error might be.
For example this breaks my website
cat /opt/mailman/web/settings_local.py
ALLOWED_HOSTS = ['127.0.0.1','localhost','REDACTED','REDACTED','REDACTED','REDACTED','REDACTED'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'REDACTED' EMAIL_PORT = 25 INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'paintstore', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.gitlab', 'allauth.socialaccount.providers.google', )
And I have even removed anything?
What should my /opt/mailman/web/settings_local.py look like?
-- thanks, Abhilash Raj (maxking)
for version tag you mean the docker images?
509940b4c44f maxking/mailman-web:0.3
mailman-web maxking/mailman-core:0.3
Also this works for /opt/mailman/web/settings_local.py
#allowed_hosts = ['127.0.0.1', 'localhost','Redacted]'] ALLOWED_HOSTS = ['127.0.0.1','localhost','[Redacted]','172.19.199.3','172.19.199.1','172.19.199.4','172.19.199.1'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'Redacted' EMAIL_PORT = 25
But,
if I even add in one line like MAILMAN_WEB_SOCIAL_AUTH = []. so i would have
#allowed_hosts = ['127.0.0.1', 'localhost','Redacted]'] ALLOWED_HOSTS = ['127.0.0.1','localhost','[Redacted]','172.19.199.3','172.19.199.1','172.19.199.4','172.19.199.1'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'Redacted' EMAIL_PORT = 25 MAILMAN_WEB_SOCIAL_AUTH = []
When I try to add the items in tot remove social media, It basically acts like my /opt/mailman/web/settings_local.py. file is ignored and does not load. I do not get debugging. the log says my domian name is not an allowed which is a sympton that this file did not load.
So it appears that adding a section to remove the social media apps, stops this file from being loaded???
I even just tried to add in what is there ie
#allowed_hosts = ['127.0.0.1', 'localhost','Redacted]'] ALLOWED_HOSTS = ['127.0.0.1','localhost','[Redacted]','172.19.199.3','172.19.199.1','172.19.199.4','172.19.199.1'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'Redacted' EMAIL_PORT = 25 INSTALLED_APPS = [ 'hyperkitty', 'postorius', 'django_mailman3', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', ]
this this does not work the mailmanweb.log shows
ERROR 2021-09-16 13:19:07,479 1647 django.security.DisallowedHost Invalid HTTP_HOST header: '[REDACTED]
'. The domain name provided is not valid according to RFC 1034/1035.
WARNING 2021-09-16 13:19:07,520 1647 django.request Bad Request: /
WARNING 2021-09-16 13:19:07,520 1647 django.request Bad Request: /
So that shows me that my opt/mailman/web/settings_local.py. is no longer being loaded??
On Thu, Sep 16, 2021, at 5:45 AM, bob B wrote:
for version tag you mean the docker images? 509940b4c44f maxking/mailman-web:0.3
mailman-web maxking/mailman-core:0.3
Yeah, the version is basically the version tag. Thanks.
Also this works for /opt/mailman/web/settings_local.py
#allowed_hosts = ['127.0.0.1', 'localhost','Redacted]'] ALLOWED_HOSTS = ['127.0.0.1','localhost','[Redacted]','172.19.199.3','172.19.199.1','172.19.199.4','172.19.199.1'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'Redacted' EMAIL_PORT = 25
But,
if I even add in one line like MAILMAN_WEB_SOCIAL_AUTH = []. so i would have
#allowed_hosts = ['127.0.0.1', 'localhost','Redacted]'] ALLOWED_HOSTS = ['127.0.0.1','localhost','[Redacted]','172.19.199.3','172.19.199.1','172.19.199.4','172.19.199.1'] #ALLOWED_HOSTS = ['*'] DEBUG = True #DEBUG = False EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'Redacted' EMAIL_PORT = 25 MAILMAN_WEB_SOCIAL_AUTH = []
When I try to add the items in tot remove social media, It basically acts like my /opt/mailman/web/settings_local.py. file is ignored and does not load.
Did you re-start your container after editing the settings_local.py file? It will not automatically read new configs.
I do not get debugging.
The most authoritative way to see what the loaded settings are by running:
$ docker exec -it mailman-web python manage.py print_settings
And then look for the keys.
the log says my domian name is not an allowed which is a sympton that this file did not load.
So it appears that adding a section to remove the social media apps, stops this file from being loaded???
MAILMAN_WEB_SOCIAL_AUTH config was added in main branch but isn't released yet. The last release of 0.3.12 can be seen here1
So, it basically should have no effect. If your configs are breaking due to something, it is probably not that.
-- thanks, Abhilash Raj (maxking)
Got,
Per someones advice I waiting and the bad gateway error cleared. I was being impatient.
But
I looked at the variables using (docker exec -it mailman-web python3 manage.py print_settings) and
INSTALLED_APPS = ['hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.gitlab', 'allauth.socialaccount.providers.google']
so in /opt/mailman/web/settings_local.py. I added a modified version
INSTALLED_APPS = ['hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount']
And the social are gone!!!!!!!
participants (2)
-
Abhilash Raj
-
bob B