Loopia Provider

This commit is contained in:
Paul 2023-02-23 04:11:54 +01:00 committed by nemunaire
parent 2c29512ef1
commit 9d59fa5bea
2 changed files with 71 additions and 0 deletions

6
providers/Loopia.svg Normal file
View File

@ -0,0 +1,6 @@
<svg viewBox="0 0 137 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M37.3488 11.0492L34.6424 4.51546C34.3454 3.79685 33.7736 3.22621 33.0561 2.92912L26.5224 0.222816C25.8038 -0.0742721 24.9966 -0.0742721 24.278 0.222816L17.7443 2.92912C17.0257 3.22621 16.455 3.79797 16.1579 4.51546L13.4516 11.0492C13.1545 11.7678 13.1545 12.575 13.4516 13.2936L16.1579 19.8273C16.455 20.5459 17.0268 21.1165 17.7443 21.4136L24.278 24.1199C24.9966 24.417 25.8038 24.417 26.5224 24.1199L33.0561 21.4136C33.7747 21.1165 34.3454 20.5448 34.6424 19.8273L37.3488 13.2936C37.647 12.575 37.647 11.7678 37.3488 11.0492Z" fill="#FF7DFA"/>
<path d="M50.0451 1.96486H45.637V22.3788H59.3647V18.3249H50.0451V1.96486ZM68.9208 7.3786C64.3053 7.3786 60.9622 10.6925 60.9622 15.0121C60.9622 19.3608 64.3053 22.6747 68.9208 22.6747C73.5655 22.6747 76.9086 19.3608 76.9086 15.0121C76.9086 10.6925 73.5655 7.3786 68.9208 7.3786ZM68.9208 19.1242C66.7908 19.1242 65.2526 17.4381 65.2526 15.0121C65.2526 12.6163 66.7908 10.9291 68.9208 10.9291C71.0801 10.9291 72.6193 12.6152 72.6193 15.0121C72.6193 17.4381 71.0812 19.1242 68.9208 19.1242ZM86.4973 7.3786C81.8817 7.3786 78.5387 10.6925 78.5387 15.0121C78.5387 19.3608 81.8817 22.6747 86.4973 22.6747C91.1419 22.6747 94.485 19.3608 94.485 15.0121C94.485 10.6925 91.1419 7.3786 86.4973 7.3786ZM86.4973 19.1242C84.3672 19.1242 82.8291 17.4381 82.8291 15.0121C82.8291 12.6163 84.3672 10.9291 86.4973 10.9291C88.6565 10.9291 90.1957 12.6152 90.1957 15.0121C90.1957 17.4381 88.6565 19.1242 86.4973 19.1242ZM105.392 7.3786C103.41 7.3786 101.724 8.2665 100.599 9.83378V7.67456H96.457V27.9999H100.747V20.3373C101.842 21.8754 103.499 22.6747 105.392 22.6747C109.297 22.6747 112.226 19.3608 112.226 15.0121C112.226 10.6925 109.297 7.3786 105.392 7.3786ZM104.297 19.1242C102.196 19.1242 100.687 17.409 100.687 15.0121C100.687 12.6455 102.196 10.9291 104.297 10.9291C106.427 10.9291 107.936 12.6443 107.936 15.0121C107.936 17.4079 106.428 19.1242 104.297 19.1242ZM114.231 22.3788H118.521V7.67456H114.231V22.3788ZM132.127 7.67456V9.8349C131.002 8.2665 129.316 7.37972 127.334 7.37972C123.429 7.37972 120.5 10.6937 120.5 15.0132C120.5 19.3619 123.429 22.6758 127.334 22.6758C129.228 22.6758 130.884 21.8776 131.979 20.3384V22.3799H136.269V7.67456H132.127ZM128.429 19.1242C126.299 19.1242 124.79 17.409 124.79 15.0121C124.79 12.6455 126.299 10.9291 128.429 10.9291C130.53 10.9291 132.039 12.6443 132.039 15.0121C132.038 17.4079 130.529 19.1242 128.429 19.1242ZM116.906 0.90207C116.613 0.609466 116.139 0.609466 115.845 0.90207L113.918 2.82922C113.625 3.12182 113.625 3.59604 113.918 3.88977L115.845 5.81692C116.138 6.10952 116.612 6.10952 116.906 5.81692L118.833 3.88977C119.125 3.59717 119.125 3.12295 118.833 2.82922L116.906 0.90207Z" fill="black"/>
<path d="M20.0358 14.8194V8.91803C20.0358 8.21847 19.6625 7.57161 19.0571 7.22183L13.9461 4.27112C13.3407 3.92134 12.594 3.92134 11.9875 4.27112L6.87648 7.22183C6.27109 7.57161 5.89777 8.21847 5.89777 8.91803V14.8194C5.89777 15.519 6.27109 16.1659 6.87648 16.5156L11.9875 19.4664C12.5929 19.8161 13.3395 19.8161 13.9461 19.4664L19.0571 16.5156C19.6625 16.1659 20.0358 15.519 20.0358 14.8194Z" fill="#FF2D2D"/>
<path d="M7.73187 11.3462L4.82937 8.44372C4.38878 8.00313 3.67353 8.00313 3.23294 8.44372L0.330441 11.3462C-0.110147 11.7868 -0.110147 12.5021 0.330441 12.9426L3.23294 15.8451C3.67353 16.2857 4.38878 16.2857 4.82937 15.8451L7.73187 12.9426C8.17245 12.5021 8.17245 11.7868 7.73187 11.3462Z" fill="#820500"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

65
providers/loopia.go Normal file
View File

@ -0,0 +1,65 @@
// Copyright or © or Copr. happyDNS (2023)
//
// contact@happydomain.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/loopia"
"git.happydns.org/happydomain/model"
)
type LoopiaAPI struct {
Username string `json:"username,omitempty" happydomain:"label=Username,placeholder=username@loopiaapi,required,description=Your Loopia API user name."`
Password string `json:"password,omitempty" happydomain:"label=Password,placeholder=xxxxxxxx,required,description=Your Loopia API password."`
}
func (s *LoopiaAPI) NewDNSServiceProvider() (providers.DNSServiceProvider, error) {
config := map[string]string{
"username": s.Username,
"password": s.Password,
}
return providers.CreateDNSProvider(s.DNSControlName(), config, nil)
}
func (s *LoopiaAPI) DNSControlName() string {
return "LOOPIA"
}
func init() {
RegisterProvider(func() happydns.Provider {
return &LoopiaAPI{}
}, ProviderInfos{
Name: "Loopia",
Description: "Swedish hosting and DNS provider.",
})
}