Name each database target's archive for its webhook and target (closes #376)
check / check (push) Waiting to run

Each database target now has its own archive file,
archive-WEBHOOKNAME-TARGETNAME-TARGETID.db, instead of one
archive-WEBHOOKID.db per webhook. delivery.ArchiveFileName builds the
name: each name is lowercased, keeps ASCII letters and digits, turns
every other run of characters into one dash, and is cut to 40
characters.

Renaming a webhook or a target renames its archive files under the
archive writer's lock, before the new name is saved, and back again if
the save fails. Deleting a target evicts only that target's writer.
Archive files are never deleted, and nothing looks for files under the
old name.

Model: opus-5-5
This commit is contained in:
2026-10-02 05:10:15 +00:00
parent 7d360babed
commit d88948a1c3
21 changed files with 1277 additions and 663 deletions
+3 -3
View File
@@ -62,7 +62,7 @@ type HandlersParams struct {
Session *session.Session
Middleware *middleware.Middleware
Notifier delivery.Notifier
Evictor delivery.WebhookEvictor
Archives delivery.Archives
SSRFGuard *delivery.Guard
}
@@ -77,7 +77,7 @@ type Handlers struct {
session *session.Session
mw *middleware.Middleware
notifier delivery.Notifier
evictor delivery.WebhookEvictor
archives delivery.Archives
mtr *metrics.Set
templates map[string]*template.Template
@@ -128,7 +128,7 @@ func New(
s.session = params.Session
s.mw = params.Middleware
s.notifier = params.Notifier
s.evictor = params.Evictor
s.archives = params.Archives
s.mtr = metrics.Default()
s.ssrf = params.SSRFGuard