realchendahuang/sub-store-cloudflare
realchendahuang/sub-store-cloudflare has 317 GitHub stars and 100 forks. Star changes are not measured yet. Last checked 2026-11-18 04:42 UTC. Last push 2026-10-31.
Measured star growth
- in 24h
- Update delayed
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
部署在 Cloudflare Workers 上的节点处理、订阅聚合与分流规则模板 / Subscription manager on Cloudflare Workers
Developer ToolsREADME.en.md
OriginalSub-Store Cloudflare
Run subscription sources, self-hosted nodes, processing actions, and routing templates in your own Cloudflare Worker, then give each client one final subscription URL.
The app uses Workers Static Assets + Worker API + D1 + Worker Secrets and is designed around Workers Free limits. It does not require a separate server, KV, R2, Durable Objects, Queues, or Cron.
Chinese is the primary documentation language: README.md.
Fastest install: three steps
1. Prepare two different random tokens
Use a password manager, or run this cross-platform Node.js command:
node --input-type=module -e "import{randomBytes as r}from'node:crypto';console.log(r(32).toString('base64url'));console.log(r(32).toString('base64url'))"
Use the first line for SUB_STORE_ADMIN_TOKEN and the second for SUB_STORE_PUBLIC_DOWNLOAD_TOKEN. Never deploy fixed values copied from documentation or screenshots.
2. Click Deploy to Cloudflare
Cloudflare imports a repository copy into your GitHub/GitLab account, provisions the Worker and D1 database, asks for the two required secrets, and runs pnpm run build followed by pnpm run deploy.
Both secret fields must contain the different random values you generated.
3. Open the admin UI
Open the Worker URL returned by Cloudflare and append:
/#token=<SUB_STORE_ADMIN_TOKEN>
The first-run screen guides you through Source → default Daily collection → client download link.
See the Chinese five-minute quick start for the complete walkthrough.
Choose an install path
| Need | Recommended path | Entry point |
|---|---|---|
| Fastest empty deployment, configure in the browser | Deploy to Cloudflare | Button above |
| Guided terminal deployment | Interactive CLI | pnpm run install:cloudflare |
| Empty CLI deployment, configure in the browser | CLI quick mode | pnpm run install:quick |
| Import sources through Codex or Claude Code | Agent install | Install prompt |
| Full control over D1, secrets, and domains | Manual Wrangler | Deployment guide |
Interactive CLI
Requires Git, Node.js 22+, and Corepack:
git clone https://github.com/realchendahuang/sub-store-cloudflare.git
cd sub-store-cloudflare
corepack enable
pnpm run install:cloudflare
The installer can collect deployment names, domains, and optional remote subscription URLs. It then installs dependencies, checks Cloudflare login, creates or reuses D1, generates tokens, migrates, deploys, seeds, verifies, and prints ready-to-copy URLs.
For an empty web-configured deployment:
pnpm run install:quick
Generate both deployment tokens with:
pnpm run tokens:generate
Non-interactive Agent runs without config/agent-setup.local.json stop before deployment instead of importing example subscription URLs.
First five minutes after deployment
- Add a remote subscription or local node text on the Subscriptions page.
- Review the pre-created
DailyCollection; create another only when needed.acl4ssr-mihomois the recommended template. - Start with cleanup, endpoint dedupe, and name sorting filters.
- Copy the Mihomo, sing-box, Surge, or other link from the Collection card.
- Export a backup from Settings and store both tokens safely.
Highlights
- Remote sources, local nodes, collections, filters, and routing templates.
- Build-time JavaScript Filter / Operator support without runtime
eval(). - JSON/JSON5, Mihomo YAML, URI, and common Surge/Loon/Quantumult X input.
- Mihomo, Stash, Surge, Surge Mac, Surfboard, Loon, Egern, Shadowrocket, Quantumult X, sing-box, v2ray, URI, and JSON output.
- One-shot proxy/subscription and rule conversion tools.
- Scoped expiring download grants and a bounded 50-entry recycle bin.
- Safe subscription metadata propagation, optional Cache API caching, backup/restore, and node location/ASN lookup.
See the upstream compatibility matrix for tested support and explicit exclusions.
Upgrades
A Deploy Button install creates a repository copy in your account; upstream releases are not merged automatically. Do not create a second Worker and D1 database as the default upgrade method.
See docs/upgrading.md for repository sync, D1 migrations, backups, and rollback.
Documentation
- Five-minute quick start
- Deployment
- Upgrading
- AI Agent install
- JavaScript Filter / Operator
- Compatibility matrix
- Troubleshooting
- Architecture
- All docs
Local development
corepack enable
pnpm run setup
cp cloudflare/.dev.vars.example cloudflare/.dev.vars
pnpm run build:frontend
pnpm run dev
Open http://localhost:8787/#token=dev-admin-token.
Never commit subscription URLs, node URIs, tokens, private D1 IDs, or generated seed SQL. See SECURITY.md, LICENSE, and NOTICE.