Rename to ttl.sh

This commit is contained in:
Marc Campbell
2019-05-21 07:01:37 +00:00
parent effb57ba72
commit b799e9c5fb
6 changed files with 13 additions and 12 deletions

View File

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

View File

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

View File

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

View File

@@ -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).

View File

@@ -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 = {

View File

@@ -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.