Fix staging configuration

This commit is contained in:
ciiiii
2024-06-14 02:31:02 +08:00
parent b7de5d1414
commit 5eaf7124a3
2 changed files with 14 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ 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",
@@ -13,6 +14,9 @@ const routes = {
"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,
};
function routeByHosts(host) {

View File

@@ -1,16 +1,14 @@
name = "cloudflare-docker-proxy"
workers_dev = true
main = "src/index.js"
compatibility_date = "2021-12-07"
compatibility_date = "2023-12-01"
[dev]
ip = "0.0.0.0"
port = 8787
local_protocol = "http"
[vars]
MODE = "production"
TARGET_UPSTREAM = ""
[env.dev.vars]
MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io"
[env.production]
name = "cloudflare-docker-proxy"
@@ -24,12 +22,14 @@ routes = [
{ 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.staging.vars]
[env.dev.vars]
MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io"
MODE = "staging"
TARGET_UPSTREAM = ""