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
+30
View File
@@ -0,0 +1,30 @@
package dnsproviders
import (
"github.com/caddyserver/certmagic"
"github.com/libdns/godaddy"
)
func init() {
Register(&Provider{
Names: []string{"godaddy"},
EnvVars: []string{"GODADDY_API_TOKEN"},
Build: func(env map[string]string) (certmagic.DNSProvider, error) {
// GoDaddy auth header format: "sso-key KEY:SECRET"
// Pass the full "KEY:SECRET" pair via GODADDY_API_TOKEN, OR set
// GODADDY_API_KEY + GODADDY_API_SECRET and we'll join them.
token := firstOf(env, "GODADDY_API_TOKEN")
if token == "" {
key := firstOf(env, "GODADDY_API_KEY")
secret := firstOf(env, "GODADDY_API_SECRET")
if key != "" && secret != "" {
token = key + ":" + secret
}
}
if token == "" {
return nil, missingEnvErr("godaddy", "GODADDY_API_TOKEN", "GODADDY_API_KEY+GODADDY_API_SECRET")
}
return &godaddy.Provider{APIToken: token}, nil
},
})
}