Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support endpoint for self-hosted registry #30

Closed
josias-brenner opened this issue Oct 11, 2023 · 2 comments
Closed

Support endpoint for self-hosted registry #30

josias-brenner opened this issue Oct 11, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@josias-brenner
Copy link
Contributor

josias-brenner commented Oct 11, 2023

Notifications coming from the Open Source Docker Registry (registry:2 repository on dockerhub) are currently not supported. The format of an individual event seems to be similar to Azure Container Registry, but the WebHook sends an array of events in the request body.

The following is an example-payload from their documentation:

{
  "events": [
    {
      "id": "320678d8-ca14-430f-8bb6-4ca139cd83f7",
      "timestamp": "2016-03-09T14:44:26.402973972-08:00",
      "action": "pull",
      "target": {
        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
        "size": 708,
        "digest": "sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf",
        "length": 708,
        "repository": "hello-world",
        "url": "http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf",
        "tag": "latest"
      },
      "request": {
        "id": "6df24a34-0959-4923-81ca-14f09767db19",
        "addr": "192.168.64.11:42961",
        "host": "192.168.100.227:5000",
        "method": "GET",
        "useragent": "curl/7.38.0"
      },
      "actor": {},
      "source": {
        "addr": "xtal.local:5000",
        "instanceID": "a53db899-3b4b-4a62-a067-8dd013beaca4"
      }
    }
  ]
}

If you're open to a PR, I could try implementing support for this myself, although I'm not that experienced in Go and Open Source contributions. My first Idea was to modify PayloadHandler to return a PushData slice and implement a fourth endpoint type.

@github-actions github-actions bot added the triage requires review label Oct 11, 2023
@bluebrown
Copy link
Owner

@josias-brenner , sorry for the late response.

Thanks for the suggestion. I was not aware that registry:2 supports events. Support for this would be very welcome. If you can open a pull request, that would be amazing.

@bluebrown bluebrown added enhancement New feature or request good first issue Good for newcomers and removed triage requires review labels Oct 20, 2023
@bluebrown
Copy link
Owner

bluebrown commented Oct 21, 2023

@josias-brenner, thanks. I have released your feature https://github.com/bluebrown/kobold/releases/tag/v0.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants