hetzner-dyndns

command module
v0.0.0-...-860860b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 8 Imported by: 0

README

Hetzner DNS Based DynDns Service

A containerized microservice that utilizes Hetzner DNS Zone (manage your own at Hetzner DNS) to act as a DynDNS service that you may use with your home router. Provides a docker-container which spins up a single endpoint like so:

http://user:password@hetzner-dyndns:8053/?dnsRecordName={dynamicSubdomain}&ipv4={IPv4address}&ipv6=2{IPv6address}

Getting Started

git clone git@github.com:simsibimsiwimsi/hetzner-dyndns.git

go run main.go

For the above command to yield a meaningful result, you need to create a dyndns.yml config. Please refer to the Deployment section below for a proper configuration.

Prerequisites
  • A Hetzner account with a Hetzner DNS Zone for a domain registered with you set up.
  • AMD64 / x86-64 system architecture (you probably have to build from source for ARM).
  • curl installed.
  • jq installed.
Installing
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/simsibimsiwimsi/hetzner-dyndns/releases/latest | jq .assets[0].browser_download_url | xargs curl -L --output hetzner-dyndns.tar

docker load -i hetzner-dyndns.tar

Deployment

For a docker compose deployment add a service like so:

docker-compose.yml

services:
  hetzner-dyndns:
    image: hetzner-dyndns:latest
    pull_policy: never
    container_name: hetzner-dyndns
    expose:
      - "8053"
    volumes:
      - type: bind
        source: /your/path/to/hetzner-dyndns.yml
        target: /var/dyndns/dyndns.yml

Create a yaml config in /your/path/to/hetzner-dyndns.yml

hetzner:
  dns: 
    zone-id: "REPLACE_WITH_YOUR_HETZNER_DNS_ZONE_ID"
    auth-api-token: "REPLACE_WITH_YOUR_HETZNER_DNS_AUTH_API_TOKEN"

users:
  REPLACE_WITH_YOUR_SUBDOMAIN_1:
    user: REPLACE_WITH_YOUR_USER_1
    password: REPLACE_WITH_BCRYPT_HASH_OF_USER_PASSWORD_1
  REPLACE_WITH_YOUR_SUBDOMAIN_2:
    user: REPLACE_WITH_YOUR_USER_2
    password: REPLACE_WITH_BCRYPT_HASH_OF_USER_PASSWORD_2

Please note: auth-api-token is a plaintext secret that needs to be stored safely and securely.

Security Notice

(!) Write access to DNS records is sensible. Please ensure you take adequate steps to secure the service's runtime environment (like operating behind a firewall, hardening the server, operating behind a reverse proxy and or WAF) as well as the dyndns.yml configuration containing secret values.

Built With

Contributing

Have not thought about it, yet.

Versioning

No specific approach to versioning defined. Latest should always be greatest. Please refer to https://github.com/simsibimsiwimsi/hetzner-dyndns/releases for a list of releases.

License

This project is licensed under the MIT License - see the LICENSE file for details

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL