{"id":17708537,"url":"https://github.com/deuill/webhook-gateway","last_synced_at":"2025-04-30T09:20:27.049Z","repository":{"id":259295302,"uuid":"876867123","full_name":"deuill/webhook-gateway","owner":"deuill","description":"A service for transporting WebHooks from Grafana, Cloudflare Notifications, etc. to XMPP, IRC, etc.","archived":false,"fork":false,"pushed_at":"2025-01-28T14:48:05.000Z","size":1994,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-04-21T15:11:56.278Z","etag":null,"topics":["alertmanager","alerts","cloudflare","grafana","healthcheck","irc","notifications","prometheus","webhook","xmpp"],"latest_commit_sha":null,"homepage":"https://webhook-gateway.doc.deuill.org","language":"Go","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/deuill.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":"2024-10-22T17:24:33.000Z","updated_at":"2025-01-28T14:48:08.000Z","dependencies_parsed_at":"2024-10-24T06:27:40.647Z","dependency_job_id":"15be6eef-53ce-4a9a-8834-40fb552a06ed","html_url":"https://github.com/deuill/webhook-gateway","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"54f196184b62882174def6562c521910248da3a6"},"previous_names":["deuill/webhook-gateway"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deuill%2Fwebhook-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deuill%2Fwebhook-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deuill%2Fwebhook-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deuill%2Fwebhook-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deuill","download_url":"https://codeload.github.com/deuill/webhook-gateway/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251674888,"owners_count":21625701,"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":["alertmanager","alerts","cloudflare","grafana","healthcheck","irc","notifications","prometheus","webhook","xmpp"],"created_at":"2024-10-25T02:07:27.061Z","updated_at":"2025-04-30T09:20:27.041Z","avatar_url":"https://github.com/deuill.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebHook Gateway\n\nWebHook Gateway processes events emitted by sources such as Grafana, Cloudflare Notifications, etc.\ninto destinations such as XMPP; it is generally intended as a way of forwarding alerts into chat for\nplatforms with no direct support.\n\nCurrently, the following sources are supported:\n\n  - [Grafana AlertManager][grafana-alertmanager]\n  - [Cloudflare Notifications][cloudflare-notifications]\n\nThe currently supported destinations include:\n\n- [XMPP][xmpp]\n- [IRC][irc]\n\nThese can be used interchangeably and matched as needed.\n\n## Building and Installing\n\nInstalling `webhook-gateway` locally requires that you have Go installed, at a minimum. To install,\nsimply run the following command:\n\n```sh\n$ go install go.deuill.org/webhook-gateway/cmd/webhook-gateway@latest\n```\n\nThe `webhook-gateway` binary should be placed in your `$GOBIN` path.\n\n## Deployment\n\n### Containers\n\nLocal deployments can be made by manually building the `webhook-gateway` binary with a\nlocally installed Go toolchain; in most cases, you'll likely want to use the pre-built container\nimages with Podman or Docker.\n\nDoing so requires that you first create a valid `config.toml` configuration file, which you can copy\nover from the `config.example.toml` template, and mounting it into\n`/var/lib/webhook-gateway/config.toml`:\n\n```sh\n$ cp config.example.toml config.toml # Probably need to edit the file as well.\n$ docker run --rm -v ./config.toml:/var/lib/webhook-gateway/config.toml docker.io/deuill/webhook-gateway:latest\n```\n\n### Google Cloud\n\nGoogle Cloud Run provides a platform for running arbitrary containers with a generous [free\ntier][gcloud-run-pricing]; assuming you've already set up your Google Cloud account and have the\n`gcloud` command-line tools installed locally, you can deploy into Google Cloud Run via service\ndefinitions shipped here.\n\nFirst, set up a secret containing your entire `config.toml` file:\n\n```sh\n$ gcloud secrets create webhook-gateway-config --data-file=config.toml\n```\n\nThen, create the service from the included `gcloud-service.yaml` file:\n\n```sh\n$ gcloud run services replace gcloud-service.yaml --region=europe-west1\n```\n\nThis should return an un-authenticated URL you can use from within your event sources as-is.\n\n## Configuration\n\nConfiguration is made entirely via a single TOML file, a full example of which can be found\n[here][toml-config]. In general, providing a configuration file is mandatory as options\ndon't (generally) have defaults set; only a number of options are required, though. The following\nsections are available:\n\n### `http`\n\n```toml\n[http]\nhost = \"localhost\"\nport = \"8080\"\n```\n\nThe `host` option determines which hostname/IP address the service will listen for HTTP requests on.\nSet this to `0.0.0.0` if you want to listen on *all* interfaces (including those potentially\nconnected to the public Internet).\n\nThe `port` option determines which port number will be used to listen for HTTP requests on.\n\n### `gateway`\n\n```toml\n[[gateway]]\npath = \"POST /alerts\"\nsecret = \"foobar\"\n```\n\nThis section can be defined multiple times, for as many gateways as we want to set up, and has a\nnumber of sub-sections, described below.\n\nThe `secret` option defines a secret value to use for authenticating incoming gateway requests,\ntypically checked against source-specific methods (e.g. the `Authorization` HTTP header). This value\nis not required, and will have request be processed without explicit authentication if left empty --\nit is *highly recommended* that you at least set the `path` to a sufficiently secure value instead,\nin these cases.\n\nThe `path` option defines an absolute path, with an optional HTTP method prefix, to register for\nprocessing incoming requests. Though this option isn't required -- leaving it empty will have the\ngateway listen on `/\u003cgateway-secret\u003e` instead -- setting it is highly recommended. The value of this\noption *must* be unique across gateway definitions.\n\n### `gateway.source` and `gateway.destination`\n\n```toml\n[[gateway]]\nsecret = \"foobar\"\n\n[gateway.source]\ntype = \"grafana\"\n\n[gateway.destination]\ntype = \"xmpp\"\n```\n\nAs per TOML syntax, these sections can also be defined inline with the `gateway` section, e.g.:\n\n```toml\n[[gateway]]\nsecret = \"foobar\"\nsource.type = \"grafana\"\ndestination.type = \"xmpp\"\n```\n\nBoth ways of definition lead to the same result. These sections define the source and destination\nfor messages, as processed from incoming WebHook requests.\n\nThe `type` option defines which source or destination type will be used, and therefore what\nadditional configuration may need to be provided as a sub-section; for type names, check the\n`source` and `destination` folders -- each sub-folder is a valid source and destination type,\nrespectively.\n\n### `gateway.source.\u003ctype\u003e` and `gateway.destination.\u003ctype\u003e`\n\n```toml\n[[gateway]]\nsecret = \"foobar\"\nsource.type = \"grafana\"\ndestination.type = \"xmpp\"\n\n[gateway.source.grafana]\ntemplate = \"{{.Status}}: {{.Title}} is alerting!\"\n\n[gateway.destination.xmpp]\njid = \"test@example.com\"\npassword = \"foobar\"\n```\n\nThese sections define source- and destination-specific configuration, with destination configuration\ntypically containing a number of required options. For more information on these options, check\nREADME files in the respective source and destination directories.\n\n## License\n\nAll code in this repository is covered by the terms of the MIT License, the full text of which can be found in the LICENSE file.\n\n[grafana-alertmanager]: pkg/source/grafana/README.md\n[cloudflare-notifications]: pkg/source/cloudflare-notifications/README.md\n[xmpp]: pkg/destination/xmpp/README.md\n[irc]: pkg/destination/irc/README.md\n[toml-config]: https://github.com/deuill/webhook-gateway/blob/trunk/config.example.toml\n[gcloud-run-pricing]: https://cloud.google.com/run/pricing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeuill%2Fwebhook-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeuill%2Fwebhook-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeuill%2Fwebhook-gateway/lists"}