diff --git a/sites/ewp.fyi/.vscode/settings.json b/sites/ewp.fyi/.vscode/settings.json deleted file mode 100644 index c436f12..0000000 --- a/sites/ewp.fyi/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "files.associations": { - "*.json.liquid": "json", - "*.yaml.liquid": "yaml", - "*.md.liquid": "markdown", - "*.js.liquid": "liquid-javascript", - "*.css.liquid": "liquid-css", - "*.scss.liquid": "liquid-scss", - "_redirects": "txt" - } -} \ No newline at end of file diff --git a/sites/ewp.fyi/_routes.json b/sites/ewp.fyi/_routes.json index 2ed9819..7bc347a 100644 --- a/sites/ewp.fyi/_routes.json +++ b/sites/ewp.fyi/_routes.json @@ -1,9 +1,7 @@ { "version": 1, - "include": [ - "/v2/*" - ], + "include": [], "exclude": [ "/.vscode" ] -} +} \ No newline at end of file diff --git a/sites/ewp.fyi/functions/v2/[[image]].js b/sites/ewp.fyi/functions/v2/[[image]].js deleted file mode 100644 index d27c82c..0000000 --- a/sites/ewp.fyi/functions/v2/[[image]].js +++ /dev/null @@ -1,38 +0,0 @@ -// This function acts as a proxy for the OCI Distribution API -// It will redirect requests to the ghcr.io domain and inject a default user - -// Configs for what to do with requests -const DEFAULT_USER = "ewpratten"; -const ALLOWED_EXTRA_USERS = [ - -]; -// const TARGET_URL = new URL("https://registry.hub.docker.com/v2/"); -const TARGET_URL = new URL("https://index.docker.io/v2/"); - -export function onRequest(context) { - - // Parse the path out of the url - const url = new URL(context.request.url); - - // Replace the domain and port with the ghcr.io domain - url.hostname = TARGET_URL.hostname; - url.port = ""; - - // If the path is just /v2 then redirect upstream - // if (url.pathname == "/v2" || url.pathname == "/v2/") { - // return Response.redirect(TARGET_URL.toString(), 302); - // } - - // // If the path starts with an allowed user, redirect to the new url - // for (var user of ALLOWED_EXTRA_USERS) { - // if (url.pathname.startsWith(`/v2/${user}/`)) { - // return Response.redirect(url.toString(), 302); - // } - // } - - // // Inject the default user into the path after /v2/ - // url.pathname = url.pathname.replace("/v2/", `/v2/${DEFAULT_USER}/`); - - // Redirect to the new url - return Response.redirect(url.toString(), 302); -} diff --git a/sites/ewp.fyi/functions/v2/index.js b/sites/ewp.fyi/functions/v2/index.js deleted file mode 100644 index 6ed22a4..0000000 --- a/sites/ewp.fyi/functions/v2/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -export function onRequest(context) { - return Response.redirect("https://registry.hub.docker.com/v2", 302); -}