From b799e9c5fbc2cbde147d51ee88e68ab551d56353 Mon Sep 17 00:00:00 2001 From: Marc Campbell Date: Tue, 21 May 2019 07:01:37 +0000 Subject: [PATCH] Rename to ttl.sh --- cloudflare/package.json | 2 +- cloudflare/src/index.ts | 13 +++++++------ cloudflare/src/tag_manifest/handler.ts | 2 +- hooks/README.md | 2 +- hooks/src/commands/reap.ts | 4 ++-- registry/README.md | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cloudflare/package.json b/cloudflare/package.json index 25d37c8..6380c26 100644 --- a/cloudflare/package.json +++ b/cloudflare/package.json @@ -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" diff --git a/cloudflare/src/index.ts b/cloudflare/src/index.ts index 400dfba..e7595e1 100644 --- a/cloudflare/src/index.ts +++ b/cloudflare/src/index.ts @@ -13,7 +13,7 @@ async function proxyRequest(r: Request): Promise { 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 { }); } - 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): Promise; -} \ No newline at end of file +} diff --git a/cloudflare/src/tag_manifest/handler.ts b/cloudflare/src/tag_manifest/handler.ts index 0d6714d..52a0533 100644 --- a/cloudflare/src/tag_manifest/handler.ts +++ b/cloudflare/src/tag_manifest/handler.ts @@ -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)` } ] }; diff --git a/hooks/README.md b/hooks/README.md index 9b98269..49179d1 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -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). diff --git a/hooks/src/commands/reap.ts b/hooks/src/commands/reap.ts index 6d9ffb1..07fef3b 100644 --- a/hooks/src/commands/reap.ts +++ b/hooks/src/commands/reap.ts @@ -55,7 +55,7 @@ async function main(argv): Promise { // 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 { 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 = { diff --git a/registry/README.md b/registry/README.md index 2f3b8c6..5d9004f 100644 --- a/registry/README.md +++ b/registry/README.md @@ -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.