Skip to content
Closed

a #99

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![deploy](https://github.com/ciiiii/cloudflare-docker-proxy/actions/workflows/deploy.yaml/badge.svg)

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/ciiiii/cloudflare-docker-proxy)
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/will-jerry/cloudflare-docker-proxy)

> If you're looking for proxy for helm, maybe you can try [cloudflare-helm-proxy](https://github.com/ciiiii/cloudflare-helm-proxy).

Expand All @@ -12,7 +12,7 @@
2. modify the link of the above button to your fork url
3. click the button, you will be redirected to the deploy page

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/ciiiii/cloudflare-docker-proxy)
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/will-jerry/cloudflare-docker-proxy)

## Config tutorial

Expand Down
32 changes: 21 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@ addEventListener("fetch", (event) => {

const dockerHub = "https://registry-1.docker.io";

const routes = {
// production
"docker.libcuda.so": dockerHub,
"quay.libcuda.so": "https://quay.io",
"gcr.libcuda.so": "https://gcr.io",
"k8s-gcr.libcuda.so": "https://k8s.gcr.io",
"k8s.libcuda.so": "https://registry.k8s.io",
"ghcr.libcuda.so": "https://ghcr.io",
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io",
// const routes = {
// // production
// "docker.libcuda.so": dockerHub,
// "quay.libcuda.so": "https://quay.io",
// "gcr.libcuda.so": "https://gcr.io",
// "k8s-gcr.libcuda.so": "https://k8s.gcr.io",
// "k8s.libcuda.so": "https://registry.k8s.io",
// "ghcr.libcuda.so": "https://ghcr.io",
// "cloudsmith.libcuda.so": "https://docker.cloudsmith.io",

// // staging
// "docker-staging.libcuda.so": dockerHub,
// };

// staging
"docker-staging.libcuda.so": dockerHub,
const routes = {
"docker.hostscc.top": "https://registry-1.docker.io",
"quay.hostscc.top": "https://quay.io",
"gcr.hostscc.top": "https://gcr.io",
"k8s-gcr.hostscc.top": "https://k8s.gcr.io",
"k8s.hostscc.top": "https://registry.k8s.io",
"ghcr.hostscc.top": "https://ghcr.io",
"cloudsmith.hostscc.top": "https://docker.cloudsmith.io",
};

function routeByHosts(host) {
Expand Down
37 changes: 29 additions & 8 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,36 @@ local_protocol = "http"
MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io"

# [env.production]
# name = "cloudflare-docker-proxy"
# routes = [
# { pattern = "docker.libcuda.so", custom_domain = true },
# { pattern = "quey.libcuda.so", custom_domain = true },
# { pattern = "gcr.libcuda.so", custom_domain = true },
# { pattern = "k8s-gcr.libcuda.so", custom_domain = true },
# { pattern = "k8s.libcuda.so", custom_domain = true },
# { pattern = "ghcr.libcuda.so", custom_domain = true },
# { pattern = "cloudsmith.libcuda.so", custom_domain = true },
# ]

# [env.production.vars]
# MODE = "production"
# TARGET_UPSTREAM = ""

# [env.staging]
# name = "cloudflare-docker-proxy-staging"
# route = { pattern = "docker-staging.libcuda.so", custom_domain = true }

[env.production]
name = "cloudflare-docker-proxy"
routes = [
{ pattern = "docker.libcuda.so", custom_domain = true },
{ pattern = "quey.libcuda.so", custom_domain = true },
{ pattern = "gcr.libcuda.so", custom_domain = true },
{ pattern = "k8s-gcr.libcuda.so", custom_domain = true },
{ pattern = "k8s.libcuda.so", custom_domain = true },
{ pattern = "ghcr.libcuda.so", custom_domain = true },
{ pattern = "cloudsmith.libcuda.so", custom_domain = true },
{ pattern = "docker.hostscc.top", custom_domain = true },
{ pattern = "quay.hostscc.top", custom_domain = true },
{ pattern = "gcr.hostscc.top", custom_domain = true },
{ pattern = "k8s-gcr.hostscc.top", custom_domain = true },
{ pattern = "k8s.hostscc.top", custom_domain = true },
{ pattern = "ghcr.hostscc.top", custom_domain = true },
{ pattern = "cloudsmith.hostscc.top", custom_domain = true },
]

[env.production.vars]
Expand All @@ -28,7 +48,8 @@ TARGET_UPSTREAM = ""

[env.staging]
name = "cloudflare-docker-proxy-staging"
route = { pattern = "docker-staging.libcuda.so", custom_domain = true }
route = { pattern = "docker-staging.hostscc.top", custom_domain = true }


[env.staging.vars]
MODE = "staging"
Expand Down
Loading