Skip to content
Closed

1 #97

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
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# cloudflare-docker-proxy

![deploy](https://github.com/ciiiii/cloudflare-docker-proxy/actions/workflows/deploy.yaml/badge.svg)
![deploy](https://github.com/YspCoder/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/YspCoder/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).
> If you're looking for proxy for helm, maybe you can try [cloudflare-helm-proxy](https://github.com/YspCoder/cloudflare-helm-proxy).

## Deploy

1. click the "Deploy With Workers" button
2. follow the instructions to fork and deploy
3. update routes as you requirement

[![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/YspCoder/cloudflare-docker-proxy)

## Routes configuration tutorial

Expand All @@ -30,11 +30,11 @@
- add more records and modify the config as you need
```javascript
const routes = {
"docker.libcuda.so": "https://registry-1.docker.io",
"quay.libcuda.so": "https://quay.io",
"gcr.libcuda.so": "https://k8s.gcr.io",
"k8s-gcr.libcuda.so": "https://k8s.gcr.io",
"ghcr.libcuda.so": "https://ghcr.io",
"docker.nvue.dev": "https://registry-1.docker.io",
"quay.nvue.dev": "https://quay.io",
"gcr.nvue.dev": "https://k8s.gcr.io",
"k8s-gcr.nvue.dev": "https://k8s.gcr.io",
"ghcr.nvue.dev": "https://ghcr.io",
};
```

18 changes: 9 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ 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",
"ecr.libcuda.so": "https://public.ecr.aws",
"docker.nvue.dev": dockerHub,
"quay.nvue.dev": "https://quay.io",
"gcr.nvue.dev": "https://gcr.io",
"k8s-gcr.nvue.dev": "https://k8s.gcr.io",
"k8s.nvue.dev": "https://registry.k8s.io",
"ghcr.nvue.dev": "https://ghcr.io",
"cloudsmith.nvue.dev": "https://docker.cloudsmith.io",
"ecr.nvue.dev": "https://public.ecr.aws",

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

function routeByHosts(host) {
Expand Down
16 changes: 8 additions & 8 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ TARGET_UPSTREAM = "https://registry-1.docker.io"
[env.production]
name = "cloudflare-docker-proxy"
# routes = [
# { pattern = "docker.libcuda.so", custom_domain = true },
# { pattern = "quay.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.nvue.dev", custom_domain = true },
# { pattern = "quay.nvue.dev", custom_domain = true },
# { pattern = "gcr.nvue.dev", custom_domain = true },
# { pattern = "k8s-gcr.nvue.dev", custom_domain = true },
# { pattern = "k8s.nvue.dev", custom_domain = true },
# { pattern = "ghcr.nvue.dev", custom_domain = true },
# { pattern = "cloudsmith.nvue.dev", custom_domain = true },
# ]

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

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

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