{"id":18607374,"url":"https://github.com/addono/container-registry-proxy-custom-plugin-example","last_synced_at":"2025-11-02T15:30:26.122Z","repository":{"id":37027795,"uuid":"263303730","full_name":"Addono/container-registry-proxy-custom-plugin-example","owner":"Addono","description":"A simple example of a custom plugin implementation for the container-registry-proxy.","archived":false,"fork":false,"pushed_at":"2023-02-01T00:26:41.000Z","size":268,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T00:27:29.519Z","etag":null,"topics":["container-registry-proxy","node","plugin","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/Addono/container-registry-proxy","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Addono.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-12T10:21:26.000Z","updated_at":"2021-12-14T23:13:23.000Z","dependencies_parsed_at":"2024-12-27T00:27:15.323Z","dependency_job_id":"35db7dbb-4035-4d04-8e4d-662293b6d6f6","html_url":"https://github.com/Addono/container-registry-proxy-custom-plugin-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fcontainer-registry-proxy-custom-plugin-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fcontainer-registry-proxy-custom-plugin-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fcontainer-registry-proxy-custom-plugin-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fcontainer-registry-proxy-custom-plugin-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/container-registry-proxy-custom-plugin-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239395879,"owners_count":19631336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container-registry-proxy","node","plugin","typescript"],"created_at":"2024-11-07T02:29:14.993Z","updated_at":"2025-11-02T15:30:26.071Z","avatar_url":"https://github.com/Addono.png","language":"TypeScript","readme":"# Container Registry Proxy - Custom Plugin Example\n\n[![License](https://img.shields.io/github/license/Addono/container-registry-proxy-custom-plugin-example?style=flat-square)](https://github.com/Addono/container-registry-proxy/blob/master/LICENSE)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://img.shields.io/badge/project%20status-Active-greengrass?style=flat-square)](https://www.repostatus.org/#active)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/addono/container-registry-proxy-custom-plugin-example/Test?style=flat-square)\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## 📝 Table of Contents\n\n- [About](#about)\n- [Getting Started](#getting_started)\n- [Usage](#usage)\n- [Contributors](#contributors)\n\n## 🧐 About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nThe Container Registry Proxy (CRP) is a small proxy for communicating with a container registry. This proxy can monitor and modify traffic in-transit, as to facilitate additional logging and chaos engineering.\n\nMonitoring and modifying the traffic is delegated to a plugin system. This allows the proxy to be generally reusable and allow anyone to tune it to their needs without having to dive into the source code of the proxy.\n\nThis repository is here to give you an example and starting point for creating custom plugins for the CRP. Custom plugins are plugins which are loaded from the file system by the CRP at runtime.\n\n## 🏁 Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [usage](#usage) for notes on how to use the plugin in production.\n\n### Prerequisites\n\nYou need to have [Yarn](https://yarnpkg.com/en/docs/install) installed to use this repository.\n\n### Installing\n\nFirst we need to install all dependencies, run:\n\n```bash\nyarn install\n```\n\n### Running Locally\n\nThe following command will continuously compile the code of the plugin to plain JavaScript.\n\n```bash\nyarn build --watch\n```\n\n### Editing\n\nTo modify the plugin, open `./plugin.ts` and modify the plugin by adding your logic to the `requestPipe` method of the by default exported object.\n\nThe `requestPipe` is function, which takes a `Request` object as it's only argument. Its return type is a promise of a (if desired modified) `Request` object, or otherwise `undefined` if the connection should be dropped.\n\n```typescript\ntype Request = {\n  host: string\n  https: boolean\n  version: string\n  parameters?: {\n    repository: string\n    method: Method\n    tag: string\n  }\n}\n\ninterface Plugin {\n  name: string\n  description?: string\n  requestPipe: RequestPipe\n}\n```\nUp to date type definitions can be inferred by your IDE or found [here](https://github.com/Addono/container-registry-proxy/blob/master/src/plugins.ts).\n\n## 🎈 Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\nFirst, build the plugin:\n```bash\nyarn build\n```\n\nThen you can attach it to the `container-regsitry-proxy` by running:\n```bash\ncontainer-registry-proxy --customPlugin dist/plugin.js\n```\n\n## ✨ Contributors \u003ca name = \"contributors\"\u003e\u003c/a\u003e\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://aknapen.nl\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/15435678?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdriaan Knapen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Addono/container-registry-proxy/commits?author=Addono\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Addono/container-registry-proxy/commits?author=Addono\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fcontainer-registry-proxy-custom-plugin-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Fcontainer-registry-proxy-custom-plugin-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fcontainer-registry-proxy-custom-plugin-example/lists"}