mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
daf54a0fc0280a0df8f3701d01c368696d94be09
Email-to-RSS
Convert email newsletters into a private RSS feed using Cloudflare Workers + ForwardEmail.
This project is self-hosted, uses your own domain, and keeps your data in your own Cloudflare account.
Why this exists
Many newsletters only support email delivery. RSS readers offer a better reading experience, but getting email-only newsletters into RSS usually means relying on shared third-party infrastructure.
Email-to-RSS keeps the same workflow while avoiding shared domains and shared data stores.
Features
- One-click feed creation from an admin dashboard
- Unique newsletter addresses per feed (for example
apple.mountain.42@yourdomain.com) - ForwardEmail webhook ingestion with source-IP verification
- RSS generation on demand (
/rss/:feedId) - Cloudflare KV storage for feed config + email metadata/content
- Password-protected admin UI
- Fully self-hosted on your Cloudflare account
Architecture
- ForwardEmail forwards inbound messages to
https://yourdomain.com/api/inbound. - The Worker validates the request source against ForwardEmail MX IP ranges.
- The Worker parses and stores incoming content in KV.
https://yourdomain.com/rss/:feedIdrenders RSS from stored items./adminprovides feed management and email deletion.
Main routes:
src/routes/inbound.ts: webhook ingestionsrc/routes/rss.ts: RSS renderingsrc/routes/admin.ts: admin UI + feed CRUD
Requirements
- Node.js 20+
- A Cloudflare account
- A domain managed in Cloudflare DNS
- A ForwardEmail account
Setup
- Clone this repository.
- Authenticate Wrangler:
npx wrangler login - Run setup:
bash setup.sh
setup.sh will:
- install npm dependencies
- verify Cloudflare auth (
wrangler whoami) - create KV namespaces (
EMAIL_STORAGE+ preview) - set the
ADMIN_PASSWORDsecret inproduction - generate
wrangler.tomlfromwrangler-example.toml - stamp
compatibility_dateto the current date
- Configure ForwardEmail DNS records in Cloudflare:
| Type | Name | Content | Notes |
|---|---|---|---|
| MX | @ | mx1.forwardemail.net |
Priority 10, DNS only |
| MX | @ | mx2.forwardemail.net |
Priority 10, DNS only |
| TXT | @ | "forward-email=https://yourdomain.com/api/inbound" |
webhook target |
| TXT | @ | "v=spf1 include:spf.forwardemail.net -all" |
SPF |
-
Deploy:
npm run deploy -
Open
https://yourdomain.com/adminand sign in.
Development
npm install
npm run dev
npm test
npm run build
Configuration notes
wrangler-example.tomlis the template;wrangler.tomlis generated locally.- Keep
compatibility_datefresh when doing runtime upgrades. ADMIN_PASSWORDis a Cloudflare Worker secret, not a plain env var in config.
Security notes
- Inbound webhook access is IP-restricted to ForwardEmail MX sources.
- Admin auth is cookie-based (
HttpOnly,SameSite=Strict). - You should use a strong admin password and rotate periodically.
Upgrading dependencies
To refresh dependencies to latest:
npm outdated
npm install
npm test
npm run build
Then update compatibility_date and redeploy.
License
MIT
Description
Languages
TypeScript
91.8%
CSS
6.1%
Shell
1.8%
JavaScript
0.3%