rproxy: a page of its own for a refused visitor
check / check (push) Failing after 1m48s

A deny of 403 from waf is answered with refused.html, a deny of 429
with ratelimited.html, each as text/html with waf's other headers kept.
Both pages are made once at start and held in memory. With
SWW_RPROXY_CONTACT_EMAIL set, their "contact the site's operator" is a
mailto link to it; the value is taken as given.
This commit is contained in:
sneak committed 2026-11-19 21:12:31 -08:00
1 parent 5dfa47c97b
commit b157359910
8 files changed
+111 -3

No files matched your search

+4
View File
@@ -46,6 +46,9 @@ type RProxy struct {
// (SWW_RPROXY_MAX_RESPONSE_TIME_MS).
MaxRequestTime time.Duration
MaxResponseTime time.Duration
// ContactEmail is the address the pages a refused visitor gets link to,
// or "" for no link (SWW_RPROXY_CONTACT_EMAIL). It is taken as given.
ContactEmail string
// settings are the values read, as given or by default, for the log line
// at start.
@@ -108,6 +111,7 @@ func RProxyFromEnvironment(v *viper.Viper) (*RProxy, error) {
"SWW_RPROXY_MAX_RESPONSE_TIME_MS",
"1800000",
),
ContactEmail: env.value("SWW_RPROXY_CONTACT_EMAIL", ""),
}
if env.err != nil {