Skip to content

ikarpovich/ddns-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddns-proxy

Token-authenticated DDNS proxy service.

Purpose

ddns-proxy receives a client token and an IP, then updates a configured DNS record at a DNS provider.

Use case:

  • edge nodes store only a client token
  • DNS provider credentials are stored only on the proxy service

API

POST /update

Headers:

  • Authorization: Bearer <client-token>

JSON body:

  • ip (optional string)

If ip is omitted, service uses caller IP. When trusted proxies are configured, forwarded headers are honored only for trusted proxy CIDRs.

Response:

  • JSON object: status, message, optional client

Config

Use one YAML file.

  • server.listen_addr
  • server.trusted_proxy_cidrs
  • server.read_timeout
  • server.write_timeout
  • clients[] : each client maps token auth to one record update

Token fields:

  • token (raw)
  • token_hash (bcrypt or sha256:<hex>)

Provider fields:

  • provider (currently implemented: cloudflare)
  • record
  • credentials

See config.example.yaml.

Run

go run ./cmd/ddns-proxy -config config.example.yaml

Run (Docker)

docker run --rm -p 8080:8080 \
  -v "$(pwd)/config.example.yaml:/config.yaml:ro" \
  ghcr.io/ikarpovich/ddns-proxy:latest \
  -config /config.yaml

Test

go test ./...

About

Secure DDNS Proxy

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors