DIYgod mirror
Go to file
DIYgod 1131350b5f
feat: deploy RSSHub to Cloudflare Workers (#20804)
* feat: deploy RSSHub to Cloudflare Workers

- Create Worker entry point (lib/worker.ts) with polyfills
- Implement Worker-specific app configuration (lib/app.worker.tsx)
- Add automatic .worker.ts resolution plugin for cleaner config
- Simplify build configuration with only 3 essential shims
- Enable static asset serving via Cloudflare Static Assets feature
- Support dynamic route loading with proper module aliasing

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* feat(worker): add puppeteer and request-rewriter support

- Add @cloudflare/puppeteer for Browser Rendering API support
- Create puppeteer.worker.ts with Cloudflare Browser binding
- Add request-rewriter Worker version with static browser headers
- Add vm module shim to node-module.ts for JSDOM compatibility
- Configure __dirname/__filename in tsdown for CommonJS compat
- Update wrangler.toml with BROWSER binding configuration
- Dynamically extract namespaces from foloAnalysisTop100 for routes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(cache): restore synchronous initialization for tests

The async initialization caused cache tests to fail because the cache
module wasn't ready when tests ran. Restored synchronous imports while
keeping Worker-specific no-op behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(worker): add automated Worker integration tests

- Add miniflare for Worker environment simulation
- Create lib/worker.worker.test.ts with integration tests
- Test basic routes (/test/1, /, unknown routes)
- Test RSS feed routes (hackernews, v2ex)
- Test error handling for puppeteer routes without BROWSER binding
- Add worker-test npm script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(worker): use test routes for Worker integration tests

- Replace third-party routes (hackernews, v2ex, weibo) with /test/* routes
- Remove miniflare dependency (wrangler includes it internally)
- Simplify test setup using wrangler's unstable_dev API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(test): make header-generator test less flaky

The header-generator library may return different platform values due to
internal randomness. Update test to check for valid format instead of
exact value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(test): exclude worker tests from vitest coverage run

Worker tests require the dist-worker bundle to be built first,
which is not part of the regular CI test workflow. These tests
should be run separately using 'pnpm worker-test'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(worker): add automated Worker integration tests

- Add worker-build step to CI workflow before running tests
- Revert exclusion of worker tests from vitest coverage run
- Worker tests now run as part of the regular test suite

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(worker): fix routes.js alias path in worker build config

Change alias key from absolute path to relative import path to match
how it's imported in lib/registry.ts. This fixes the worker build
failing with "Could not resolve '../assets/build/routes.js'" error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* ci: trigger CI re-run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): build worker routes before worker-build

The worker build requires routes-worker.js which is generated by
running build:routes with WORKER_BUILD=true. This was missing in CI,
causing the worker build to fail with "Could not resolve routes.js".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(test): increase timeout for Worker integration tests

Worker tests need more time in CI environments. Increase individual
test timeouts from default 10s to 30s for each test case.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-04 09:22:05 +08:00
.devcontainer chore: update prettier extension identifier 2025-12-02 11:06:32 +08:00
.github feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
.husky chore(deps-dev): bump husky from 9.0.11 to 9.1.0 (#16200) 2024-07-18 20:04:24 +08:00
.idx chore: update prettier extension identifier 2025-12-02 11:06:32 +08:00
assets
eslint-plugins feat: more nsfw flag 2025-09-30 12:30:30 +08:00
lib feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
logs
patches fix(deps): patch rss-parser to support gzip (#20619) 2025-12-03 04:11:56 +08:00
public chore: try root public for vercel 2025-12-07 00:15:41 +08:00
scripts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
.codecov.yml
.dockerignore chore(docker): update .dockerignore to include files added in #20597 2025-12-29 04:49:17 +08:00
.editorconfig
.envrc fix(.envrc): add --no-pure-eval for devenv flake compatibility (#20692) 2025-12-19 00:00:46 +08:00
.gitignore feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
.npmrc
.prettierignore chore: fix prettier config 2025-11-27 14:32:29 +08:00
.prettierrc
.puppeteerrc.cjs refactor: fix lint issue (#18963) 2025-04-29 03:00:16 +08:00
AGENTS.md docs: add review guidelines for codex 2025-12-29 17:42:03 +08:00
CODE_OF_CONDUCT.md chore: fix prettier config 2025-11-27 14:32:29 +08:00
CONTRIBUTING.md
Dockerfile fix(deps): patch rss-parser to support gzip (#20619) 2025-12-03 04:11:56 +08:00
LICENSE docs: update license file 2025-12-28 18:42:39 +08:00
README.md docs: update license 2025-12-28 18:39:22 +08:00
SECURITY.md
app.json
babel.config.js
devenv.nix chore: add Nix flake and NixOS module support (#20597) 2025-12-09 19:43:06 +08:00
docker-compose.yml fix(route/picnob): use puppeteer-real-browser to pass cf check (#20478) 2025-11-14 15:32:09 +08:00
eslint.config.mjs style: replace unicorn/no-for-loop w/ typescript/prefer-for-of (#20798) 2026-01-02 09:42:24 +08:00
flake.lock chore: add Nix flake and NixOS module support (#20597) 2025-12-09 19:43:06 +08:00
flake.nix refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
fly.toml chore: update fly.toml 2025-06-06 21:38:15 +08:00
package.json feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
pnpm-lock.yaml feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
tailwind.config.js
tsconfig.json chore: add Vercel build configuration 2025-08-10 18:34:16 +08:00
tsdown-lib.config.ts refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
tsdown-vercel.config.ts refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
tsdown-worker.config.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
tsdown.config.ts refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
vercel.json chore: fix art template on vercel (#20647) 2025-12-08 00:21:14 +08:00
vitest.config.ts refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
wrangler.toml feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00

README.md

RSSHub

RSSHub

🧡 Everything is RSSible

docker publish npm publish test Test coverage Visitors

Telegram group Telegram channel X (Twitter)

Introduction

RSSHub is the world's largest RSS network, consisting of over 5,000 global instances.

RSSHub delivers millions of contents aggregated from all kinds of sources, our vibrant open source community is ensuring the deliver of RSSHub's new routes, new features and bug fixes.

Documentation | Telegram Group | Telegram Channel | X (Twitter)

  • RSSHub Radar | A browser extension that can help you quickly discover and subscribe to the RSS and RSSHub of current websites.
  • RSSBud | RSSHub Radar for iOS platform, designed specifically for mobile ecosystem optimization.
  • RSSAid | RSSHub Radar for Android platform built with Flutter.
  • DocSearch | Link RSSHub DocSearch into Raycast

Contribute

We welcome all pull requests. Suggestions and feedback are also welcomed here.

Refer to Quick Start

Deployment

Refer to Deployment

Special Thanks

Logo designer sheldonrrr

              

Author

RSSHub © DIYgod, Released under the AGPL-3.0 License.
Authored and maintained by DIYgod with help from contributors (list).

Blog @DIYgod · GitHub @DIYgod · X (Twitter) @DIYgod · Telegram Channel @awesomeDIYgod