Skip to content

Commit

Permalink
Domainnameshop provider (#1625)
Browse files Browse the repository at this point in the history
* Added basic structure for domain name shop

* Finished proof of concept for domainnameshop

* Fixed handeling of IDNA for CNAME records

* Updated documentation notes

* Added docs

* Ran linter and vet

* Removed proxy config used for debugging

* Ran go generate

* Fixed issue with TTLs being restricted to a multiple of 60

* Ran tests, vet and linting and fixed flaws

* Fixed typo in docs

* Improved code based on feedback

* Fixed issues with TXT records not working properly

* Refactored according to new file layout proposed

* Updated documentation matrix

* Suggestions and corrections

* Corrected according to suggestions

Co-authored-by: Simen Bai <git@simenbai.no>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
  • Loading branch information
3 people authored Aug 1, 2022
1 parent befb52b commit e9510da
Show file tree
Hide file tree
Showing 12 changed files with 688 additions and 0 deletions.
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ providers/digitalocean @Deraen
providers/dnsimple @onlyhavecans
providers/dnsmadeeasy @vojtad
providers/doh @mikenz
providers/domainnameshop @SimenBai
providers/easyname @tresni
providers/exoscale @pierre-emmanuelJ
providers/gandi_v5 @TomOnTime
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Currently supported DNS providers:
- DNS Made Easy
- DNSimple
- DigitalOcean
- DomainNameShop (domeneshop)
- Exoscale
- Gandi
- Google DNS
Expand Down
56 changes: 56 additions & 0 deletions docs/_includes/matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<th class="rotate"><div><span>DNSIMPLE</span></div></th>
<th class="rotate"><div><span>DNSMADEEASY</span></div></th>
<th class="rotate"><div><span>DNSOVERHTTPS</span></div></th>
<th class="rotate"><div><span>DOMAINNAMESHOP</span></div></th>
<th class="rotate"><div><span>EASYNAME</span></div></th>
<th class="rotate"><div><span>EXOSCALE</span></div></th>
<th class="rotate"><div><span>GANDI_V5</span></div></th>
Expand Down Expand Up @@ -101,6 +102,9 @@
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -215,6 +219,9 @@
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -338,6 +345,9 @@
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -451,6 +461,9 @@
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
Expand Down Expand Up @@ -538,6 +551,9 @@
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
Expand Down Expand Up @@ -619,6 +635,9 @@
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
Expand Down Expand Up @@ -722,6 +741,9 @@
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
Expand Down Expand Up @@ -817,6 +839,9 @@
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
Expand Down Expand Up @@ -880,6 +905,9 @@
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
Expand Down Expand Up @@ -949,6 +977,9 @@
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success" data-toggle="tooltip" data-container="body" data-placement="top" title="SRV records with empty targets are not supported">
<i class="fa has-tooltip fa-check text-success" aria-hidden="true"></i>
Expand Down Expand Up @@ -1056,6 +1087,9 @@
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="success">
Expand Down Expand Up @@ -1141,6 +1175,9 @@
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
Expand Down Expand Up @@ -1240,6 +1277,7 @@
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
</tr>
<tr>
<th class="row-header" style="text-decoration: underline;" data-toggle="tooltip" data-container="body" data-placement="top" title="Provider supports Route 53 limited ALIAS">R53_ALIAS</th>
Expand All @@ -1263,6 +1301,7 @@
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger" data-toggle="tooltip" data-container="body" data-placement="top" title="Using ALIAS is possible through our extended DNS (X-DNS) service. Feel free to get in touch with us.">
<i class="fa has-tooltip fa-times text-danger" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -1315,6 +1354,7 @@
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -1367,6 +1407,9 @@
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger" data-toggle="tooltip" data-container="body" data-placement="top" title="Only supports DS records at the apex">
Expand Down Expand Up @@ -1458,6 +1501,7 @@
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
<td><i class="fa fa-minus dim"></i></td>
</tr>
<tr>
<th class="row-header" style="text-decoration: underline;" data-toggle="tooltip" data-container="body" data-placement="top" title="This provider is recommended for use in &#39;dual hosting&#39; scenarios. Usually this means the provider allows full control over the apex NS records">dual host</th>
Expand Down Expand Up @@ -1497,6 +1541,9 @@
<i class="fa has-tooltip fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="danger" data-toggle="tooltip" data-container="body" data-placement="top" title="Exoscale does not allow sufficient control over the apex NS records">
<i class="fa has-tooltip fa-times text-danger" aria-hidden="true"></i>
Expand Down Expand Up @@ -1606,6 +1653,9 @@
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -1735,6 +1785,9 @@
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td class="success">
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td class="danger">
<i class="fa fa-times text-danger" aria-hidden="true"></i>
</td>
Expand Down Expand Up @@ -1850,6 +1903,9 @@
<i class="fa fa-check text-success" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
</td>
<td><i class="fa fa-minus dim"></i></td>
<td class="info">
<i class="fa fa-circle-o text-info" aria-hidden="true"></i>
Expand Down
46 changes: 46 additions & 0 deletions docs/_providers/domainnameshop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: DomainNameShop
title: DomainNameShop Provider
layout: default
jsId: DOMAINNAMESHOP
---
# DOMAINNAMESHOP Provider

## Configuration

To use this provider, add an entry to `creds.json` with `TYPE` set to `DOMAINNAMESHOP`
along with your [DomainNameShop Token and Secret](https://www.domeneshop.no/admin?view=api).

Example:

```json
{
"mydomainnameshop": {
"TYPE": "DOMAINNAMESHOP",
"token": "your-domainnameshop-token",
"secret": "your-domainnameshop-secret"
}
}
```

## Metadata
This provider does not recognize any special metadata fields unique to DomainNameShop.

## Usage
An example `dnsconfig.js` configuration:

```js
var REG_NONE = NewRegistrar("none");
var DSP_DOMAINNAMESHOP = NewDnsProvider("mydomainnameshop");

D("example.tld", REG_NONE, DnsProvider(DSP_DOMAINNAMESHOP),
A("test", "1.2.3.4")
);
```

## Activation
[Create API Token and secret](https://www.domeneshop.no/admin?view=api)

## Limitations

- DomainNameShop DNS only supports TTLs which are a multiple of 60.
1 change: 1 addition & 0 deletions docs/provider-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Providers in this category and their maintainers are:
* `DNSOVERHTTPS` @mikenz
* `DNSIMPLE` @onlyhavecans
* `DNSMADEEASY` @vojtad
* `DOMAINNAMESHOP` @SimenBai
* `EASYNAME` @tresni
* `EXOSCALE` @pierre-emmanuelJ
* `GANDI_V5` @TomOnTime
Expand Down
5 changes: 5 additions & 0 deletions integrationTest/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,10 @@
"TRANSIP": {
"AccessToken": "$TRANSIP_ACCESS_TOKEN",
"domain": "$TRANSIP_DOMAIN"
},
"DOMAINNAMESHOP": {
"token": "$DOMAINNAMESHOP_TOKEN",
"secret": "$DOMAINNAMESHOP_SECRET",
"domain": "$DOMAINNAMESHOP_DOMAIN"
}
}
1 change: 1 addition & 0 deletions providers/_all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
_ "github.com/StackExchange/dnscontrol/v3/providers/dnsimple"
_ "github.com/StackExchange/dnscontrol/v3/providers/dnsmadeeasy"
_ "github.com/StackExchange/dnscontrol/v3/providers/doh"
_ "github.com/StackExchange/dnscontrol/v3/providers/domainnameshop"
_ "github.com/StackExchange/dnscontrol/v3/providers/easyname"
_ "github.com/StackExchange/dnscontrol/v3/providers/exoscale"
_ "github.com/StackExchange/dnscontrol/v3/providers/gandiv5"
Expand Down
Loading

0 comments on commit e9510da

Please # to comment.