mirror of
https://github.com/replicatedhq/ttl.sh.git
synced 2026-05-16 05:16:34 +00:00
Rename to ttl.sh
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "replreg-cloudflare-worker",
|
||||
"version": "0.0.1",
|
||||
"description": "Cloudflare Workers for replreg.is",
|
||||
"description": "Cloudflare Workers for ttl.sh",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
|
||||
@@ -13,7 +13,7 @@ async function proxyRequest(r: Request): Promise<Response> {
|
||||
|
||||
if (!isRegistryRequest(r)) {
|
||||
return fetch(`https://friendly-goldstine-7897fc.netlify.com/${url.pathname}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isCatalogRequest(r)) {
|
||||
return new Response(null, {
|
||||
@@ -21,10 +21,11 @@ async function proxyRequest(r: Request): Promise<Response> {
|
||||
});
|
||||
}
|
||||
|
||||
const tagManifestParams = await tryParsePutTagRequest(r.method, url);
|
||||
if (tagManifestParams) {
|
||||
return handleTagManifestRequest(r, tagManifestParams);
|
||||
}
|
||||
// Removing this code for now. It causes Docker to exit with a 1 exit code :(
|
||||
// const tagManifestParams = await tryParsePutTagRequest(r.method, url);
|
||||
// if (tagManifestParams) {
|
||||
// return handleTagManifestRequest(r, tagManifestParams);
|
||||
// }
|
||||
|
||||
return fetch(r);
|
||||
}
|
||||
@@ -43,4 +44,4 @@ interface FetchEvent extends Event {
|
||||
request: Request;
|
||||
|
||||
respondWith(r: Promise<Response> | Response): Promise<Response>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function handleTagManifestRequest(r: Request, params: TagManifestPa
|
||||
const teapotResponse = {
|
||||
"errors": [
|
||||
{
|
||||
"message": `\r \nimage replreg.is/${imageName} is available now and will be automatically deleted ${expirationFromTag(params.tag)}\n\nreplreg is contributed by Replicated (www.replicated.com)`
|
||||
"message": `\r \nimage ttl.sh/${imageName} is available now and will be automatically deleted ${expirationFromTag(params.tag)}\n\nreplreg is contributed by Replicated (www.replicated.com)`
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# replreg hooks
|
||||
|
||||
This is the hooks server that also has the reaper for replreg.is.
|
||||
This is the hooks server that also has the reaper for ttl.sh.
|
||||
|
||||
The webhooks from the registry are terminated in [src/controllers/HookAPI.ts](https://github.com/replicatedhq/replreg/blob/master/hooks/src/controllers/HookAPI.ts). The reaper runs on a cron and executes [src/commands/reap.ts](https://github.com/replicatedhq/replreg/blob/master/hooks/src/commands/reap.ts).
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ async function main(argv): Promise<any> {
|
||||
// Get the manifest from the tag
|
||||
const getOptions = {
|
||||
method: "HEAD",
|
||||
uri: `https://replreg.is/v2/${imageAndTag[0]}/manifests/${imageAndTag[1]}`,
|
||||
uri: `https://ttl.sh/v2/${imageAndTag[0]}/manifests/${imageAndTag[1]}`,
|
||||
headers,
|
||||
resolveWithFullResponse: true,
|
||||
simple: false,
|
||||
@@ -68,7 +68,7 @@ async function main(argv): Promise<any> {
|
||||
continue;
|
||||
}
|
||||
|
||||
const deleteURI = `https://replreg.is/v2/${imageAndTag[0]}/manifests/${getResponse.headers.etag.replace(/"/g,"")}`;
|
||||
const deleteURI = `https://ttl.sh/v2/${imageAndTag[0]}/manifests/${getResponse.headers.etag.replace(/"/g,"")}`;
|
||||
|
||||
// Remove from the registry
|
||||
const options = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# replreg registry
|
||||
|
||||
This is the registry server that runs in replreg.is. It's a configured Docker registry, using the registry:2 image. There the confguration installs a hook into the registry, that will fire notifications when an image is pushed. The work to expire and delete images happens in the hook directory.
|
||||
This is the registry server that runs in ttl.sh. It's a configured Docker registry, using the registry:2 image. There the confguration installs a hook into the registry, that will fire notifications when an image is pushed. The work to expire and delete images happens in the hook directory.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user