diff --git a/CHANGELOG.md b/CHANGELOG.md index 32115f2..25188cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version ## [1.2.4] - 2026-08-12 -Level-2 rate-limit semantics inverted after 1.2.3, plus a small DNS field -height fix. Upgrading is a tag bump; no migration. +Level-2 rate-limit semantics inverted after 1.2.3, with clearer L1 display and +status badges. Upgrading is a tag bump; no migration. ### Changed @@ -20,6 +20,10 @@ height fix. Upgrading is a tag bump; no migration. level-1 backstop on domain/application forms and Settings, rejects maxima above level 1, and requires an application override to exceed the domain maximum. Operator guide and architecture updated. +- panel: level-1 backstop is shown as a dedicated line (`N messages / Ws`) and + in message-limit labels; Settings uses a code-row for the L1 value. Domain + and application rate-limit status uses the shared `st` badge (`active` / + `inactive — level 1 only`). Trusted-IP override copy is a single paragraph. ### Fixed diff --git a/internal/web/view/templates/domain_detail.html b/internal/web/view/templates/domain_detail.html index ed3af2e..9e6e6ab 100644 --- a/internal/web/view/templates/domain_detail.html +++ b/internal/web/view/templates/domain_detail.html @@ -316,7 +316,7 @@ .panel-toggle in panel.css. -->
- +
@@ -344,21 +344,21 @@
-

Optional trusted-IP override

-

Listed client IPs get a higher ceiling than the - domain limit (still capped by level 1: - {{$.L1Messages}} / {{$.L1Window}}s — - Settings). - {{if $.DomainHasRL}}Domain ceiling: {{$.DomainRLMaxNum}}.{{else}}No domain ceiling (level 1 only for other IPs).{{end}}

+

Optional trusted-IP override + {{if .HasLimit}}active{{else}}inactive{{end}}

+

These IPs get a higher ceiling than the domain + (≤ level 1) and skip the domain check; everyone else uses + {{if $.DomainHasRL}}the domain ceiling ({{$.DomainRLMaxNum}}){{else}}level 1 only{{end}}.

+

Level 1 backstop: + {{$.L1Messages}} messages / + {{$.L1Window}}s + — Settings.

-

Only these IPs use the application ceiling and - skip the domain limit. Other IPs stay under the domain (or - level 1).

- +
@@ -420,17 +420,19 @@
-

Optional level-2 sending rate limit

-

Applies to every client IP on this domain. Status: - {{if .DomainHasRL}}active{{else}}inactive (level 1 only){{end}}. - Level 1 backstop: {{.L1Messages}} messages / {{.L1Window}}s - (Settings). Leave the message limit empty to - use level 1 only.

+

Optional level-2 sending rate limit + {{if .DomainHasRL}}active{{else}}inactive — level 1 only{{end}}

+

Applies to every client IP on this domain. Leave the + message limit empty to use level 1 only.

+

Level 1 backstop (from .env): + {{.L1Messages}} messages / + {{.L1Window}}s + — see Settings.

- +
diff --git a/internal/web/view/templates/settings.html b/internal/web/view/templates/settings.html index 7769665..27630ec 100644 --- a/internal/web/view/templates/settings.html +++ b/internal/web/view/templates/settings.html @@ -110,9 +110,9 @@ this one stays signed in.

each domain's page.

-

{{.L1Messages}} messages per {{.L1Window}} - seconds (RATE_LIMIT_MESSAGES_PER_IP / - RATE_LIMIT_WINDOW_SECONDS). Hard ceiling for every connecting IP; +

{{.L1Messages}} messages / {{.L1Window}} seconds

+

RATE_LIMIT_MESSAGES_PER_IP / + RATE_LIMIT_WINDOW_SECONDS. Hard ceiling for every connecting IP; the panel cannot raise a domain or application limit above this.

diff --git a/internal/web/view/templates_test.go b/internal/web/view/templates_test.go index 4a712a7..781c509 100644 --- a/internal/web/view/templates_test.go +++ b/internal/web/view/templates_test.go @@ -244,8 +244,11 @@ func TestDomainDetailPageHasPairedCards(t *testing.T) { if strings.Contains(src, `id="d_ips"`) { t.Error("domain rate limit must not ask for client IPs") } - if !strings.Contains(src, "level 1") { - t.Error("domain rate limit should mention the level-1 backstop") + if !strings.Contains(src, "{{.L1Messages}}") && !strings.Contains(src, "{{$.L1Messages}}") { + t.Error("domain rate limit should show the L1 message count") + } + if !strings.Contains(src, "Level 1 backstop") { + t.Error("domain rate limit should show a Level 1 backstop line") } if !strings.Contains(src, "Trusted client IPs") { t.Error("application override should ask for trusted client IPs") @@ -268,6 +271,7 @@ func TestSettingsPageDocumentsRateLimits(t *testing.T) { "RATE_LIMIT_MESSAGES_PER_IP", "Level 2 — domain", "trusted IPs", + "{{.L1Messages}} messages / {{.L1Window}} seconds", } { if !strings.Contains(src, want) { t.Errorf("settings rate limits card missing %q", want)