{"id":17696312,"url":"https://github.com/erisa/hetzner-firewall-cfworker","last_synced_at":"2025-09-02T10:37:49.731Z","repository":{"id":63089301,"uuid":"484602246","full_name":"Erisa/hetzner-firewall-cfworker","owner":"Erisa","description":"Use Cloudflare Workers Cron Triggers to keep your Hetzner Cloud Firewall allowing the latest list of Cloudflare IPs, or any other lists!","archived":false,"fork":false,"pushed_at":"2025-02-15T03:18:37.000Z","size":207,"stargazers_count":20,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T22:32:33.876Z","etag":null,"topics":["cloudflare-worker","cloudflare-workers","hetzner-cloud"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Erisa.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Erisa"}},"created_at":"2022-04-22T23:53:51.000Z","updated_at":"2025-04-15T15:12:49.000Z","dependencies_parsed_at":"2025-04-21T12:31:29.513Z","dependency_job_id":null,"html_url":"https://github.com/Erisa/hetzner-firewall-cfworker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fhetzner-firewall-cfworker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fhetzner-firewall-cfworker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fhetzner-firewall-cfworker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erisa%2Fhetzner-firewall-cfworker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erisa","download_url":"https://codeload.github.com/Erisa/hetzner-firewall-cfworker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877367,"owners_count":21977634,"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":["cloudflare-worker","cloudflare-workers","hetzner-cloud"],"created_at":"2024-10-24T14:43:54.296Z","updated_at":"2025-05-13T04:40:02.479Z","avatar_url":"https://github.com/Erisa.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Erisa"],"categories":[],"sub_categories":[],"readme":"# Hetzner Cloud Firewall automation with Cloudflare Workers\n\nHeavily inspired by [xopez/Hetzner-Cloud-Firewall-API-examples](https://github.com/xopez/Hetzner-Cloud-Firewall-API-examples), this repository holds a Cloudflare Worker which updates a [Hetzner Cloud](https://www.hetzner.com/cloud) Firewall to use the latest list of [Cloudflare IP ranges](https://www.cloudflare.com/en-gb/ips/) on a Cron Trigger.\n\n## Requirements\n- Hetzner Cloud account\n- Wrangler: `npm i -g wrangler`\n- Cloudflare account configured to deploy Workers\n\n## Usage\n- Create a Firewall on Hetzner Cloud that you want to set to the Cloudflare IPs.\n- Set the ports you want to allow through the Firewall in the `PORTS` variable of `wrangler.toml`\n- Enter the ID of the Firewall in `FIREWALL_ID`. You can find this as the nuumber after `/firewalls/` in the console URl when visiting the Firewall.\n- Create a Hetzner Cloud API Token and set it with `wrangler secret put API_TOKEN`.\n- (Optional) Secure your `workers.dev` domain by adding an extra secret to manual REST calls:\n    - `wrangler secret put WORKER_SECRET`\n    - This secret will need to be in the `Authorization` header to trigger the Worker manually over HTTPS, but only if the secret is defined. Cron triggers are automatic and unaffected.\n\n## Creativity\n\nIf allowing Cloudflare IPs is not your jam, it should be easy to edit `src/index.ts` and replace the two URLs with any other URLs that produce a newline-seperated list of IP ranges, allowing you to allowlist any service you desire.\n\nRemember to remove the `rules.concat` line if you only end up having one list.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferisa%2Fhetzner-firewall-cfworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferisa%2Fhetzner-firewall-cfworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferisa%2Fhetzner-firewall-cfworker/lists"}