Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet Another OVH Dyn Updater

Yet Another OVH Dyn Updater (YAODU).

Context: As the embedded updater of my Livebox kept suiciding, I needed a working solution. Other projects were not working for me. I needed: OVH API usage instead of the legacy endpoint for grainy and secured permissions, discord notifications, minimal footprint. It gave me an excuse to half vibe-code this simple go script.

Small Go CLI for OVH DynHost.

It does this on each run:

  1. Fetch current public IP.
  2. Find each configured DynHost record in OVH.
  3. Update only records whose IP changed.
  4. Send notification to Discord webhook if at least one record changed and webhook is configured.

Required env vars

export OVH_ENDPOINT=ovh-eu
export OVH_APPLICATION_KEY=your_app_key
export OVH_APPLICATION_SECRET=your_app_secret
export OVH_CONSUMER_KEY=your_consumer_key
export OVH_DYNHOSTS=home.example.com,vpn.example.com

Optional env vars

export DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
export LOOP_INTERVAL=5m
export RUN_ONCE=false
  • DISCORD_WEBHOOK_URL: Will notify IP changes on discord if set.
  • LOOP_INTERVAL: Sleep between iterations in service mode. Default: 5m.
  • RUN_ONCE: Default false. Set true to keep old single-run behavior and exit after one pass.

Supported OVH endpoints

  • ovh-eu
  • ovh-us
  • ovh-ca

Other go-ovh endpoints may also work if your DynHost lives there.

Usage

Docker (prefered)

Run with docker. Add optional environment variables as needed.

docker run -d --name yaodu \
	-e OVH_ENDPOINT=ovh-eu \
	-e OVH_APPLICATION_KEY=your_app_key \
	-e OVH_APPLICATION_SECRET=your_app_secret \
	-e OVH_CONSUMER_KEY=your_consumer_key \
	-e OVH_DYNHOSTS=home.example.com,vpn.example.com \
	-e LOOP_INTERVAL=5m \
	ghcr.io/harmdhast/yaodu

Build image yourself

docker build -t yaodu .

Run in service mode:

docker run -d --name yaodu \
	-e OVH_ENDPOINT=ovh-eu \
	-e OVH_APPLICATION_KEY=your_app_key \
	-e OVH_APPLICATION_SECRET=your_app_secret \
	-e OVH_CONSUMER_KEY=your_consumer_key \
	-e OVH_DYNHOSTS=home.example.com,vpn.example.com \
	-e LOOP_INTERVAL=5m \
	yaodu

Single run in container:

docker run --rm \
	-e OVH_ENDPOINT=ovh-eu \
	-e OVH_APPLICATION_KEY=your_app_key \
	-e OVH_APPLICATION_SECRET=your_app_secret \
	-e OVH_CONSUMER_KEY=your_consumer_key \
	-e OVH_DYNHOSTS=home.example.com,vpn.example.com \
	-e RUN_ONCE=true \
	yaodu

Directly using binary

go run .

Single run:

RUN_ONCE=true go run .

Or build binary:

go build -o yaodu .
./yaodu

How host matching works

Set full hostnames in OVH_DYNHOSTS.

Example:

export OVH_DYNHOSTS=home.example.com,example.com

Tool loads your OVH DNS zones from /domain/zone, picks best matching zone, then looks for matching DynHost record under /domain/zone/{zone}/dynHost/record.

Create OVH API credentials

Simplest path for one personal account: use OVH createToken page for your endpoint.

  • Europe: https://eu.api.ovh.com/createToken/
  • US: https://api.us.ovhcloud.com/createToken/
  • Canada: https://ca.api.ovh.com/createToken/

Create token with these rights:

  • GET /domain/zone
  • GET /domain/zone/*
  • PUT /domain/zone/*

Those rights cover:

  • listing your zones
  • reading DynHost records
  • updating DynHost record IPs

Save these three values from OVH:

  • application key
  • application secret
  • consumer key

Then export them into:

  • OVH_APPLICATION_KEY
  • OVH_APPLICATION_SECRET
  • OVH_CONSUMER_KEY

Also set OVH_ENDPOINT to matching endpoint name like ovh-eu.

Discord notification

Set one Discord webhook URL in DISCORD_WEBHOOK_URL if you want notifications.

Notification sent only when at least one DynHost record changed. If webhook env var is empty, notification step is skipped.

Embed includes:

  • current public IP
  • each hostname changed
  • old IP
  • new IP
  • timestamp

About

Yet Another OVH Dyn Updater.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages