Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete elastic #75

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 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/sylarjiang/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/sylarjiang/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/sylarjiang/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/sylarjiang/cloudflare-docker-proxy)

## Routes configuration tutorial

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

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

function routeByHosts(host) {
Expand Down
32 changes: 17 additions & 15 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ 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 },
# ]
routes = [
{ pattern = "docker.hw2024.top", custom_domain = true },
{ pattern = "quay.hw2024.top", custom_domain = true },
{ pattern = "gcr.hw2024.top", custom_domain = true },
{ pattern = "k8s-gcr.hw2024.top", custom_domain = true },
{ pattern = "k8s.hw2024.top", custom_domain = true },
{ pattern = "ghcr.hw2024.top", custom_domain = true },
{ pattern = "cloudsmith.hw2024.top", custom_domain = true },
{ pattern = "elastic.hw2024.top", custom_domain = true },
{ pattern = "ecr.hw2024.top", 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.staging]
# name = "cloudflare-docker-proxy-staging"
# route = { pattern = "docker-staging.hw2024.top", custom_domain = true }

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