OmadaSiteDns

command module
v0.0.0-...-4ca1b7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Unlicense Imports: 11 Imported by: 0

README

OmadaSiteDns

DNS server for hostname and reverse DNS lookups in a omada site.

Hostnames

Hostnames are generated by converting the omada client names to valid hostnames.

Criteria
  • less than 254 characters in length
  • are lowercase
  • contain only a-z, 0-9, - and .
  • don't start or end with - or .
Conversion
  1. client name is converted to lowercase
  2. loop through converters and replace every regex match with its substitute
  3. delete remaining invalid characters

Exposed ports

The server for those protocolls are enabled with the OSD_SERVER_UDP and OSD_SERVER_TCP variable.

The service won't start if both servers are disabled.

Port Protocoll Purpose
53 UDP & TCP DNS server

Environment variables

All variables can be set eighter through the environment or with docker-secrets.

Environment Type Description Default Required
OSD_VERBOSE Int Enhanced logging for debugging purpose (1=active / 2=advanced) 0
OSD_SITE_URL String Controller url (Example: https://192.168.0.2)
OSD_SITE_SITE String Site name as seen in the web interface Default
OSD_SITE_USERNAME String Login username (it is strongly advised to create a seperate account for each application & site)
OSD_SITE_PASSWORD String Login password
OSD_SITE_SKIPVERIFY Bool Skip SSL verification (has to be true if the url is an IP address or self signed certificates are used) False
OSD_SERVER_TTL Time TTL of the DNS responses 5m
OSD_SERVER_UDP Bool Start UDP server True
OSD_SERVER_TCP Bool Start TCP server True
OSD_CRAWLER_HOSTINTERVALL Time Time between client data fetches 5m
OSD_CRAWLER_NETWORKINTERVALL Time Time between network data fetches 60m
OSD_CRAWLER_CONVERTERS_n_REGEX String Regex for hostname conversion (n is the numeric converter id(0,1,...))
OSD_CRAWLER_CONVERTERS_n_SUBSTITUTE String Substitution for the regex (n is the numeric converter id(0,1,...))
OSD_CRAWLER_NETWORK_n_NAME String Network name for domain override (n is the numeric converter id(0,1,...))
OSD_CRAWLER_NETWORK_n_DOMAIN String New domain for the specified network (n is the numeric converter id(0,1,...))

docker-compose example

version: '3.8'

services:
  dns:
    image: ghcr.io/kwitsch/omadasitedns
    environment:
    # omada controller settings
      - OSD_SITE_URL=https://192.168.0.2
      - OSD_SITE_USERNAME=api-user
      - OSD_SITE_PASSWORD=api-user-password
      - OSD_SITE_SKIPVERIFY=True
    # only open udp server
      - OSD_SERVER_TCP=False
    # replace umlauts
      - OSD_CRAWLER_CONVERTERS_1_REGEX=ü
      - OSD_CRAWLER_CONVERTERS_1_SUBSTITUTE=ue
      - OSD_CRAWLER_CONVERTERS_2_REGEX=ä
      - OSD_CRAWLER_CONVERTERS_2_SUBSTITUTE=ae
      - OSD_CRAWLER_CONVERTERS_3_REGEX=ö
      - OSD_CRAWLER_CONVERTERS_3_SUBSTITUTE=oe
    # override domain for network LAN to local
      - OSD_CRAWLER_NETWORK_1_NAME=LAN
      - OSD_CRAWLER_NETWORK_1_DOMAIN=local
    ports:
      - "53:53/udp"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis