From 6af8859c70ce808860537c021e5e9b7b0c39caba Mon Sep 17 00:00:00 2001 From: Sulthan Zaki Date: Sun, 23 Aug 2026 00:10:49 +0700 Subject: [PATCH] Review fixes: compose duplicate depends_on, .env.example splice, restore COVER_DIR test (#171) --- .env.example | 6 +++--- backend/AGENTS.md | 9 +++++++++ backend/main_test.go | 7 +++++++ docker-compose.yml | 1 - 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 561dd9f..6b9c726 100644 --- a/.env.example +++ b/.env.example @@ -99,14 +99,14 @@ DISCORD_REDIRECT_URI= # request whose Host header isn't an IP or "localhost", which silently breaks # every kagane poll. Left unset here on purpose — a wrong default would poll a # stranger's address, and "no browser" is a safe, self-announcing state. +# BROWSER_WS_URL=ws://100.x.y.z:9222 +# # Discord webhook for owner notices (outbound alerting when a poll Lane # stalls). Unset means the whole path is off — a local stack needs no webhook, # exactly as the browser URL behaves. The address is a secret in the class of # TOKEN_KEY: never commit it, never paste it anywhere public. # DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... - -# Zone the backend stamps its log lines in. Cosmetic only. Nothing else in - +# # Zone the backend stamps its log lines in. Cosmetic only. Nothing else in # the service has a zone: bookmark timestamps are unix ms, and the two real # time columns are timestamptz. Defaults to Asia/Jakarta; set to UTC for the diff --git a/backend/AGENTS.md b/backend/AGENTS.md index 7501da1..247ee7e 100644 --- a/backend/AGENTS.md +++ b/backend/AGENTS.md @@ -159,6 +159,15 @@ failures. The flag decays and they probe again. - Browser Lanes wake Chrome only when 5+ Series are due or one has waited 15m, and cover work runs in the background so a slow CDN can't eat a Lane's gap. +### Owner notices — `internal/notify`, `latest.Fault`, `latest.Notifier`, `latest.FaultsFrom` + +The poller's outbound owner-notice path (issue #171): one condition today +(the stall), judged from the durable pass log alone so the poller and any +future reader of the same judgement cannot disagree. The webhook address is a +secret in the class of TOKEN_KEY — never logged, never rendered, never +carried in an error. The `owner_notices` suppression table (one row per +condition + site) is the only state; every threshold is derived, not stored. + ### Covers — `Store.OnSeriesCreated`, `latest.Acquirer`, `latest.CoverBytesFetcher`, `Store.SetSeriesCover` Acquired once when the first Bookmark of a Series is created, then served from diff --git a/backend/main_test.go b/backend/main_test.go index 82836d9..e07917f 100644 --- a/backend/main_test.go +++ b/backend/main_test.go @@ -21,6 +21,13 @@ func TestLoadLatestPollDefaults(t *testing.T) { } } +func TestLoadConfigReadsCoverDirectory(t *testing.T) { + t.Setenv("COVER_DIR", "/covers") + if got := loadConfig().CoverDir; got != "/covers" { + t.Fatalf("CoverDir = %q, want /covers", got) + } +} + func TestLoadConfigReadsDiscordWebhook(t *testing.T) { // The address is read, never defaulted: unset stays empty (the whole // path is off), set flows into the Config for the poller's notifier. diff --git a/docker-compose.yml b/docker-compose.yml index 438ad55..eb77921 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,7 +80,6 @@ services: # runs exactly as it does today. An env var not listed here never # reaches the container. DISCORD_WEBHOOK_URL: ${DISCORD_WEBHOOK_URL:-} - depends_on: depends_on: # The migration runner is the first thing the binary does, so a Postgres # that is still initialising means a crash-loop until it is not.