{"id":18888098,"url":"https://github.com/codex-team/flux-webhook-autoreconciler","last_synced_at":"2025-04-12T02:36:35.645Z","repository":{"id":196281329,"uuid":"695290048","full_name":"codex-team/flux-webhook-autoreconciler","owner":"codex-team","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-13T22:05:59.000Z","size":66,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T02:36:22.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-22T19:26:41.000Z","updated_at":"2024-12-16T10:37:44.000Z","dependencies_parsed_at":"2023-09-24T03:22:37.193Z","dependency_job_id":"46c23299-5176-4d7e-a3a4-0e085ad07631","html_url":"https://github.com/codex-team/flux-webhook-autoreconciler","commit_stats":null,"previous_names":["codex-team/flux-webhook-autoreconciler"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fflux-webhook-autoreconciler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fflux-webhook-autoreconciler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fflux-webhook-autoreconciler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fflux-webhook-autoreconciler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/flux-webhook-autoreconciler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506992,"owners_count":21115519,"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":[],"created_at":"2024-11-08T07:42:13.675Z","updated_at":"2025-04-12T02:36:35.612Z","avatar_url":"https://github.com/codex-team.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flux-webhook-autoreconciler\n\nThis project aims to solve the problem of having to manually setup webhooks for each repository in a cluster to reconcile Flux sources. \n\nNormally, you'd need to set up a Receiver for each source, then a webhook for that receiver ([official docs](https://fluxcd.io/flux/guides/webhook-receivers/)). \nThis can get pretty annoying and it's easy to mess up, especially when you have tons of repos you want to deploy with Flux.\n\nThis project tackles this by giving you a single webhook receiver. You hook it up to your entire GitHub organization, \nand it'll automatically keep the Flux sources in sync across all your repos.\n\n## How it works\n\nThis project has two main parts:\n\n- `Server`: It gets the webhooks, reconciles the sources, and tells the clients about what happened.\n- `Client`: (Optional) It listens to the server and reconciles the sources. You can run just the server if you want, but having a client is handy if you have multiple clusters. You send one webhook to the server, and it’ll reconcile the sources in all your clusters through their clients.\n\nBasically, the server waits for webhooks on the `/webhook` endpoint, and the client connects to the server on the `/subscribe` endpoint using WebSockets. You can have as many clients as you want (like, one client for each Kubernetes cluster). Both the server and client take care of reconciling the sources. \n\nTo figure out which sources need reconciling when a webhook comes in, the reconciler takes the package name from the webhook data, checks out all the sources, and then matches it up with the package name in each source. If there's a match, that source gets reconciled.\n\n## Installation\n\nThere is helm chart available published as OCI artifact in GitHub Packages [here](https://github.com/codex-team/flux-webhook-autoreconciler/pkgs/container/flux-webhook-autoreconciler%2Fchart%2Fflux-webhook-autoreconciler).\nYou can install it using [Helm CLI](https://helm.sh/docs/topics/registries/) or by using Flux itself:\n\n```yaml\napiVersion: source.toolkit.fluxcd.io/v1beta2\nkind: HelmRepository\nmetadata:\n  name: flux-webhook-autoreconciler\nspec:\n  interval: 24h\n  type: oci\n  url: oci://ghcr.io/codex-team/flux-webhook-autoreconciler/chart\n---\napiVersion: helm.toolkit.fluxcd.io/v2beta1\nkind: HelmRelease\nmetadata:\n  name: flux-webhook-autoreconciler\nspec:\n  interval: 24h\n  timeout: 5m\n  chart:\n    spec:\n      chart: flux-webhook-autoreconciler\n      version: '1.0.0' # replace with the latest version from here https://github.com/codex-team/flux-webhook-autoreconciler/pkgs/container/flux-webhook-autoreconciler%2Fchart%2Fflux-webhook-autoreconciler\n      sourceRef:\n        kind: HelmRepository\n        name: flux-webhook-autoreconciler\n      interval: 24h\n  values:\n    config:\n      values:\n        mode: server\n    secrets:\n      existingSecret: flux-webhook-autoreconciler\n      githubSecretKey: github_secret\n      subscribeSecretKey: subscribe_secret\n    networkPolicy: # it can be necessary if you install this into flux-system namespace, because it will block the traffic\n      enabled: true\n```\n\n## Configuration\n\nThe configuration is done via YAML file that is passed to the container via `--config` flag (by default it's `config.yaml` in your current directory).\n\nYou can find the example configuration in [config](./config) folder both for `server` and `client` modes.\n\nYou'll also need to set up a GitHub webhook. You have the choice to do this for your whole organization or on a per-repo basis. For the how-to, check out the [official docs](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks). \nTo get the webhook working, you'll need to sort out a few things:\n\n- Payload URL: `https://\u003cyour-domain\u003e/webhook`\n- Content type: `application/json`\n- Secret (optional but recommended)\n- In the section \"Which events would you like to trigger this webhook?\", go for \"Let me select individual events.\" and then tick the box for the \"Registry packages\" event.\n\nAnd that’s it! Now you can push a new package to your GitHub registry and it will be automatically reconciled by Flux.\n\n## Todo\n\n- [ ] Add support for other kinds of sources. Right now, it’s just `OCIRepository`.\n- [ ] Make it work with other types of webhook data. For now, it’s only set up for GitHub-like payloads.\n- [ ] Add different filtering abilities, like filtering by package name or repo labels.\n\n# Contribute\n\nFeel free to contribute to this project by creating issues and pull requests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fflux-webhook-autoreconciler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fflux-webhook-autoreconciler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fflux-webhook-autoreconciler/lists"}