{"id":29608212,"url":"https://github.com/m50/pitraefikhole","last_synced_at":"2025-07-20T19:04:09.078Z","repository":{"id":301002982,"uuid":"1007857686","full_name":"m50/pitraefikhole","owner":"m50","description":"Automatically create CNAMEs in pihole of your Hosts in Traefik to point at your Traefik reverse proxy","archived":false,"fork":false,"pushed_at":"2025-06-28T08:54:21.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-14T14:42:55.418Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m50.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,"zenodo":null}},"created_at":"2025-06-24T16:30:51.000Z","updated_at":"2025-06-28T08:54:24.000Z","dependencies_parsed_at":"2025-06-24T17:43:18.681Z","dependency_job_id":"a7b3446b-5956-41e5-9e03-98fbe6e2e9f5","html_url":"https://github.com/m50/pitraefikhole","commit_stats":null,"previous_names":["m50/pitraefikhole"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m50/pitraefikhole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m50%2Fpitraefikhole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m50%2Fpitraefikhole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m50%2Fpitraefikhole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m50%2Fpitraefikhole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m50","download_url":"https://codeload.github.com/m50/pitraefikhole/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m50%2Fpitraefikhole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266180720,"owners_count":23888793,"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":"2025-07-20T19:04:04.606Z","updated_at":"2025-07-20T19:04:09.072Z","avatar_url":"https://github.com/m50.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PiTraefikHole\n\nDo you use [PiHole] for your local DNS, and [Traefik] as your reverse proxy? Do you love that [Traefik] can be configured using labels in Docker? Do you hate that you can't do the same with [PiHole]? This is the solution for you!\n\nPiTraefikHole polls your [Traefik] and if it finds any hosts that are not defined as a CNAME in [PiHole], it will add it. It will not remove any unused CNAMEs, as I would prefer destructive actions to be manual.\n\n## How does it work?\n\nIt sits in a container next to [Traefik] and [PiHole] and every 30 seconds (or a configurable time) polls the [Traefik] API and looks at the rules for each router. If the rule is defined as ``Host(`my.domain.com`)`` it will strip the ```Host(``)``` part and keep the domain. This does mean that this only works with Host rules, and cannot have anything that is not just plain text in there. If anything else gets returned by the API, it will add it wrong, as this does not process what is returned using anything built into [Traefik]. You must provide in the configuration the CNAME record you would like the host to CNAME to. It will then use the [PiHole] API to add the CNAME record.\n\n## Installation\n\nThis should probably be deployed side-by-side with [Traefik] in Docker. If you are using Kubernetes, you are probably also using a different solution.\n\n```yml\n---\nservices:\n    traefik:\n        ...\n    \n    pitraefikhole:\n        image: ghcr.io/m50/pitraefikhole:main\n        networks:\n        - traefik\n        volumes:\n        - ./data/pitraefikhole.yml:/config.yml\n        restart: always\n```\n\nThen you need to configure it, either by creating the config file (like above), or configuring it with environment variables.\n\nExample config file:\n\n```yaml\ncname-address: domain.com\npihole-password: \"super-secure-password\"\nlog-level: INFO\npoll-frequency-seconds: 30\npihole-address: http://pihole/\ntraefik-address: http://traefik:8080/\n```\n\nExample environment variables:\n\n```env\nPITRAEFIKHOLE_CNAME_ADDRESS=domain.com\nPITRAEFIKHOLE_PIHOLE_PASSWORD=super-secure-password\nPITRAEFIKHOLE_LOG_LEVEL=INFO\nPITRAEFIKHOLE_POLL_FREQUENCY_SECONDS=30\nPITRAEFIKHOLE_PIHOLE_ADDRESS=http://pihole/\nPITRAEFIKHOLE_TRAEFIK_ADDRESS=http://traefik:8080/\n```\n\nAlternatively, if you would like to pass your [PiHole] password in as a secret, you can use the `pihole-password-file` (`PITRAEFIKHOLE_PIHOLE_PASSWORD_FILE`) config option and pass the file path in instead.\n\n[PiHole]: https://pi-hole.net/\n[Traefik]: https://traefik.io/traefik/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm50%2Fpitraefikhole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm50%2Fpitraefikhole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm50%2Fpitraefikhole/lists"}