Closed Nutomic closed 6 years ago
It is due to our recent switch to helmet, which adds HSTS headers automatically by default. Doing it in PeerTube allows a less complex reverse-proxy configuration. Admittedly in Nginx it's simple to setup but other reverse proxies less so (looking at you, Traefik).
We should probably remove the line from the Nginx config.
This seems like a bad idea, because it prevents admins from changing the HSTS parameters. For example, I want to add my site to the HSTS preload list, but this is only possible if I can edit the header and add the preload
flag. As the website says, this should not be set by default.
Following their advice we shouldn't even include the line in the reverse-proxy config.
That seems fine to me, because the admin can easily change or remove it. But I don't think it's possible to change the header inside Peertube (or it would be very complicated).
Indeed. And it seems important to not even include it in the Nginx configuration, as this is something that should be tested first by the admin apparently.
We can leave it in, but just comment it out by default (and put a comment explaining it).
Done in https://github.com/Chocobozzz/PeerTube/commit/6328da8c017cf00d3c0ac8824ec5af128f6db42e :slightly_smiling_face:
See these SSL scan results: https://www.ssllabs.com/ssltest/analyze.html?d=peertube.video https://www.ssllabs.com/ssltest/analyze.html?d=peertube.mastodon.host&s=163.172.7.58
I had the same error on Peertube.social, but after commenting out the following line in the nginx config, I get a perfect SSL score:
https://www.ssllabs.com/ssltest/analyze.html?d=peertube.social
I have no idea where the duplicate header is coming from, as the Peertube repo and
/etc/nginx
only contain the header once (both in the nginx config). Peertube shouldn't send this header on it's own, as the site admin should be able to decide if HSTS is enabled, and for how long.