{"id":13581699,"url":"https://github.com/brigadecore/brigade-dockerhub-gateway","last_synced_at":"2025-04-26T17:30:50.620Z","repository":{"id":37786686,"uuid":"393191859","full_name":"brigadecore/brigade-dockerhub-gateway","owner":"brigadecore","description":"A Brigade 2 compatible gateway for events originating from Docker Hub","archived":false,"fork":false,"pushed_at":"2024-06-24T22:05:39.000Z","size":181,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T16:27:46.305Z","etag":null,"topics":["brigade","brigade-gateway","v2"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brigadecore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-05T23:14:46.000Z","updated_at":"2022-06-02T16:23:50.000Z","dependencies_parsed_at":"2024-11-05T21:43:22.676Z","dependency_job_id":null,"html_url":"https://github.com/brigadecore/brigade-dockerhub-gateway","commit_stats":{"total_commits":65,"total_committers":2,"mean_commits":32.5,"dds":0.01538461538461533,"last_synced_commit":"8f5927d6264bb9d6748c16046af4e3f316a986f2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-dockerhub-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-dockerhub-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-dockerhub-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-dockerhub-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brigadecore","download_url":"https://codeload.github.com/brigadecore/brigade-dockerhub-gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025592,"owners_count":21524829,"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":["brigade","brigade-gateway","v2"],"created_at":"2024-08-01T15:02:11.293Z","updated_at":"2025-04-26T17:30:50.398Z","avatar_url":"https://github.com/brigadecore.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Brigade Docker Hub Gateway\n\n![build](https://badgr.brigade2.io/v1/github/checks/brigadecore/brigade-dockerhub-gateway/badge.svg?appID=99005)\n[![codecov](https://codecov.io/gh/brigadecore/brigade-dockerhub-gateway/branch/main/graph/badge.svg?token=91B1J1VKQH)](https://codecov.io/gh/brigadecore/brigade-dockerhub-gateway)\n[![Go Report Card](https://goreportcard.com/badge/github.com/brigadecore/brigade-dockerhub-gateway)](https://goreportcard.com/report/github.com/brigadecore/brigade-dockerhub-gateway)\n[![slack](https://img.shields.io/badge/slack-brigade-brightgreen.svg?logo=slack)](https://kubernetes.slack.com/messages/C87MF1RFD)\n\n\u003cimg width=\"100\" align=\"left\" src=\"logo.png\"\u003e\n\nThis Brigade Docker Hub Gateway receives events\n([webhooks](https://docs.docker.com/docker-hub/webhooks/)) from Docker Hub and\nemits them into Brigade's event bus.\n\n\u003cbr clear=\"left\"/\u003e\n\n## Creating Webhooks\n\nAfter [installation](docs/INSTALLATION.md), browse to any of your Docker Hub\nrepositories for which you'd like to send webhooks to this gateway. From the\ntabs across the top of the page, select __Webhooks__. \n\n* In the __Webhook name__ field, add a meaningful name for the webhook.\n\n* In the __Webhook URL__ field, use a value of the form\n  `https://\u003cDNS hostname or publicIP\u003e/events?access_token=\u003curl-encoded token\u003e`.\n\n* Click __Create__\n\n\u003e ⚠️\u0026nbsp;\u0026nbsp;Docker Hub doesn't provide _any_ reasonable mechanism for\n\u003e authenticating to the endpoints to which events (webhooks) are sent. Due to\n\u003e this, the only viable approach to authentication is to include a token (a\n\u003e shared secret) in the webhook URL as depicted above. Users are cautioned that\n\u003e even with TLS, this is not _entirely_ secure because web servers, reverse\n\u003e proxies, and other infrastructure are apt to capture entire URLs, including\n\u003e query parameters, in their access logs. _If your threat model suggests this is\n\u003e an intolerable degree of risk, then do not use this gateway and, more\n\u003e generally, do not use Docker Hub webhooks._\n\n## Subscribing\n\nNow subscribe any number of Brigade\n[projects](https://docs.brigade.sh/topics/project-developers/projects/) to\nevents emitted by this gateway -- all of which have a value of\n`brigade.sh/dockerhub` in their `source` field. You can subscribe to all event\ntypes emitted by the gateway, or just specific ones.\n\nIn the example project definition below, we subscribe to `push` events, provided\nthey've originated from the fictitious `example-org/example` repository (see the\n`repo` \n[qualifier](https://docs.brigade.sh/topics/project-developers/events/#qualifiers)).\nYou should adjust this value to match a repository for which you are sending\nwebhooks to your new gateway (see\n[installation instructions](docs/INSTALLATION.md)).\n\n```yaml\napiVersion: brigade.sh/v2\nkind: Project\nmetadata:\n  id: dockerhub-demo\ndescription: A project that demonstrates integration with Docker Hub\nspec:\n  eventSubscriptions:\n  - source: brigade.sh/dockerhub\n    types:\n    - push\n    qualifiers:\n      repo: example-org/example\n  workerTemplate:\n    defaultConfigFiles:\n      brigade.js: |-\n        const { events } = require(\"@brigadecore/brigadier\");\n\n        events.on(\"brigade.sh/dockerhub\", \"push\", () =\u003e {\n          console.log(\"Someone pushed an image to the example-org/example repository!\");\n        });\n\n        events.process();\n```\n\nAssuming this file were named `project.yaml`, you can create the project like\nso:\n\n```shell\n$ brig project create --file project.yaml\n```\n\nPushing an image to the corresponding repo should now send a webhook from Docker\nHub to your gateway. The gateway, in turn, will emit the event into Brigade's\nevent bus. Brigade should initialize a worker (containerized event handler) for\nevery project that has subscribed to the event, and the worker should execute\nthe `brigade.js` script that was embedded in the example project definition.\n\nList the events for the `dockerhub-demo` project to confirm this:\n\n```shell\n$ brig event list --project dockerhub-demo\n```\n\nFull coverage of `brig` commands is beyond the scope of this documentation, but\nat this point,\n[additional `brig` commands](https://docs.brigade.sh/topics/project-developers/brig/)\ncan be applied to monitor the event's status and view logs produced in the\ncourse of handling the event.\n\n## Events Received and Emitted by this Gateway\n\nDocker Hub only supports one type of event (webhook) and that is the `push`\nevent.\n\n## Contributing\n\nThe Brigade project accepts contributions via GitHub pull requests. The\n[Contributing](CONTRIBUTING.md) document outlines the process to help get your\ncontribution accepted.\n\n## Support \u0026 Feedback\n\nWe have a slack channel!\n[Kubernetes/#brigade](https://kubernetes.slack.com/messages/C87MF1RFD) Feel free\nto join for any support questions or feedback, we are happy to help. To report\nan issue or to request a feature open an issue\n[here](https://github.com/brigadecore/brigade-dockerhub-gateway/issues)\n\n## Code of Conduct\n\nParticipation in the Brigade project is governed by the\n[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-dockerhub-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrigadecore%2Fbrigade-dockerhub-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-dockerhub-gateway/lists"}