GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Addono/container-registry-proxy-custom-plugin-example: A simple example of a custom plugin implementation for the container-registry-proxy.

BranchesTags
Open more actions menu

Latest commit

 

History

129 Commits
129 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.all-contributorsrc
.all-contributorsrc
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 
plugin.ts
plugin.ts
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Container Registry Proxy - Custom Plugin Example

License Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub Workflow Status All Contributors

📝 Table of Contents

  • About
  • Getting Started
  • Usage
  • Contributors

🧐 About

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

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

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

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See usage for notes on how to use the plugin in production.

Prerequisites

You need to have Yarn installed to use this repository.

Installing

First we need to install all dependencies, run:

yarn install

Running Locally

The following command will continuously compile the code of the plugin to plain JavaScript.

yarn build --watch

Editing

To modify the plugin, open ./plugin.ts and modify the plugin by adding your logic to the requestPipe method of the by default exported object.

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

type Request = {
  host: string
  https: boolean
  version: string
  parameters?: {
    repository: string
    method: Method
    tag: string
  }
}

interface Plugin {
  name: string
  description?: string
  requestPipe: RequestPipe
}

Up to date type definitions can be inferred by your IDE or found here.

🎈 Usage

First, build the plugin:

yarn build

Then you can attach it to the container-regsitry-proxy by running:

container-registry-proxy --customPlugin dist/plugin.js

✨ Contributors

Thanks goes to these wonderful people (emoji key):


Adriaan Knapen

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

A simple example of a custom plugin implementation for the container-registry-proxy.

github.com/Addono/container-registry-proxy

Topics

container-registry-proxynodeplugintypescript

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.