Hi,
I got up a new set of images this morning, and found the following:
In docker-compose.override.yml: version: '2'
services: [...]
mailman-web: environment: [...] - SERVE_FROM_DOMAIN=lists.walsgrave.com
Gives me the following when I start the mailman-web image:
mailman-web | Setting as the default domain ...
The web server starts but it still has example.com as the domain, this is with a completely fresh set of files in /opt/mailman.
I tried something a bit different, I set SERVE_FROM_DOMAIN='lists.walsgrave.com'
Got the following:
mailman-web | Setting as the default domain ... mailman-web | Traceback (most recent call last): mailman-web | File "manage.py", line 10, in <module> mailman-web | execute_from_command_line(sys.argv) mailman-web | File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line mailman-web | utility.execute() mailman-web | File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute mailman-web | self.fetch_command(subcommand).run_from_argv(self.argv) mailman-web | File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv mailman-web | self.execute(*args, **cmd_options) mailman-web | File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 356, in execute mailman-web | output = self.handle(*args, **options) mailman-web | File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/shell.py", line 114, in handle mailman-web | exec(options['command']) mailman-web | File "<string>", line 1 mailman-web | from django.contrib.sites.models import Site; Site.objects.filter(domain='example.com').update(domain=''lists.walsgrave.com'') mailman-web | ^ mailman-web | SyntaxError: invalid syntax mailman-web exited with code 1
In the first example where everything is fine but the default site isn't renamed, I logged into the container and got environment variables, I could see the variable was being set ok.
Any suggestions? Thanks. Andrew.
-----Original Message----- From: Abhilash Raj [mailto:raj.abhilash1@gmail.com] Sent: 01 September 2017 17:30 To: C. R. Oldham <cro@ncbt.org>; mailman-users@mailman3.org Subject: [MM3-users] Re: Mailman3 Docker question and importing lists from MM2
On Fri, Sep 1, 2017, at 08:51 AM, C. R. Oldham wrote:
I had a question regarding the parameter: SERVE_FROM_DOMAIN.
I want to use multiple domains, what is the best way to specify multiple domains in this environment variable?
This works OK for me:
SERVE_FROM_DOMAIN=lists.domain1.org,lists.domain2.net,lists.domain3.co m
I never thought this would work, I would correspond to an invalid entry in ALLOWED_HOSTS in Django configuration.
The best way would be to put the domain you are going to serve from in the SERVE_FROM_DOMAIN variable as this would replace the example.com
SITE that Django creates by default.
And then, you can list all your domains in /opt/mailman/web/settings_local.py in a Python list:
ALLOWED_HOSTS = ["domain1", "domain2", "domain3"]
Note that you need to also include the domain you set in SERVE_FROM_DOMAIN here.
I also had to login to the Django admin interface and create the domains there under Home->Sites
And yes, for Django to allow domains, you need to create a 'Site' in the admin console. The default one is created automatically using SERVE_FROM_DOMAIN variable.
--cro
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/