Skip to content

Commit

Permalink
feat(config): read both owner and domain from domain
Browse files Browse the repository at this point in the history
- retro-compatible change: keep using host/owner if set
- otherwise extract owner and eTLD+1 from domain field
- documentation updated to only use the `domain` field
  • Loading branch information
qdm12 committed Jun 27, 2024
1 parent 55d8c0d commit 07d7645
Show file tree
Hide file tree
Showing 51 changed files with 175 additions and 169 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ This readme and the [docs/](docs/) directory are **versioned** to match the prog
"settings": [
{
"provider": "namecheap",
"domain": "example.com",
"owner": "@",
"domain": "sub.example.com",
"password": "e5322165c1d74692bfa6d807100c0310"
}
]
Expand Down Expand Up @@ -165,8 +164,7 @@ This readme and the [docs/](docs/) directory are **versioned** to match the prog
"settings": [
{
"provider": "namecheap",
"domain": "example.com",
"owner": "@",
"domain": "sub.example.com",
"password": "e5322165c1d74692bfa6d807100c0310"
}
]
Expand Down Expand Up @@ -256,7 +254,7 @@ Check the documentation for your DNS provider:

Note that:

- you can specify multiple hosts for the same domain using a comma separated list. For example with `"owner": "@,subdomain1,subdomain2",`.
- you can specify multiple owners/hosts for the same domain using a comma separated list. For example with `"domain": "example.com,sub.example.com,sub2.example.com",`.

### Environment variables

Expand Down
4 changes: 1 addition & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
"provider": "namecheap",
"domain": "example.com",
"owner": "@",
"password": "e5322165c1d74692bfa6d807100c0310"
},
{
Expand All @@ -13,8 +12,7 @@
},
{
"provider": "godaddy",
"domain": "example.org",
"owner": "subdomain",
"domain": "subdomain.example.org",
"key": "aaaaaaaaaaaaaaaa",
"secret": "aaaaaaaaaaaaaaaa"
},
Expand Down
4 changes: 1 addition & 3 deletions docs/aliyun.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "aliyun",
"domain": "domain.com",
"owner": "@",
"access_key_id": "your access_key_id",
"access_secret": "your access_secret",
"ip_version": "ipv4",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"access_key_id"`
- `"access_secret"`

Expand Down
6 changes: 2 additions & 4 deletions docs/allinkl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"settings": [
{
"provider": "allinkl",
"domain": "domain.com",
"owner": "sub",
"domain": "sub.domain.com",
"username": "dynXXXXXXX",
"password": "password",
"ip_version": "ipv4",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"username"` username (usually starts with dyn followed by numbers)
- `"password"` password in plain text

