Skip to content

starudream/proxy-worker

Repository files navigation

Proxy Worker

English | 简体中文

A Cloudflare Workers proxy service for GitHub file downloads and Docker registry mirror traffic.

Endpoints

Route URL
Global Cloudflare https://proxy.starudream.cn
Tencent Cloud EO for mainland China https://proxy.52xckl.cn

The examples below use https://proxy.starudream.cn by default. For mainland China networks, replace the domain with https://proxy.52xckl.cn.

GitHub Proxy

The GitHub proxy downloads allowlisted GitHub release, archive, and raw files.

Full URL

Append the GitHub URL to the proxy endpoint:

curl -L https://proxy.starudream.cn/github/https://github.com/k3s-io/k3s/releases/download/v1.33.1%2Bk3s1/k3s

The /github/ prefix can also be omitted:

curl -L https://proxy.starudream.cn/https://github.com/k3s-io/k3s/releases/download/v1.33.1%2Bk3s1/k3s

Short Path

The proxy supports owner/repo/releases/..., owner/repo/archive/..., and owner/repo/raw/... paths:

curl -L https://proxy.starudream.cn/k3s-io/k3s/raw/refs/tags/v1.33.1%2Bk3s1/install.sh
curl -L https://proxy.starudream.cn/fatedier/frp/releases/download/v0.62.1/frp_0.62.1_linux_amd64.tar.gz

The current GitHub allowlist is maintained in src/settings.json.

Docker Proxy

The Docker proxy can be used as a registry mirror. Put the image path after the proxy domain:

docker pull proxy.starudream.cn/docker.io/library/hello-world:latest

Mainland China route:

docker pull proxy.52xckl.cn/docker.io/library/hello-world:latest

Docker Hub Defaults

docker.io is the default registry, and library is the default namespace. These three forms are equivalent:

docker pull proxy.starudream.cn/docker.io/library/hello-world:latest
docker pull proxy.starudream.cn/library/hello-world:latest
docker pull proxy.starudream.cn/hello-world:latest

All of them proxy to:

docker.io/library/hello-world:latest

Other Registries

Put the registry explicitly at the beginning of the image path:

docker pull proxy.starudream.cn/ghcr.io/home-assistant/home-assistant:latest
docker pull proxy.starudream.cn/registry.k8s.io/pause:3.10
docker pull proxy.starudream.cn/mcr.microsoft.com/dotnet/runtime:9.0
docker pull proxy.starudream.cn/quay.io/prometheus/prometheus:latest

Currently supported registries:

Registry Allowlist Required
docker.io Yes
gcr.io Yes
ghcr.io Yes
quay.io Yes
registry.k8s.io No
mcr.microsoft.com No
docker.elastic.co No

Registries that require an allowlist only proxy image repositories configured in src/settings.json.

Configuration

Main configuration lives in src/settings.json:

  • github.owners: GitHub owners allowed by the proxy.
  • github.repositories: GitHub repositories allowed by the proxy.
  • docker.registries: Docker registry upstreams and allowlist policies.
  • docker.repositories: Docker image repositories that require allowlisting.

Sort and deduplicate the configuration:

pnpm sort:settings

Sorting rules:

  • Arrays are deduplicated.
  • Rules containing * are placed first.
  • Other entries are sorted alphabetically.

Deployment

This project deploys to Cloudflare Workers with Wrangler:

pnpm deploy

GitHub Actions runs the deployment workflow after pushes to the master branch.

About

Cloudflare Workers proxy for allowlisted GitHub release/archive/raw downloads and Docker registry mirror traffic.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors