feat(cert): add registry-based DNS provider system with 21 libdns providers

Refs #37
This commit is contained in:
xboard
2026-04-20 03:01:21 +08:00
parent 07c37023ab
commit 68ca2d2716
31 changed files with 1575 additions and 48 deletions
+29
View File
@@ -0,0 +1,29 @@
package dnsproviders
import (
"github.com/caddyserver/certmagic"
"github.com/libdns/ovh"
)
func init() {
Register(&Provider{
Names: []string{"ovh"},
EnvVars: []string{
"OVH_ENDPOINT", "OVH_APPLICATION_KEY", "OVH_APPLICATION_SECRET", "OVH_CONSUMER_KEY",
},
Build: func(env map[string]string) (certmagic.DNSProvider, error) {
appKey := firstOf(env, "OVH_APPLICATION_KEY")
appSecret := firstOf(env, "OVH_APPLICATION_SECRET")
consumerKey := firstOf(env, "OVH_CONSUMER_KEY")
if appKey == "" || appSecret == "" || consumerKey == "" {
return nil, missingEnvErr("ovh", "OVH_APPLICATION_KEY", "OVH_APPLICATION_SECRET", "OVH_CONSUMER_KEY")
}
return &ovh.Provider{
Endpoint: firstOf(env, "OVH_ENDPOINT"),
ApplicationKey: appKey,
ApplicationSecret: appSecret,
ConsumerKey: consumerKey,
}, nil
},
})
}