mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat: store email attachments in R2 and expose as RSS enclosures
Attachments from incoming emails are uploaded to an optional Cloudflare R2
bucket and exposed as <enclosure> elements in RSS and <link rel="enclosure">
in Atom feeds, served at /files/{id}/{filename} with immutable caching.
R2 is opt-in: if ATTACHMENT_BUCKET is not bound the feature is a no-op.
Attachments are cleaned up from R2 on email/feed deletion and during
size-based feed trimming. Adds MockR2 to the test setup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,11 @@ kv_namespaces = [
|
||||
{ binding = "EMAIL_STORAGE", id = "REPLACE_WITH_YOUR_KV_NAMESPACE_ID", preview_id = "REPLACE_WITH_YOUR_PREVIEW_KV_NAMESPACE_ID" }
|
||||
]
|
||||
|
||||
# Optional: R2 bucket for storing email attachment enclosures
|
||||
# r2_buckets = [
|
||||
# { binding = "ATTACHMENT_BUCKET", bucket_name = "REPLACE_WITH_YOUR_BUCKET_NAME", preview_bucket_name = "REPLACE_WITH_YOUR_PREVIEW_BUCKET_NAME" }
|
||||
# ]
|
||||
|
||||
# Workers Observability (keeps config in sync with dashboard toggle)
|
||||
[observability.logs]
|
||||
enabled = true
|
||||
@@ -42,6 +47,11 @@ kv_namespaces = [
|
||||
{ binding = "EMAIL_STORAGE", id = "REPLACE_WITH_YOUR_KV_NAMESPACE_ID" }
|
||||
]
|
||||
|
||||
# Optional: R2 bucket for storing email attachment enclosures
|
||||
# r2_buckets = [
|
||||
# { binding = "ATTACHMENT_BUCKET", bucket_name = "REPLACE_WITH_YOUR_BUCKET_NAME" }
|
||||
# ]
|
||||
|
||||
routes = [
|
||||
{ pattern = "REPLACE_WITH_YOUR_DOMAIN", custom_domain = true },
|
||||
{ pattern = "www.REPLACE_WITH_YOUR_DOMAIN", custom_domain = true }
|
||||
|
||||
Reference in New Issue
Block a user