From ea31f0402d976b71468676a37c1b306c89c41240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Wei=C3=9F?= <72068105+Sandoun@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:16:08 +0100 Subject: [PATCH] Name fix - update readme --- README.md | 35 ++++++++++++++++++++++++++++++++++- src/DynDNSv2/Updater.cs | 4 ++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53cad26..629eb9b 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# DynDNSv2 \ No newline at end of file +# DynDNSv2 + +This is a docker wrapper arround the DynDNS v2 API that automatically updates the DNS server whenever the public IP of the system changes. + +# Usage + +## Docker Compose + +This is an example using the strato.de DynDNS api + +```yaml +version: "3" +services: + dyndnsv2: + image: ghcr.io/sandoun/dyndnsv2:latest + container_name: dyndnsv2 + environment: + - UPDATE_URL=https://dyndns.strato.com/nic/update + - USERNAME=*YOUR USERNAME* + - PASSWORD=*YOUR PASSWORD* + - UPDATE_DOMAIN_1=domain.com + - UPDATE_DOMAIN_2=subdomain1.domain.com + - UPDATE_DOMAIN_3=subdomain2.domain.com + #add more by incrementing by 1 +``` + +## Environment Variables + +|Name|Description|Example| +|----|-----|-------| +|UPDATE_URL|The update URL of your provider|https://dyndns.strato.com/nic/update| +|USERNAME|Your login username|Username| +|PASSWORD|Your login password|Password123| +|UPDATE_DOMAIN_[N]|A domain to update, it starts with N=1 and increments by 1 for each additional one|domain.com \ No newline at end of file diff --git a/src/DynDNSv2/Updater.cs b/src/DynDNSv2/Updater.cs index 05af876..f80ff9c 100644 --- a/src/DynDNSv2/Updater.cs +++ b/src/DynDNSv2/Updater.cs @@ -63,7 +63,7 @@ internal class Updater : BackgroundService int i = 1; while(true) { - var found = Environment.GetEnvironmentVariable($"UPDATE_URL_{i}"); + var found = Environment.GetEnvironmentVariable($"UPDATE_DOMAIN_{i}"); if(!string.IsNullOrEmpty(found)) { @@ -78,7 +78,7 @@ internal class Updater : BackgroundService } if(updateLst.Count <= 0) - throw new Exception("No UPDATE_URL_[N] env variable found, pleace specify one with UPDATE_URL_1, UPDATE_URL_2 ..."); + throw new Exception("No UPDATE_DOMAIN_[N] env variable found, pleace specify one with UPDATE_DOMAIN_1, UPDATE_DOMAIN_2 ..."); updateDomains = updateLst.ToArray();