diff options
| author | Dennis Fink | 2026-10-31 17:42:00 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-31 17:42:00 +0100 |
| commit | 6924ad7e52033365c55d5afacdd916c502cc80cb (patch) | |
| tree | 8a52b8e8fbae7a6bcc85d250cac2436a2c42e748 /contrib | |
| parent | 3494eab1208dc18478485e02c61e292556502fa6 (diff) | |
| download | webmentions-ssg-6924ad7e52033365c55d5afacdd916c502cc80cb.tar.gz webmentions-ssg-6924ad7e52033365c55d5afacdd916c502cc80cb.zip | |
feat(receiver): add resource limits and retention
Bound incoming request and URL sizes so untrusted Webmention submissions
cannot consume unbounded application or database resources.
Purge old failed and deleted received Webmentions on a schedule, and use
portable SHA-256 URL fingerprints to preserve uniqueness for long URLs.
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/webmentions-ssg.example.cfg | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/webmentions-ssg.example.cfg b/contrib/webmentions-ssg.example.cfg index 2b7b115..45ae297 100644 --- a/contrib/webmentions-ssg.example.cfg +++ b/contrib/webmentions-ssg.example.cfg @@ -48,6 +48,19 @@ LOGFILE_BACKUP_COUNT = 10 # Webmention. Include each hostname you serve; wildcards are not supported. ALLOWED_HOSTNAMES = {"example.com", "www.example.com"} +# Maximum size of an incoming HTTP request body, including form encoding. +# This global Flask limit also applies to login and administration routes. +MAX_CONTENT_LENGTH = 64 * 1024 +# Independent UTF-8 byte limit for each URL submitted to /endpoint. +# Increase cautiously: a longer URL consumes additional storage and network IO. +MAX_WEBMENTION_URL_BYTES = 8192 +# Delete failed/deleted received Webmentions this many days after their most +# recent update; verified, pending, and outgoing records are never purged. +# Deleted status pages return 404; the same pair can be resubmitted afterward. +RECEIVED_RETENTION_DAYS = 30 +# Daily at 03:00 UTC (Huey's default timezone). +RECEIVED_RETENTION_SCHEDULE = "0 3 * * *" + # Defense in depth: restrict the Huey worker service account with outbound # firewall/network-policy rules that block loopback, RFC1918, link-local, ULA, # and cloud metadata ranges, including IPv6. The application also pins |
