provider: readd Gandi provider

This commit is contained in:
nemunaire 2021-07-06 16:58:55 +02:00
parent fb61ba3d14
commit f9d93c0d9e
5 changed files with 69 additions and 0 deletions

1
go.sum
View File

@ -131,6 +131,7 @@ github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjX
github.com/go-acme/lego v2.7.2+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M=
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
github.com/go-gandi/go-gandi v0.0.0-20200921091836-0d8a64b9cc09 h1:w+iZczt5J4LJa13RX5uguKI866vIEMOESgXr4XcwrwA=
github.com/go-gandi/go-gandi v0.0.0-20200921091836-0d8a64b9cc09/go.mod h1:Vv36tv/GTi8FNAFIQ88+9GPHm4CAihAuJu7rfqRJ9aY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=

BIN
providers/GandiAPI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

1
providers/gandi.svg Normal file
View File

@ -0,0 +1 @@
<svg height="50" width="30.986" viewBox="0 0 30.986 50" aria-hidden="true" fill="#1aa"><path d="M29.67 11.566c-1.406-.995-3.35-.662-4.346.743-1.22 1.72-2.572 3-4.11 3.88-.14.08-.285.16-.43.23-.134.07-.27.13-.407.2-1.436.66-3.035 1.01-4.884 1.07-1.85-.06-3.448-.41-4.885-1.07-1.89-.88-3.51-2.29-4.947-4.33-.99-1.41-2.93-1.74-4.34-.75-1.4.99-1.74 2.94-.74 4.34 2.06 2.91 4.55 5.06 7.42 6.39.57.26 1.14.49 1.73.69-2.43 1.76-5.06 4.22-6.33 7.6-1.31 3.504-1.29 7.3.05 10.685 1.29 3.25 3.66 5.89 6.69 7.44 3.38 1.727 7.68 1.73 11.5.01 4.01-1.806 6.63-5.11 7-8.846.39-3.93-1.49-7.43-4.8-8.916-3.42-1.54-7.29-.444-9.84 2.794-1.07 1.35-.837 3.31.514 4.38 1.35 1.07 3.31.84 4.38-.51.76-.96 1.64-1.318 2.4-.97.66.29 1.3 1.13 1.16 2.61-.145 1.462-1.43 2.91-3.355 3.78-2.086.935-4.425.982-6.108.122-1.68-.86-3-2.345-3.73-4.18-.54-1.38-.99-3.58 0-6.22.74-1.98 2.6-3.85 5.86-5.875 1.38-.86 2.87-1.663 4.3-2.44 1.655-.895 3.22-1.744 4.6-2.653 2.45-1.34 4.608-3.317 6.42-5.88.995-1.405.66-3.35-.743-4.344zM13.825 5.698c.4-.4.93-.62 1.494-.62s1.09.22 1.49.62c.4.4.62.93.62 1.495 0 .564-.22 1.095-.62 1.494-.4.4-.93.62-1.5.62s-1.1-.22-1.5-.62c-.4-.4-.62-.93-.62-1.494 0-.565.22-1.095.62-1.495zm1.494 8.688c1.92 0 3.72-.75 5.08-2.107 1.36-1.36 2.1-3.17 2.1-5.09s-.74-3.73-2.1-5.09C19.05.74 17.24 0 15.32 0s-3.727.748-5.086 2.107C8.874 3.465 8.127 5.27 8.127 7.192c0 1.922.748 3.728 2.107 5.087 1.358 1.35 3.165 2.1 5.086 2.1z"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

65
providers/gandiv5.go Normal file
View File

@ -0,0 +1,65 @@
// Copyright or © or Copr. happyDNS (2021)
//
// contact@happydns.org
//
// This software is a computer program whose purpose is to provide a modern
// interface to interact with DNS systems.
//
// This software is governed by the CeCILL license under French law and abiding
// by the rules of distribution of free software. You can use, modify and/or
// redistribute the software under the terms of the CeCILL license as
// circulated by CEA, CNRS and INRIA at the following URL
// "http://www.cecill.info".
//
// As a counterpart to the access to the provider code and rights to copy, modify
// and redistribute granted by the license, users are provided only with a
// limited warranty and the software's author, the holder of the economic
// rights, and the successive licensors have only limited liability.
//
// In this respect, the user's attention is drawn to the risks associated with
// loading, using, modifying and/or developing or reproducing the software by
// the user in light of its specific status of free software, that may mean
// that it is complicated to manipulate, and that also therefore means that it
// is reserved for developers and experienced professionals having in-depth
// computer knowledge. Users are therefore encouraged to load and test the
// software's suitability as regards their requirements in conditions enabling
// the security of their systems and/or data to be ensured and, more generally,
// to use and operate it in the same conditions as regards security.
//
// The fact that you are presently reading this means that you have had
// knowledge of the CeCILL license and that you accept its terms.
package providers // import "happydns.org/providers"
import (
"github.com/StackExchange/dnscontrol/v3/providers"
_ "github.com/StackExchange/dnscontrol/v3/providers/gandiv5"
"git.happydns.org/happydns/model"
)
type GandiAPI struct {
APIKey string `json:"api_key,omitempty" happydns:"label=API Key,placeholder=xxxxxxxxxx,required,description=Get your API Key in the Security section under https://account.gandi.net/. Copy the corresponding key."`
SharingID string `json:"sharing_id,omitempty" happydns:"label=Sharing ID,placeholder=xxxxxxxxxx,description=If you are member of multiple organizations this identifier selects the one to manage."`
}
func (s *GandiAPI) NewDNSServiceProvider() (providers.DNSServiceProvider, error) {
config := map[string]string{
"apikey": s.APIKey,
"sharing_id": s.SharingID,
}
return providers.CreateDNSProvider(s.DNSControlName(), config, nil)
}
func (s *GandiAPI) DNSControlName() string {
return "GANDI_V5"
}
func init() {
RegisterProvider(func() happydns.Provider {
return &GandiAPI{}
}, ProviderInfos{
Name: "Gandi",
Description: "French hosting provider.",
})
}

File diff suppressed because one or more lines are too long