diff --git a/pillar/role/mailman3.sls b/pillar/role/mailman3.sls index db992f3..c0c4d79 100644 --- a/pillar/role/mailman3.sls +++ b/pillar/role/mailman3.sls @@ -40,6 +40,8 @@ nginx: - include: /etc/nginx/mboxs.rewritemap - map $request_uri $miscs_rewritemap: - include: /etc/nginx/miscs.rewritemap + - upstream mailmanweb: + - server: 127.0.0.1:8000 fail_timeout=0 - server: - server_name: lists.opensuse.org lists.uyuni-project.org - listen: @@ -58,10 +60,16 @@ nginx: - location /static/django-mailman3/img/login/opensuse.png: - return: 301 https://static.opensuse.org/favicon-24.png - location /static/: - - alias: /var/lib/mailman_webui/static/ + - alias: /srv/www/webapps/mailman/web/static/ - location /: - - include: /etc/nginx/uwsgi_params - - uwsgi_pass: 0.0.0.0:8000 + - try_files $uri @mailmanweb + - location @mailmanweb: + - proxy_set_header: X-Forwarded-For $proxy_add_x_forwarded_for + - proxy_set_header: X-Forwarded-Proto https + - proxy_set_header: X-Forwarded-Protocol ssl + - proxy_set_header: Host $http_host + - proxy_redirect: off + - proxy_pass: http://mailmanweb enabled: True sudoers: diff --git a/salt/profile/mailman3/config.sls b/salt/profile/mailman3/config.sls index cca372d..650d8ba 100644 --- a/salt/profile/mailman3/config.sls +++ b/salt/profile/mailman3/config.sls @@ -10,7 +10,7 @@ mailman_conf_file: mailman_web_settings_file: file.managed: - - name: /srv/www/webapps/mailman/web/settings.py + - name: /etc/mailman3/settings.py - source: salt://profile/mailman3/files/settings.py - template: jinja - require_in: diff --git a/salt/profile/mailman3/files/settings.py b/salt/profile/mailman3/files/settings.py index c74b46f..36ca7ca 100644 --- a/salt/profile/mailman3/files/settings.py +++ b/salt/profile/mailman3/files/settings.py @@ -58,7 +58,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ - BASE_DIR + '/templates/', + os.path.join(BASE_DIR, 'templates/'), ], 'OPTIONS': { 'loaders': [ @@ -170,7 +170,7 @@ STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - BASE_DIR + '/static-openSUSE/', + os.path.join(BASE_DIR, 'static-openSUSE/'), ) # If you enable internal authentication, this is the address that the emails diff --git a/salt/profile/mailman3/mailman.sls b/salt/profile/mailman3/mailman.sls index ccd9c45..1ddc760 100644 --- a/salt/profile/mailman3/mailman.sls +++ b/salt/profile/mailman3/mailman.sls @@ -1,5 +1,6 @@ mailman_pgks: pkg.installed: + - resolve_capabilities: True - pkgs: - uwsgi - python3-xapian diff --git a/salt/profile/mailman3/master.sls b/salt/profile/mailman3/master.sls index b45bf4a..8a8a5db 100644 --- a/salt/profile/mailman3/master.sls +++ b/salt/profile/mailman3/master.sls @@ -1,9 +1,3 @@ -lists-o-o_pgks: - pkg.installed: - - pkgs: - - make - - python3-libsass - https://github.com/openSUSE/lists-o-o.git: git.latest: - branch: master @@ -22,9 +16,3 @@ https://github.com/openSUSE/lists-o-o.git: /srv/www/webapps/mailman/web/static-openSUSE: file.symlink: - target: /var/lib/mailman/lists-o-o/webui-assets - -lists-o-o_build: - cmd.run: - - name: make - - cwd: /var/lib/mailman/lists-o-o - - runas: mailman