8 Commits

Author SHA1 Message Date
c3166167eb merge upstream 2025-08-07 10:04:53 +08:00
Yisheng Cai
c595a14166 Redirect for index route (#121)
Some checks failed
Deploy to Cloudflare Workers / Build & Deploy (push) Has been cancelled
2025-06-01 16:13:44 +08:00
9009e8acd5 merge upstream 2025-03-05 09:52:29 +08:00
8cf519fc3e update wragler.toml 2024-10-28 10:31:05 +08:00
5a29e9a6ea Merge branch 'GitHub-master' 2024-10-28 10:26:44 +08:00
533e46e0dc 更新 src/index.js 2024-09-18 13:06:08 +08:00
0dc7dbd355 更新 README.md 2024-09-18 12:31:48 +08:00
9bb87fe8ef 更新 wrangler.toml
use lolicon.in
2024-09-18 12:28:39 +08:00
6 changed files with 3544 additions and 514 deletions

View File

@@ -2,7 +2,7 @@
![deploy](https://github.com/ciiiii/cloudflare-docker-proxy/actions/workflows/deploy.yaml/badge.svg) ![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://git.yinr.cc/Yinr/cloudflare-docker-proxy.git)
> 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/ciiiii/cloudflare-helm-proxy).
@@ -12,7 +12,7 @@
2. follow the instructions to fork and deploy 2. follow the instructions to fork and deploy
3. update routes as you requirement 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://git.yinr.cc/Yinr/cloudflare-docker-proxy.git)
## Routes configuration tutorial ## Routes configuration tutorial

3023
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
"scripts": { "scripts": {
"format": "prettier --write '**/*.{js,css,json,md}'", "format": "prettier --write '**/*.{js,css,json,md}'",
"build": "webpack", "build": "webpack",
"dev": "wrangler dev src/index.js --env dev" "dev": "npx wrangler dev src/index.js --env dev"
}, },
"license": "MIT", "license": "MIT",
"main": "src/index.js" "main": "src/index.js"

View File

@@ -32,6 +32,9 @@ function routeByHosts(host) {
async function handleRequest(request) { async function handleRequest(request) {
const url = new URL(request.url); const url = new URL(request.url);
if (url.pathname == "/") {
return Response.redirect(url.protocol + "//" + url.host + "/v2/", 301);
}
const upstream = routeByHosts(url.hostname); const upstream = routeByHosts(url.hostname);
if (upstream === "") { if (upstream === "") {
return new Response( return new Response(
@@ -154,7 +157,7 @@ async function fetchToken(wwwAuthenticate, scope, authorization) {
} }
function responseUnauthorized(url) { function responseUnauthorized(url) {
const headers = new(Headers); const headers = new Headers();
if (MODE == "debug") { if (MODE == "debug") {
headers.set( headers.set(
"Www-Authenticate", "Www-Authenticate",

View File

@@ -7,7 +7,7 @@ port = 8787
local_protocol = "http" local_protocol = "http"
[env.vars] [env.vars]
CUSTOM_DOMAIN = "libcuda.so" CUSTOM_DOMAIN = "lolicon.in"
[env.dev.vars] [env.dev.vars]
MODE = "debug" MODE = "debug"
@@ -16,15 +16,6 @@ CUSTOM_DOMAIN = "exmaple.com"
[env.production] [env.production]
name = "cloudflare-docker-proxy" 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 },
# ]
[env.production.vars] [env.production.vars]
MODE = "production" MODE = "production"

1013
yarn.lock

File diff suppressed because it is too large Load Diff