Expand Down
6 changes: 2 additions & 4 deletions docs/changeip.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"settings": [
{
"provider": "changeip",
"domain": "domain.com",
"owner": "sub",
"domain": "sub.domain.com",
"username": "dynXXXXXXX",
"password": "password",
"ip_version": "ipv4",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"username"`
- `"password"`

Expand Down
4 changes: 1 addition & 3 deletions docs/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"provider": "cloudflare",
"zone_identifier": "some id",
"domain": "domain.com",
"owner": "@",
"ttl": 600,
"token": "yourtoken",
"ip_version": "ipv4",
Expand All @@ -24,8 +23,7 @@
### Compulsory parameters

- `"zone_identifier"` is the Zone ID of your site, from the domain overview page written as *Zone ID*
- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
See [this issue comment for context](https://github.com/qdm12/ddns-updater/issues/243#issuecomment-928313949). This is left as is for compatibility.
- `"ttl"` integer value for record TTL in seconds (specify 1 for automatic)
- One of the following ([how to find API keys](https://developers.cloudflare.com/fundamentals/api/get-started/)):
Expand Down
4 changes: 1 addition & 3 deletions docs/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Feel free to open issues to extend its configuration options.
{
"provider": "custom",
"domain": "example.com",
"owner": "@",
"url": "https://example.com/update?domain=example.com&host=@&username=username&client_key=client_key",
"ipv4key": "ipv4",
"ipv6key": "ipv6",
Expand All @@ -29,8 +28,7 @@ Feel free to open issues to extend its configuration options.

### Compulsory parameters

- `"domain"` is the domain name to update
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"url"` is the URL to update your records and should contain all the information EXCEPT the IP address to update
- `"ipv4key"` is the URL query parameter name for the IPv4 address, for example `ipv4` will be added to the URL with `&ipv4=1.2.3.4`.
- `"ipv6key"` is the URL query parameter name for the IPv6 address, for example `ipv6` will be added to the URL with `&ipv6=::aaff`. Even if you don't use IPv6, this must be set to something.
Expand Down
4 changes: 1 addition & 3 deletions docs/dd24.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dd24",
"domain": "domain.com",
"owner": "@",
"password": "password",
"ip_version": "ipv4",
"ipv6_suffix": ""
Expand All @@ -21,8 +20,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"password"` is your password

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/ddnss.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"provider": "ddnss",
"provider_ip": true,
"domain": "domain.com",
"owner": "@",
"username": "user",
"password": "password",
"dual_stack": false,
Expand All @@ -24,8 +23,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"username"`
- `"password"`

Expand Down
6 changes: 2 additions & 4 deletions docs/desec.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"settings": [
{
"provider": "desec",
"domain": "dedyn.io",
"owner": "sub",
"domain": "sub.dedyn.io",
"token": "token",
"ip_version": "ipv4",
"ipv6_suffix": "",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"token"` is your token that you can create [here](https://desec.io/tokens)

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/digitalocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "digitalocean",
"domain": "domain.com",
"owner": "@",
"token": "yourtoken",
"ip_version": "ipv4",
"ipv6_suffix": ""
Expand All @@ -21,8 +20,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"token"` is your token that you can create [here](https://cloud.digitalocean.com/settings/applications)

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/dnsomatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dnsomatic",
"domain": "domain.com",
"owner": "@",
"username": "username",
"password": "password",
"provider_ip": true,
Expand All @@ -23,8 +22,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"username"`
- `"password"`
- `"provider_ip"`
Expand Down
4 changes: 1 addition & 3 deletions docs/dnspod.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dnspod",
"domain": "domain.com",
"owner": "@",
"token": "yourtoken",
"ip_version": "ipv4",
"ipv6_suffix": ""
Expand All @@ -21,8 +20,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"token"`

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/dondominio.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dondominio",
"domain": "domain.com",
"owner": "@",
"name": "something",
"username": "username",
"key": "key",
Expand All @@ -23,8 +22,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"name"` is the name of the service/hosting
- `"username"`
- `"password"`
Expand Down
3 changes: 1 addition & 2 deletions docs/dreamhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dreamhost",
"domain": "domain.com",
"owner": "@",
"key": "key",
"ip_version": "ipv4",
"ipv6_suffix": ""
Expand All @@ -26,7 +25,7 @@

### Optional parameters

- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"ip_version"` can be `ipv4` (A records), or `ipv6` (AAAA records) or `ipv4 or ipv6` (update one of the two, depending on the public ip found). It defaults to `ipv4 or ipv6`.
- `"ipv6_suffix"` is the IPv6 interface identifier suffix to use. It can be for example `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it defaults to no suffix and the raw public IPv6 address obtained is used in the record updating.

Expand Down
4 changes: 2 additions & 2 deletions docs/duckdns.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"settings": [
{
"provider": "duckdns",
"owner": "sub",
"domain": "sub.duckdns.org",
"token": "token",
"ip_version": "ipv4",
"ipv6_suffix": "",
Expand All @@ -21,7 +21,7 @@

### Compulsory parameters

- `"owner"` is the resource record owner and can be for example `"sub"` for the domain `sub.duckdns.org`
- `"domain"` is the domain to update. For example, for the owner/host `sub`, it would be `sub.duckdns.org`. The [eTLD+1](https://developer.mozilla.org/en-US/docs/Glossary/eTLD) must be `duckdns.org`.
- `"token"`

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/dyndns.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dyn",
"domain": "domain.com",
"owner": "@",
"username": "username",
"client_key": "client_key",
"ip_version": "ipv4",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"username"`
- `"client_key"`

Expand Down
4 changes: 1 addition & 3 deletions docs/dynu.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dynu",
"domain": "domain.com",
"owner": "@",
"group": "group",
"username": "username",
"password": "password",
Expand All @@ -24,8 +23,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"username"`
- `"password"` could be plain text or password in MD5 or SHA256 format (There's also an option for setting a password for IP Update only)

Expand Down
4 changes: 1 addition & 3 deletions docs/dynv6.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "dynv6",
"domain": "domain.com",
"owner": "@",
"token": "token",
"ip_version": "ipv4",
"ipv6_suffix": "",
Expand All @@ -22,8 +21,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
- `"token"` that you can obtain [here](https://dynv6.com/keys#token)

### Optional parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/easydns.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"provider": "easydns",
"domain": "domain.com",
"owner": "@",
"username": "username",
"token": "token",
"ip_version": "ipv4",
Expand All @@ -23,8 +22,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"username"`
- `"token"`

Expand Down
4 changes: 1 addition & 3 deletions docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
{
"provider": "example",
"domain": "domain.com",
"owner": "@",
"username": "username",
"password": "password",
"ip_version": "ipv4",
Expand All @@ -24,8 +23,7 @@

### Compulsory parameters

- `"domain"`
- `"owner"` is the resource record owner and can be `"@"` for the root domain, `"*"` for the wildcard, or for example `"sub"` for the subdomain `sub.domain.com`
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
- `"username"`
- `"password"`

Expand Down
Loading

0 comments on commit 07d7645

Please sign in to comment.