Compare commits

..
Author SHA1 Message Date
ksmithandClaude Sonnet 5 9d91da6fc6 Fix /health/ 400ing when hit directly over loopback (as upgrade.sh does)
scripts/upgrade.sh's health check connects straight to gunicorn's bind
address, bypassing the reverse proxy entirely, so the request's Host
header is "127.0.0.1:<port>" and it has no X-Forwarded-Proto header.
Against prod settings that's exactly a DisallowedHost (ALLOWED_HOSTS only
has the public domain) — which Django turns into a 400 — and would have
then hit a redirect-to-HTTPS loop from SECURE_SSL_REDIRECT right after,
since there's no TLS listener on that port to redirect to. Allow the
loopback addresses in ALLOWED_HOSTS (harmless: gunicorn's bind address is
never reachable from outside this host per docs/install.md) and exempt
/health/ from the HTTPS redirect specifically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 09:19:27 -06:00
ksmithandClaude Sonnet 5 c316f411f8 Make the active-tag sidebar highlight as visible as the active-feed one
.sidebar-tag-link.active only changed text color, which is easy to miss
next to .sidebar-feed-link.active's background pill + bold weight. Give
the tag link the same background-pill treatment (padding/margin offset
so the box doesn't shift layout when inactive).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 09:17:45 -06:00
2 changed files with 20 additions and 1 deletions

No files matched your search

+13
View File
@@ -3,6 +3,14 @@ from .base import env
DEBUG = False DEBUG = False
# Health checks (scripts/upgrade.sh, an external uptime monitor, ...) hit
# gunicorn directly over loopback, bypassing the reverse proxy entirely —
# that request's Host header is "127.0.0.1:<port>", not the public domain
# in ALLOWED_HOSTS, so without this Django 400s it. Harmless to always
# allow: gunicorn's bind address is never reachable from outside this host
# in the first place (see docs/install.md's "Reverse proxy" section).
ALLOWED_HOSTS = [*ALLOWED_HOSTS, "localhost", "127.0.0.1", "::1"] # noqa: F405
# A reverse proxy (nginx, Caddy, Traefik, Nginx Proxy Manager on another # A reverse proxy (nginx, Caddy, Traefik, Nginx Proxy Manager on another
# host, ...) is required in front of gunicorn in every deployment — see # host, ...) is required in front of gunicorn in every deployment — see
# docs/install.md — and it's always the one terminating TLS. This tells # docs/install.md — and it's always the one terminating TLS. This tells
@@ -10,6 +18,11 @@ DEBUG = False
# sets, and the redirect/cookie/HSTS settings below assume it's set. # sets, and the redirect/cookie/HSTS settings below assume it's set.
SECURE_SSL_REDIRECT = env.bool("SECURE_SSL_REDIRECT", default=True) SECURE_SSL_REDIRECT = env.bool("SECURE_SSL_REDIRECT", default=True)
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# /health/ is also exempted from the HTTPS redirect above: hit directly
# over loopback (see ALLOWED_HOSTS above) it has no X-Forwarded-Proto
# header to prove it's "secure", and there's no TLS listener on gunicorn's
# own port to redirect to anyway.
SECURE_REDIRECT_EXEMPT = [r"^health/$"]
# WhiteNoise serves /static/ directly from gunicorn instead of relying on # WhiteNoise serves /static/ directly from gunicorn instead of relying on
# the reverse proxy to alias the staticfiles directory on disk — the proxy # the reverse proxy to alias the staticfiles directory on disk — the proxy
+7 -1
View File
@@ -300,12 +300,18 @@ form p {
} }
.sidebar-tag-link { .sidebar-tag-link {
display: inline-block;
padding: 0.15rem 0.4rem;
margin: -0.15rem -0.4rem;
border-radius: 0.375rem;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
.sidebar-tag-link.active { .sidebar-tag-link.active {
color: var(--accent); background: var(--bg-row-selected);
color: var(--text);
font-weight: 600;
} }
.sidebar-item-list { .sidebar-item-list {