Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graugans/traefik-avahi-helper
A lightweight 🪶 container to create mDNS CNAMEs for Traefik exposed containers
https://github.com/graugans/traefik-avahi-helper
avahi go golang link-local traefik
Last synced: about 1 month ago
JSON representation
A lightweight 🪶 container to create mDNS CNAMEs for Traefik exposed containers
- Host: GitHub
- URL: https://github.com/graugans/traefik-avahi-helper
- Owner: graugans
- License: apache-2.0
- Created: 2024-01-05T10:10:11.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-19T12:47:15.000Z (8 months ago)
- Last Synced: 2024-06-21T21:06:11.634Z (6 months ago)
- Topics: avahi, go, golang, link-local, traefik
- Language: Go
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
When using the reverse proxy [Træfik](https://traefik.io) in a local setup one may have the need to create a custom Avahi CNAME like `traefik.local` automatically when a container is created and routed by traefik. This lightweight helper container provides a Go binary which handles the communication to both the Docker daemon and the avahi daemon.
## Motivation
At home I assume most of the people have some sort of a broadband router which handles DHCP and DNS. If you are like me and do not want to mess around with DNS and run your own DNS server inside your home network than [mDNS or zeroconf](https://en.wikipedia.org/wiki/Zero-configuration_networking#Avahi) may come handy.
When working with the reverse Proxy [Træfik](https://traefik.io) most of the configuration options can be performed by Docker Labels, why not automatically register the mDNS entries based on those labels.
There is a great article by [Andrew Dupont](https://andrewdupont.net/2022/01/27/using-mdns-aliases-within-your-home-network/) about why and how to announce mDNS addresses.
## Alternatives
There are a couple of alternatives to this approach
- **[go-avahi-cname](https://github.com/grishy/go-avahi-cname)**, the idea of this project is to register specific CNAMEs or subdomains based on a **F**ull **Q**ualified **D**omain **N**ame (fqdn). This comes handy when you are looking for `*..local`. In this case no access to the Docker socket is required only access to the DBus socket.
- **[hardillb/traefik-avahi-helper](https://github.com/hardillb/traefik-avahi-helper)**, this is basically the same approach as this project. It uses a NodeJS and Python mix to achieve the goal.
## Project status
This is a WIP so please do not expect a working solution.
## Usage
The intended use case is to run the Docker Container and provide both the Docker socket and the DBus socket to this container.
- `/var/run/docker.sock`, is the default Docker socket. This can be overwritten with the Environment variable `"DOCKER_HOST": "unix:///var/run/docker-host.sock"`
- `/var/run/dbus/system_bus_socket`, is the default System DBus socket.### Configuration
The only configuration parameter for the `traefik-avahi-helper` is the environment variable `CNAME_TTL` with a default of `600`.
## LICENSE
This software is released under the Apache-2 license. See the [LICENSE](LICENSE) file for details. Some of the resources are released under the MIT License. Please check the related files.