{"id":22683870,"url":"https://github.com/jerboaburrow/pulse","last_synced_at":"2026-04-18T11:03:59.027Z","repository":{"id":215479593,"uuid":"738663171","full_name":"JerboaBurrow/Pulse","owner":"JerboaBurrow","description":"Discord webhook bot posting messages on Github events | hot-loadable formatting templates; string interpolation in templates for arbitrary JSON bodies","archived":false,"fork":false,"pushed_at":"2024-05-29T08:01:52.000Z","size":133,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-28T14:46:07.970Z","etag":null,"topics":["bot","discord","github","http","https","rust","server","webdev","webhook"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/JerboaBurrow.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-01-03T18:47:03.000Z","updated_at":"2024-05-29T08:01:56.000Z","dependencies_parsed_at":"2024-02-25T10:23:40.324Z","dependency_job_id":"4dfd2ac3-de69-4a36-82ee-d64f60966b86","html_url":"https://github.com/JerboaBurrow/Pulse","commit_stats":null,"previous_names":["jerboaburrow/pulse"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/JerboaBurrow/Pulse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerboaBurrow%2FPulse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerboaBurrow%2FPulse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerboaBurrow%2FPulse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerboaBurrow%2FPulse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JerboaBurrow","download_url":"https://codeload.github.com/JerboaBurrow/Pulse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerboaBurrow%2FPulse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bot","discord","github","http","https","rust","server","webdev","webhook"],"created_at":"2024-12-09T21:14:28.140Z","updated_at":"2026-04-18T11:03:59.009Z","avatar_url":"https://github.com/JerboaBurrow.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pulse \n\u003cimg width=\"auto\" height=\"24px\" src=https://pulse.jerboa.app:3030/badge alt=\"Pulse status badge. If this text is visible Pulse is sleeping.\"\u003e\u003c/img\u003e\n\u003c/p\u003e\n\n### A work in progress information bot linking Discord and Github\n\n- **HMAC event authentication** 🔐: filter Github webhook POST events, and authenticate with hotloadable HMAC's per event type\n- **Discord message posting with templates** 📟: format messages with hotloadable templates, per event type, and post to hotloadable Discord webhook endpoints\n- **Message template interpolation**: automatically fill template from POST JSON bodies, fully hotloadable \n- **Template selection logic** hotloadable template selection depending on values in Github POST body JSON data\n- **Hotloadable configuration** 🔥: ssl keys, ports, multiple Discord webhooks endpoints, Github HMAC's, event templates, template selection logic.   \n\n![Screenshot from 2024-01-06 14-21-18](https://github.com/JerboaBurrow/Pulse/assets/84378622/34a58459-a51d-4c80-9d1a-07d6f98551eb)\n\n- recieves POST requests (e.g. from github webhooks) to be processed into custom messages, which are then POST'd to Discord\n    - so we can format the Github POST content to our hearts content\n \n### Roadmap\n\n- [x] support for HTTPS POST receipts (*HTTP as a cargo build option*)\n- [x] verify POST's are from github using the webhook secret\n- [x] starred event\n- [x] hot loading of formatting templates, webhook endpoints, and github HMACs\n- [x] template interpolation, with interpolation data extracted from POST bodies.\n- [x] support multiple webhook end-points\n- [x] support multiple github webhook origins (i.e. multiple HMACs)\n- [x] suppress messaging on private repos as config option (per event type)\n- [x] select templates based upon POST body/header content\n- [x] Release event\n- [x] Issue event\n- [x] PR event\n- [ ] Message queue for each Discord webhook (support spam throttling, dupe detection, etc.)\n- [ ] statistics roundup (set frequency in config)\n\n### Setup\n\nYou can host on localhost, or via a remote server with http or https\n\n#### Configuration files\n\nCreate a ```event_config.json``` specifying hmac secrets and Discord webhook endpoints, and templates for responses. \n\nThese can include interpolation placeholders, i.e. ```\u003crespository/name\u003e``` searches the JSON body for the path ```repository/name``` and replaces the token with it. [Checkout the payloads here](https://docs.github.com/en/webhooks/webhook-events-and-payloads) **any** JSON path is supported in Pulse if it is in the Github payload.\n\n```json\n{\n    \"github_released\":\n    {\n        \"hmac\": \"this_is_secret_number_one\",\n        \"templates\":\n        [ \n            {\n                \"check_value_path\": \"\",\n                \"check_value\": \"\",\n                \"body\": \"New release!\"\n            }\n        ],\n        \"end_point\": { \"addr\": \"https://discord.com/api/webhooks/aaa/bbb\" },\n        \"dont_message_on_private_repos\": true\n    },\n    \"github_starred\":\n    {\n        \"hmac\": \"this_is_secret_number_two\",\n        \"templates\":\n        [\n            {\n                \"check_value_path\": \"action\",\n                \"check_value\": \"created\",\n                \"body\": \"\u003crepository/name\u003e just got a new star! That makes \u003crepository/stargazers_count\u003e\"\n            },\n            {\n                \"check_value_path\": \"action\",\n                \"check_value\": \"deleted\",\n                \"body\": \"\u003crepository/name\u003e just lost a star :cry: That makes \u003crepository/stargazers_count\u003e\"\n            }\n        ],\n        \"end_point\": { \"addr\": \"https://discord.com/api/webhooks/xxx/yyy\" },\n        \"dont_message_on_private_repos\": true\n    },\n    \"github_pushed\":\n    {\n        \"hmac\": \"this_is_secret_number_one\",\n        \"templates\": [ ],\n        \"end_point\": { \"addr\": \"\" },\n        \"dont_message_on_private_repos\": true\n    },\n    \"github_ping\":\n    {\n        \"hmac\": \"this_is_secret_number_one\",\n        \"templates\":\n        [\n            {\n                \"check_value_path\": \"\",\n                \"check_value\": \"\",\n                \"body\": \"Ping!\"\n            }\n        ],\n        \"end_point\": { \"addr\": \"https://discord.com/api/webhooks/aaa/bbb\" },\n        \"dont_message_on_private_repos\": true\n    }\n}\n```\n\nand a ```config.json``` for the server parameters\n\n```json\n{\n    \"port\": 3030,\n    \"stats_endpoint\": { \"addr\": \"https://discord.com/api/webhooks/statistics/webhook\" },\n    \"cert_path\": \"\",\n    \"key_path\": \"\"\n}\n```\n\n#### Localhost\n\nJust launch the server!\n\n#### Example Google Cloud instance (free tier)\n\nThe [gcloud free tier](https://cloud.google.com/free?hl=en) [allows for the following instance running 24/7:](https://cloud.google.com/free/docs/free-cloud-features#compute)\n\n```\n    1 non-preemptible e2-micro VM instance per month in one of the following US regions:\n        Oregon: us-west1\n        Iowa: us-central1\n        South Carolina: us-east1\n    30 GB-months standard persistent disk\n    1 GB of outbound data transfer from North America to all region destinations (excluding China and Australia) per month\n\n```\n\nYou may still see costs in the Google cloud console, or savings suggestions. You should not be charged though. I have had it running for years all free.\n\n##### Create it using the CLI...\n\nUsing the gloud cli this command should create an instance template for the free tier, which can be used to create instances\n\n```bash\ngcloud beta compute instance-templates create free-tier-template-http --project=YOUR_PROJECT --machine-type=e2-micro \\\\\n--network-interface=network=default,network-tier=PREMIUM \\\\\n--instance-template-region=projects/YOUR_PROJECT/regions/us-central1 --maintenance-policy=MIGRATE \\\\\n--provisioning-model=STANDARD --service-account=YOUR_SERVICE_ACCOUNT \\\\\n--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append \\\\\n--enable-display-device --tags=http-server,https-server \\\\\n--create-disk=auto-delete=yes,boot=yes,device-name=free-tier-template,image=projects/debian-cloud/global/images/debian-11-bullseye-v20220719,mode=rw,size=30,type=pd-standard \n--no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any\n```\n\n##### ...or using Cloud console\n\n- create an e2 in us-central1 (Iowa) for both zone and region\n- select e2-micro (0.25-2 vCPU 1GB memory)\n- you can change the boot disc from 10GB to 30GB if you like\n- allow HTTPS and HTTP (if you need it for certificate provising)\n- all else as default\n\n### https certificate setup\n\n#### Self signed (useful for localhost testing)\n\n- You can use the bash script ```certs/gen.sh``` to generate a key/cert pair with openssl\n\n#### Production; from authority\n\n- get a domain (e.g. from squarespace)\n- create a custom DNS record, e.g.\n    - ```your.domain.somwhere    A\t1 hour\tgoogle.cloud.instance.ip ```\n- Use [Let's Encrypts](https://letsencrypt.org/) recommendation of [certbot](https://certbot.eff.org/) it really is very easy\n    - You will need to enable http in the cloud instance firewall for provisioning as well as https\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerboaburrow%2Fpulse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerboaburrow%2Fpulse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerboaburrow%2Fpulse/lists"}