Hi Andrew,
On Wed, Nov 1, 2017, at 12:43 PM, Andrew Hodder wrote:
Well, that can't be true, I'm running DEBUG = False and Django is certainly trying to provide static files (as you'll see below):
I found the issue in the nginx logs (it's connecting to both postorius and hyperkitty via uwsgi), it appears when I'm only viewing Hyperkitty's pages, I'm getting these type of errors (some changes inserted to hide my server details):
2017/11/01 19:22:04 [error] 64082#0: *75 open() "/opt/mailman/postorius/ example_project/static/CACHE/js/4ce1260ef558.js" failed (2: No such file or directory), client: 10.10.44.29, server: blah.blah.blah, request: "GET /static/CACHE/js/4ce1260ef558.js HTTP/1.1", host: "blah.blah.blah", referrer: "https://blah.blah.blah/hyperkitty/hyperkitty/list/ mailinglist@domain.com/2017/10/"
I see here that you are running Postorius and Hyperkitty a bit differently that presented in our docs. Settings inside example_project for each repositories are just examples, we use it for testing, and may not work best in production.
We recommend that you instead use the mailman-suite1 to run Postorius & Hyperkitty using a single Django installation.
The process for doing so is documented here2.
So it appears Hyperkitty is attempting to load static files from postorius's side instead of it's own (I have postorius running under https://domain.tld and hyperkitty running under https://domain.tld/hyperkitty/ via nginx). I checked and confirmed the variables in settings.py:
STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/hyperkitty/static/' STATICFILES_DIRS = ('/opt/mailman/hyperkitty/example_project/static/')
And for good measure, here's the nginx config:
server { listen 80; server_name DOMAIN.TLD; #Redirect to SSL if ($scheme = http) { return 301 https://$server_name$request_uri; } }
server { listen 443 ssl http2 default_server; listen [::]:443 ssl http2 default_server; server_name DOMAIN.TLD;
ssl_certificate "/etc/pki/nginx/DOMAIN.TLD.crt"; ssl_certificate_key "/etc/pki/nginx/private/DOMAIN.TLD.key"; ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { include uwsgi_params; uwsgi_pass unix:/opt/mailman/postorius.sock; } location ~ /hyperkitty(?<path_info>/.*|$) { include uwsgi_params; uwsgi_pass unix:/opt/mailman/hyperkitty.sock; uwsgi_param PATH_INFO $path_info; uwsgi_param SCRIPT_NAME /hyperkitty; } #Make nginx aware of postorius static location /static/ { alias /opt/mailman/postorius/example_project/static/; } #for hyperkitty static location /hyperkitty/static/ { alias /opt/mailman/hyperkitty/example_project/static/; }
I believe static files are all supposed be rooted at /static
instead
of /hyperkitty/static
.
error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { }
}
Any thoughts would be appreciated, I'm getting stumped on this one.
I have never tried to run 'example_project' in production before, so I am not exactly sure about the reason.
This seems overly complicated and I strongly recommend that you run Postorius and Hyperkitty from a single installation, unless you have a very good use case to run them separately.
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
On Fri, Oct 27, 2017 at 11:01 AM, Simon Hanna <simon@hannaweb.eu> wrote:
On 10/27/2017 04:58 PM, Andrew Hodder wrote:
Sure thing:
Looks like your stylesheets aren't loaded.
if you are running in production (with DEBUG=False) django won't serve static files You need to configure your webserver to do that. You need to make sure to load all the static files using
python manage.py collectstatic
to gather everything and put them in one directory that can then be served by your webserver
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/
-- Abhilash Raj maxking@asynchronous.in