chore: remove legacy DNS providers (AliCloud, HuaweiCloud, WestCN, RainYun, Dode)
This commit is contained in:
@@ -41,7 +41,7 @@ func (config *Config) Command() {
|
||||
days = flag.Int("d", 30, "-t <days>")
|
||||
save = flag.String("s", "/tmp/ssl", "-s <save file>")
|
||||
email = flag.String("e", "", "-e <email>")
|
||||
DNSProvider = flag.String("D", "", "-D <DNS Provider> (e.g., TencentCloud, AliCloud, HuaweiCloud, WestCN, RainYun)")
|
||||
DNSProvider = flag.String("D", "", "-D <DNS Provider> (e.g., TencentCloud, Cloudflare)")
|
||||
kvp := flag.String("kv", "", "-kv <key=value>,<key=value>...")
|
||||
flag.Parse()
|
||||
|
||||
@@ -61,31 +61,13 @@ func (config *Config) Command() {
|
||||
Days: *days,
|
||||
SavePath: *save,
|
||||
Email: *email,
|
||||
DNSProviderConfig: DNSProviderConfig{
|
||||
DNSProvider: *DNSProvider,
|
||||
TencentCloud: TencentCloud{
|
||||
SecretID: KVP["SecretID"],
|
||||
SecretKey: KVP["SecretKey"],
|
||||
DNSProviderConfig: DNSProviderConfig{
|
||||
DNSProvider: *DNSProvider,
|
||||
TencentCloud: TencentCloud{
|
||||
SecretID: KVP["SecretID"],
|
||||
SecretKey: KVP["SecretKey"],
|
||||
},
|
||||
},
|
||||
AliCloud: AliCloud{
|
||||
AccessKeyId: KVP["AccessKeyId"],
|
||||
AccessKeySecret: KVP["AccessKeySecret"],
|
||||
RAMRole: KVP["RAMRole"],
|
||||
STSToken: KVP["STSToken"],
|
||||
},
|
||||
HuaweiCloud: HuaweiCloud{
|
||||
AccessKeyId: KVP["AccessKeyId"],
|
||||
Region: KVP["Region"],
|
||||
SecretAccessKey: KVP["SecretAccessKey"],
|
||||
},
|
||||
WestCN: WestCN{
|
||||
Username: KVP["Username"],
|
||||
Password: KVP["Password"],
|
||||
},
|
||||
RainYun: RainYun{
|
||||
ApiKey: KVP["ApiKey"],
|
||||
},
|
||||
},
|
||||
}
|
||||
config.VerifyCommand()
|
||||
}
|
||||
|
||||
@@ -3,44 +3,14 @@ package config
|
||||
type DNSProviderConfig struct {
|
||||
DNSProvider string `json:"DNSProvider"`
|
||||
TencentCloud `json:"TencentCloud,omitempty"`
|
||||
AliCloud `json:"AliCloud,omitempty"`
|
||||
HuaweiCloud `json:"HuaweiCloud,omitempty"`
|
||||
WestCN `json:"WestCN,omitempty"`
|
||||
RainYun `json:"RainYun,omitempty"`
|
||||
Cloudflare `json:"Cloudflare,omitempty"`
|
||||
Dode `json:"Dode,omitempty"`
|
||||
}
|
||||
|
||||
type TencentCloud struct {
|
||||
SecretID string `json:"SecretId,omitempty"`
|
||||
SecretKey string `json:"SecretKey,omitempty"`
|
||||
}
|
||||
|
||||
type AliCloud struct {
|
||||
AccessKeyId string `json:"AccessKeyId,omitempty"`
|
||||
AccessKeySecret string `json:"AccessKeySecret,omitempty"`
|
||||
RAMRole string `json:"RAMRole,omitempty"`
|
||||
STSToken string `json:"STSToken,omitempty"`
|
||||
}
|
||||
|
||||
type HuaweiCloud struct {
|
||||
AccessKeyId string `json:"AccessKeyId,omitempty"`
|
||||
Region string `json:"Region,omitempty"`
|
||||
SecretAccessKey string `json:"SecretAccessKey,omitempty"`
|
||||
}
|
||||
|
||||
type WestCN struct {
|
||||
Username string `json:"Username,omitempty"`
|
||||
Password string `json:"Password,omitempty"`
|
||||
}
|
||||
|
||||
type RainYun struct {
|
||||
ApiKey string `json:"ApiKey,omitempty"`
|
||||
}
|
||||
|
||||
type Dode struct {
|
||||
Token string `json:"Token,omitempty"`
|
||||
}
|
||||
// Removed provider types: AliCloud, HuaweiCloud, WestCN, RainYun, Dode
|
||||
|
||||
type Cloudflare struct {
|
||||
APIToken string `json:"APIToken,omitempty"`
|
||||
|
||||
@@ -3,12 +3,7 @@ package config
|
||||
import (
|
||||
"github.com/go-acme/lego/v4/challenge"
|
||||
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
|
||||
"github.com/go-acme/lego/v4/providers/dns/alidns"
|
||||
"github.com/go-acme/lego/v4/providers/dns/dode"
|
||||
"github.com/go-acme/lego/v4/providers/dns/huaweicloud"
|
||||
"github.com/go-acme/lego/v4/providers/dns/rainyun"
|
||||
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
|
||||
"github.com/go-acme/lego/v4/providers/dns/westcn"
|
||||
)
|
||||
|
||||
func (tencent TencentCloud) Provider() (challenge.Provider, error) {
|
||||
@@ -19,40 +14,6 @@ func (tencent TencentCloud) Provider() (challenge.Provider, error) {
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (ali AliCloud) Provider() (challenge.Provider, error) {
|
||||
cfg := alidns.NewDefaultConfig()
|
||||
cfg.SecurityToken = ali.STSToken
|
||||
cfg.SecretKey = ali.AccessKeySecret
|
||||
cfg.RAMRole = ali.RAMRole
|
||||
cfg.APIKey = ali.AccessKeyId
|
||||
p, err := alidns.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (huawei HuaweiCloud) Provider() (challenge.Provider, error) {
|
||||
cfg := huaweicloud.NewDefaultConfig()
|
||||
cfg.Region = huawei.Region
|
||||
cfg.AccessKeyID = huawei.AccessKeyId
|
||||
cfg.SecretAccessKey = huawei.SecretAccessKey
|
||||
p, err := huaweicloud.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (west WestCN) Provider() (challenge.Provider, error) {
|
||||
cfg := westcn.NewDefaultConfig()
|
||||
cfg.Username = west.Username
|
||||
cfg.Password = west.Password
|
||||
p, err := westcn.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (rain RainYun) Provider() (challenge.Provider, error) {
|
||||
cfg := rainyun.NewDefaultConfig()
|
||||
cfg.APIKey = rain.ApiKey
|
||||
p, err := rainyun.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (cloud Cloudflare) Provider() (challenge.Provider, error) {
|
||||
cfg := cloudflare.NewDefaultConfig()
|
||||
// lego's cloudflare.Config uses AuthToken / AuthKey / AuthEmail / ZoneToken
|
||||
@@ -65,15 +26,6 @@ func (cloud Cloudflare) Provider() (challenge.Provider, error) {
|
||||
if cloud.Email != "" {
|
||||
cfg.AuthEmail = cloud.Email
|
||||
}
|
||||
// support ZoneToken if provided in future (keep empty if not set)
|
||||
// if you add ZoneToken to the config struct, map it here: cfg.ZoneToken = cloud.ZoneToken
|
||||
p, err := cloudflare.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
func (Dode Dode) Provider() (challenge.Provider, error) {
|
||||
cfg := dode.NewDefaultConfig()
|
||||
cfg.Token = Dode.Token
|
||||
p, err := dode.NewDNSProviderConfig(cfg)
|
||||
return p, err
|
||||
}
|
||||
|
||||
@@ -19,24 +19,6 @@ func (config *Config) Default() {
|
||||
SecretID: "xxx",
|
||||
SecretKey: "xxx",
|
||||
},
|
||||
AliCloud: AliCloud{
|
||||
AccessKeyId: "xxx",
|
||||
AccessKeySecret: "xxx",
|
||||
RAMRole: "xxx (optional)",
|
||||
STSToken: "xxx (optional)",
|
||||
},
|
||||
HuaweiCloud: HuaweiCloud{
|
||||
AccessKeyId: "xxx",
|
||||
Region: "xxx",
|
||||
SecretAccessKey: "xxx",
|
||||
},
|
||||
WestCN: WestCN{
|
||||
Username: "xxx",
|
||||
Password: "xxx",
|
||||
},
|
||||
RainYun: RainYun{
|
||||
ApiKey: "xxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user