Hyperkitty Missing Theme/Style Sheets?
I have an odd one, my Hyperkitty is functionally working fine (archived several lists without issue, can login/out), however I must have done something wrong during it's setup as it's layout is completely broken (and it keeps throwing Example.com up in the top-left corner).
See attached.
I'd run into a similar issue with Postorious when I first set it up, but I can't recall what fixed it. Any ideas to what needs correcting? Thanks.
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
On Thu, Oct 26, 2017, at 11:23 AM, Andrew Hodder wrote:
I have an odd one, my Hyperkitty is functionally working fine (archived several lists without issue, can login/out), however I must have done something wrong during it's setup as it's layout is completely broken (and it keeps throwing Example.com up in the top-left corner).
You need to change SITE_ID in your Django's configuration to point to
your domain name you want to be show there. Default is set to
example.com
which corresponds to SITE_ID=1 in the Django's
configuraiton.
How to find the SITE_ID of your domain?
This is rather no-so-nice right now, you will basically have to go to
the admin console (/admin/) and login as admin. Then you visit
/admin/django_mailman3/maildomain/
and you should see your domain
there. Clicking on it will how your it's id in URL bar, like
/admin/django_mailman3/maildomain/2 or something.
I understand this is rather difficult thing to do, there is an issue open to make this information visible in the UI. Ideally, SITE_ID is sequential, so if you have only one domain, it is most probably 2.
See attached.
I'd run into a similar issue with Postorious when I first set it up, but I can't recall what fixed it. Any ideas to what needs correcting? Thanks.
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Abhilash Raj maxking@asynchronous.in
On 10/26/2017 11:51 PM, Abhilash Raj wrote:
On Thu, Oct 26, 2017, at 11:23 AM, Andrew Hodder wrote:
I have an odd one, my Hyperkitty is functionally working fine (archived several lists without issue, can login/out), however I must have done something wrong during it's setup as it's layout is completely broken (and it keeps throwing Example.com up in the top-left corner). You need to change SITE_ID in your Django's configuration to point to your domain name you want to be show there. Default is set to
example.com
which corresponds to SITE_ID=1 in the Django's configuraiton.How to find the SITE_ID of your domain?
This is rather no-so-nice right now, you will basically have to go to the admin console (/admin/) and login as admin. Then you visit
/admin/django_mailman3/maildomain/
and you should see your domain there. Clicking on it will how your it's id in URL bar, like /admin/django_mailman3/maildomain/2 or something.I understand this is rather difficult thing to do, there is an issue open to make this information visible in the UI. Ideally, SITE_ID is sequential, so if you have only one domain, it is most probably 2. You shouldn't get it from maildomain but the real site instead which is under the sites entry /admin/sites/site/
Also the default is actually 1 and not 2 Django automatically creates a site with id 1 if the sites framework is activated. Only if you delete the existing entry and add another, you will get an id of 2. Just editing will leave you with 1.
as mentioned in the issue on gitlab, I think we should just drop the SITE_ID or maybe only enable it for DEBUG==True
On Fri, Oct 27, 2017, at 02:39 AM, Simon Hanna wrote:
On 10/26/2017 11:51 PM, Abhilash Raj wrote:
On Thu, Oct 26, 2017, at 11:23 AM, Andrew Hodder wrote:
I have an odd one, my Hyperkitty is functionally working fine (archived several lists without issue, can login/out), however I must have done something wrong during it's setup as it's layout is completely broken (and it keeps throwing Example.com up in the top-left corner). You need to change SITE_ID in your Django's configuration to point to your domain name you want to be show there. Default is set to
example.com
which corresponds to SITE_ID=1 in the Django's configuraiton.How to find the SITE_ID of your domain?
This is rather no-so-nice right now, you will basically have to go to the admin console (/admin/) and login as admin. Then you visit
/admin/django_mailman3/maildomain/
and you should see your domain there. Clicking on it will how your it's id in URL bar, like /admin/django_mailman3/maildomain/2 or something.I understand this is rather difficult thing to do, there is an issue open to make this information visible in the UI. Ideally, SITE_ID is sequential, so if you have only one domain, it is most probably 2. You shouldn't get it from maildomain but the real site instead which is under the sites entry /admin/sites/site/
Thank you for this correction, this is probably more accurate data. But since domains are tied to sites internally anyway, they both will probably have the same values.
Also the default is actually 1 and not 2
Well, I didn't mean the default value. I meant that if example.com exists in the database, the next domain you create gets id sequentially, which would be 2 in this case. It is obviously not the best way to find out ID.
Django automatically creates a site with id 1 if the sites framework is activated. Only if you delete the existing entry and add another, you will get an id of 2.
Django automatically creates 'example.com' site with ID 1, that's true. There is no way to specify a default site at the startup time, to something other than 'example.com'. Anything you create after gets next sequential id.
Either way, that is Django's internal semantics and I only mentioned as a stupid shortcut ;-)
Just editing will leave you with 1.
as mentioned in the issue on gitlab, I think we should just drop the SITE_ID or maybe only enable it for DEBUG==True
Yeah, I agree it would make sense to not set a SITE_ID by default, that removes this extra step of finding and setting SITE_ID.
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Abhilash Raj maxking@asynchronous.in
Oh, the SITE_ID was definitely corrected before this, it doesn't show it anywhere else in Hyperkitty, hence why I'm assuming it's connected to the theme itself being all messed up. Nor does it display on every page or every time.
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
On Thu, Oct 26, 2017 at 5:51 PM, Abhilash Raj <maxking@asynchronous.in> wrote:
On Thu, Oct 26, 2017, at 11:23 AM, Andrew Hodder wrote:
I have an odd one, my Hyperkitty is functionally working fine (archived several lists without issue, can login/out), however I must have done something wrong during it's setup as it's layout is completely broken (and it keeps throwing Example.com up in the top-left corner).
You need to change SITE_ID in your Django's configuration to point to your domain name you want to be show there. Default is set to
example.com
which corresponds to SITE_ID=1 in the Django's configuraiton.How to find the SITE_ID of your domain?
This is rather no-so-nice right now, you will basically have to go to the admin console (/admin/) and login as admin. Then you visit
/admin/django_mailman3/maildomain/
and you should see your domain there. Clicking on it will how your it's id in URL bar, like /admin/django_mailman3/maildomain/2 or something.I understand this is rather difficult thing to do, there is an issue open to make this information visible in the UI. Ideally, SITE_ID is sequential, so if you have only one domain, it is most probably 2.
See attached.
I'd run into a similar issue with Postorious when I first set it up, but I can't recall what fixed it. Any ideas to what needs correcting? Thanks.
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Abhilash Raj maxking@asynchronous.in
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Oh, the SITE_ID was definitely corrected before this, it doesn't show it anywhere else in Hyperkitty, hence why I'm assuming it's connected to the theme itself being all messed up. Nor does it display on every page or every time. See attached. Attachments are stripped, could you open an issue on gitlab or use imgur or something?
Sure thing:
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 10:38 AM, Simon Hanna <simon@hannaweb.eu> wrote:
Oh, the SITE_ID was definitely corrected before this, it doesn't show it
anywhere else in Hyperkitty, hence why I'm assuming it's connected to the theme itself being all messed up. Nor does it display on every page or every time. See attached.
Attachments are stripped, could you open an issue on gitlab or use imgur or something?
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
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
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/"
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/;
}
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.
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/
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
participants (3)
-
Abhilash Raj
-
Andrew Hodder
-
Simon Hanna