1

Remove unnecessary settings and functions

This commit is contained in:
Evan Pratten 2023-11-13 11:08:10 -05:00
parent 80327dfc7a
commit 245b113382
4 changed files with 2 additions and 57 deletions

View File

@ -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"
}
}

View File

@ -1,9 +1,7 @@
{
"version": 1,
"include": [
"/v2/*"
],
"include": [],
"exclude": [
"/.vscode"
]
}
}

View File

@ -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);
}

View File

@ -1,4 +0,0 @@
export function onRequest(context) {
return Response.redirect("https://registry.hub.docker.com/v2", 302);
}