Mailman3 Docker question and importing lists from MM2
Hi,
Started experimenting with the Docker images at https://github.com/maxking/docker-mailman/.
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?
I tried it without the environment set, and also with some variables like:
SERVE_FROM_DOMAIN=['lists.domain.com', 'lists.domain2.com'] and SERVE_FROM_DOMAIN="lists.domain1.com", "lists.domain2.com"
However I still only get the example.com site.
Furthermore, is there a recommended way to get data from MM2 (list configs and archives) into MM3?
Thanks. Andrew.
On 09/01/2017 07:09 AM, Andrew Hodgson 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?
I don't know the answer to this.
Furthermore, is there a recommended way to get data from MM2 (list configs and archives) into MM3?
There are two things.
For importing list configs there is
bin/mailman import21
but it is not up to date and probably doesn't work.
For importing archives there is
django-admin hyperkitty_import [--settings=if.needed]
which works well using the MM 2.1 LISTNAME.mbox/LISTNAME.mbox file as input.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
For importing archives there is
django-admin hyperkitty_import [--settings=if.needed]
which works well using the MM 2.1 LISTNAME.mbox/LISTNAME.mbox file as input.
If you are using the docker containers provided at https://asynchronous.in/docker-mailman it might be easier to
docker exec -ti mailman-web /bin/bash --login cd /opt/mailman-web
and then call the manage.py script
./manage.py hyperkitty_import ..etc
--cro
bin/mailman import21
I saw this in the image, do you have any idea about what may be missing from this? I may shelve this project again for the time being if we can't do the migration, but good to know I can get a production like Docker instance running relatively painlessly.
Andrew.
-----Original Message----- From: Mark Sapiro [mailto:mark@msapiro.net] Sent: 01 September 2017 16:43 To: mailman-users@mailman3.org Subject: [MM3-users] Re: Mailman3 Docker question and importing lists from MM2
On 09/01/2017 07:09 AM, Andrew Hodgson 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?
I don't know the answer to this.
Furthermore, is there a recommended way to get data from MM2 (list configs and archives) into MM3?
There are two things.
For importing list configs there is
bin/mailman import21
but it is not up to date and probably doesn't work.
For importing archives there is
django-admin hyperkitty_import [--settings=if.needed]
which works well using the MM 2.1 LISTNAME.mbox/LISTNAME.mbox file as input.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
On 09/01/2017 04:29 PM, Andrew Hodgson wrote:
bin/mailman import21
I saw this in the image, do you have any idea about what may be missing from this?
I don't specifically recall. I know I tried it only once and it threw some exception and died, but not before creating some templates in an obsolete (for current MM 3) format.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 09/01/2017 04:29 PM, Andrew Hodgson wrote:
bin/mailman import21
I saw this in the image, do you have any idea about what may be
missing from this?
I did report this at the time. See <https://gitlab.com/mailman/mailman/issues/270>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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.com
I also had to login to the Django admin interface and create the domains there under Home->Sites
--cro
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.com
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
Hi,
Thanks for this, I saw the Docker entrypoint script which assumes the domain variable in the Docker environment expects a single domain. If I alter the local settings file, do I need to add in the domains from the default settings file, or will that get merged?
Thanks. Andrew.
From: Abhilash Raj [raj.abhilash1@gmail.com] Sent: 01 September 2017 17:29 To: C. R. Oldham; 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.com
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/
On Fri, Sep 1, 2017, at 09:35 AM, Andrew Hodgson wrote:
Hi,
Thanks for this, I saw the Docker entrypoint script which assumes the domain variable in the Docker environment expects a single domain. If I alter the local settings file, do I need to add in the domains from the default settings file, or will that get merged?
It will just override anything in the default settings.
So, any variable you add in the settings_local.py should include the default ones too, unless obviously if you don't want them.
Thanks. Andrew.
From: Abhilash Raj [raj.abhilash1@gmail.com] Sent: 01 September 2017 17:29 To: C. R. Oldham; 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.com
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/
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj
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/
On Sat, Sep 2, 2017, at 05:10 AM, Andrew Hodgson wrote:
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.
This should have worked, it could be a bug somewhere in the setup scripts. I have opened an issue on the Github project1 and will investigate further as soon as I can.
I tried something a bit different, I set SERVE_FROM_DOMAIN='lists.walsgrave.com'
I don't think there is need for quotes, which is evident from the error trace. I wonder if it makes sense to validate this in the setup script before feeding it to Django?
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 1In 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/
-- thanks, Abhilash Raj
participants (4)
-
Abhilash Raj
-
Andrew Hodgson
-
C. R. Oldham
-
Mark Sapiro