2 Commits

Author SHA1 Message Date
ciiiii
b1b48aa7d9 Fix header 2024-06-14 02:47:02 +08:00
ciiiii
861a6a8bb1 Return regsitry version header 2024-06-14 02:44:35 +08:00
2 changed files with 11 additions and 10 deletions

View File

@@ -68,6 +68,7 @@ async function handleRequest(request) {
`Bearer realm="https://${url.hostname}/v2/auth",service="cloudflare-docker-proxy"`
);
}
headers.set("Docker-Distribution-API-Version", "registry/2.0");
return new Response(JSON.stringify({ message: "UNAUTHORIZED" }), {
status: 401,
headers: headers,

View File

@@ -12,15 +12,15 @@ 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.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"
@@ -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.libcuda.so", custom_domain = true }
[env.staging.vars]
MODE = "staging"