Sign inSign up

n6g7/bingo

By n6g7

•Updated about 1 year ago

Automate DNS record creation for reverse proxies.

Image
0

3.2K

n6g7/bingo repository overview

⁠Bingo

Bingo automates the creation of DNS records for services served by a reverse proxy.

The original idea (and currently only supported scenario) was to run alongside Fabio⁠ (hence⁠ the name⁠).

⁠Architecture

Bingo Architecture

⁠Requirements

  • A supported nameserver⁠
  • A supported reverse proxy⁠
  • A "service parent domain" to register your service domains under. For example, with "svc.local" as a service parent domain, Bingo will:
    • Assume "ownership" of every subdomain of "svc.local" in the nameserver, meaning it will:
      • only ever create subdomains of "svc.local"
      • delete subdomains of "svc.local" it does not recognise
    • For a service named "myapp", create the subdomain "myapp.svc.local"
    • For a service named "home-assistant", create the subdomain "home-assistant.svc.local"
    • etc.

⁠Usage

⁠Docker CLI
docker run -d \
    -e FABIO_HOSTS="host1.local host2.local" \
    -e PIHOLE_URL=http://pihole.local:80 \
    -e PIHOLE_PASSWORD=abc123 \
    -e SERVICE_DOMAIN=svc.local \
    -e TARGETS="host1.local host2.local" \
    n6g7/bingo
⁠Docker Compose
version: "3"

services:
  bingo:
    image: n6g7/bingo
    environment:
      FABIO_HOSTS: host1.local host2.local
      PIHOLE_URL: http://pihole.local:80
      PIHOLE_PASSWORD: "abc123"
      SERVICE_DOMAIN: svc.local
      TARGETS: host1.local host2.local
    restart: unless-stopped
⁠Nomad + Consul
job "bingo" {
  datacenters = ["dc1"]
  type        = "service"

  group "bingo" {
    service {
      name = "bingo"
    }

    task "bingo" {
      driver = "docker"

      config {
        image = "n6g7/bingo"
      }

      template {
        destination = "secrets/bingo.env"
        env = true

        data = <<EOH
        FABIO_HOSTS="{{ range service "fabio" }}{{ .Address }} {{ end }}"
        PIHOLE_URL=http://pihole.local:80
        PIHOLE_PASSWORD="abc123"
        SERVICE_DOMAIN=svc.local
        TARGETS="host1.local host2.local"
        EOH
      }

      resources {
        cpu    = 50
        memory = 32
      }
    }
  }
}

⁠Configuration

Bingo aims to require the least configuration possible, however we're not quite there yet.

All configuration is passed as environment variables.

⁠Minimum config for Fabio and Pi-hole
Variable nameExampleDescription
FABIO_HOSTShost1.local host2.localHosts where Fabio is running.
PIHOLE_URLhttp://pihole.local:80Address of the Pi-hole instance.
PIHOLE_PASSWORDabc123Pi-hole admin password.
SERVICE_DOMAINsvc.localDomain under which service subdomains should be created.
TARGETShost1.local host2.localSpace-separated list of target domains.
⁠Complete config
Variable nameDefaultDescription
PROXY_TYPEfabioThe type of proxy to fetch services from. Currently only supports "fabio".
FABIO_HOSTSList of space-separated hosts where Fabio is running.
FABIO_ADMIN_PORT9998Fabio's admin UI port⁠.
FABIO_SCHEMEhttpURI scheme for Fabio
NAMESERVER_TYPEpiholeThe type of nameserver to managed records in. Currently only supports "pihole".
PIHOLE_URLAddress of the Pi-hole instance.
PIHOLE_PASSWORDPi-hole admin password.
SERVICE_DOMAINDomain under which service subdomains should be created. Any service with a declared domain that does not match "*.$SERVICE_DOMAIN" will be ignored. Bingo only ever creates or deletes subdomains of SERVICE_DOMAIN.
TARGETSSpace-separated list of target domains to point to in managed CNAME records. When creating a new service domain, Bingo will pick a target at random in this list.
LOG_LEVELINFOLogging verbosity. Supports "TRACE", "DEBUG", "INFO", "WARN", "ERROR" and "FATAL".

⁠Backends

⁠Reverse proxies
NameStatus
Fabio⁠✅ Supported
Træfik⁠⏳ Issue opened⁠
⁠Nameservers

Tag summary

Content type

Image

Digest

sha256:56db157d2…

Size

8.8 MB

Last updated

about 1 year ago

docker pull n6g7/bingo