mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
Merge pull request #1034 from fudiwei:main
This commit is contained in:
@@ -12,9 +12,9 @@ type ProviderFactoryFunc func(options *ProviderFactoryOptions) (core.ACMEChallen
|
||||
type ProviderFactoryOptions struct {
|
||||
ProviderAccessConfig map[string]any
|
||||
ProviderExtendedConfig map[string]any
|
||||
DnsPropagationWait int32
|
||||
DnsPropagationTimeout int32
|
||||
DnsTTL int32
|
||||
DnsPropagationWait int
|
||||
DnsPropagationTimeout int
|
||||
DnsTTL int
|
||||
}
|
||||
|
||||
type Registry[T comparable] interface {
|
||||
|
||||
@@ -22,8 +22,8 @@ func init() {
|
||||
ClientToken: credentials.ClientToken,
|
||||
ClientSecret: credentials.ClientSecret,
|
||||
AccessToken: credentials.AccessToken,
|
||||
DnsPropagationTimeout: int(options.DnsPropagationTimeout),
|
||||
DnsTTL: int(options.DnsTTL),
|
||||
DnsPropagationTimeout: options.DnsPropagationTimeout,
|
||||
DnsTTL: options.DnsTTL,
|
||||
})
|
||||
return provider, err
|
||||
}); err != nil {
|
||||
|
||||
@@ -23,10 +23,10 @@ import (
|
||||
)
|
||||
|
||||
type ObtainCertificateRequest struct {
|
||||
Domains []string
|
||||
PrivateKeyType certcrypto.KeyType
|
||||
PrivateKeyPEM string
|
||||
ValidityTo time.Time
|
||||
Domains []string
|
||||
PrivateKeyType certcrypto.KeyType
|
||||
PrivateKeyPEM string
|
||||
ValidityNotAfter time.Time
|
||||
|
||||
// 提供商相关
|
||||
ChallengeType string
|
||||
@@ -39,12 +39,12 @@ type ObtainCertificateRequest struct {
|
||||
Nameservers []string
|
||||
|
||||
// DNS-01 质询相关
|
||||
DnsPropagationWait int32
|
||||
DnsPropagationTimeout int32
|
||||
DnsTTL int32
|
||||
DnsPropagationWait int
|
||||
DnsPropagationTimeout int
|
||||
DnsTTL int
|
||||
|
||||
// HTTP-01 质询相关
|
||||
HttpDelayWait int32
|
||||
HttpDelayWait int
|
||||
|
||||
// ACME 相关
|
||||
PreferredChain string
|
||||
@@ -169,7 +169,7 @@ func (c *ACMEClient) sendObtainCertificateRequest(request *ObtainCertificateRequ
|
||||
Bundle: true,
|
||||
PreferredChain: request.PreferredChain,
|
||||
Profile: request.ACMEProfile,
|
||||
NotAfter: request.ValidityTo,
|
||||
NotAfter: request.ValidityNotAfter,
|
||||
ReplacesCertID: lo.If(request.ARIReplacesAcctUrl == c.account.ACMEAcctUrl, request.ARIReplacesCertId).Else(""),
|
||||
}
|
||||
resp, err := c.client.Certificate.Obtain(req)
|
||||
|
||||
@@ -53,7 +53,7 @@ func NewACMEConfig(options *ACMEConfigOptions) (*ACMEConfig, error) {
|
||||
|
||||
if options.CAProvider == "" {
|
||||
settingsRepo := repository.NewSettingsRepository()
|
||||
settings, _ := settingsRepo.GetByName(context.Background(), "sslProvider")
|
||||
settings, _ := settingsRepo.GetByName(context.Background(), domain.SettingsNameSSLProvider)
|
||||
if settings != nil {
|
||||
sslProviderSettings := settings.Content.AsSSLProvider()
|
||||
caProvider = string(sslProviderSettings.Provider)
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := rainyunrcdn.NewSSLDeployerProvider(&rainyunrcdn.SSLDeployerProviderConfig{
|
||||
ApiKey: credentials.ApiKey,
|
||||
InstanceId: xmaps.GetInt32(options.ProviderExtendedConfig, "instanceId"),
|
||||
InstanceId: xmaps.GetInt64(options.ProviderExtendedConfig, "instanceId"),
|
||||
Domain: xmaps.GetString(options.ProviderExtendedConfig, "domain"),
|
||||
})
|
||||
return provider, err
|
||||
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
ApiToken: credentials.ApiToken,
|
||||
AllowInsecureConnections: credentials.AllowInsecureConnections,
|
||||
ResourceType: xmaps.GetString(options.ProviderExtendedConfig, "resourceType"),
|
||||
CertificateId: xmaps.GetInt32(options.ProviderExtendedConfig, "certificateId"),
|
||||
CertificateId: xmaps.GetInt64(options.ProviderExtendedConfig, "certificateId"),
|
||||
})
|
||||
return provider, err
|
||||
}); err != nil {
|
||||
|
||||
@@ -43,7 +43,7 @@ func init() {
|
||||
WebhookData: xmaps.GetOrDefaultString(options.ProviderExtendedConfig, "webhookData", credentials.DataString),
|
||||
Method: credentials.Method,
|
||||
Headers: mergedHeaders,
|
||||
Timeout: xmaps.GetInt32(options.ProviderExtendedConfig, "timeout"),
|
||||
Timeout: xmaps.GetInt(options.ProviderExtendedConfig, "timeout"),
|
||||
AllowInsecureConnections: credentials.AllowInsecureConnections,
|
||||
})
|
||||
return provider, err
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
@@ -255,17 +256,21 @@ func (s *CertificateService) ValidatePrivateKey(ctx context.Context, req *dtos.C
|
||||
}
|
||||
|
||||
func (s *CertificateService) cleanupExpiredCertificates(ctx context.Context) error {
|
||||
settings, err := s.settingsRepo.GetByName(ctx, "persistence")
|
||||
settings, err := s.settingsRepo.GetByName(ctx, domain.SettingsNamePersistence)
|
||||
if err != nil {
|
||||
if errors.Is(err, domain.ErrRecordNotFound) {
|
||||
return nil
|
||||
}
|
||||
|
||||
app.GetLogger().Error("failed to get persistence settings", slog.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
persistenceSettings := settings.Content.AsPersistence()
|
||||
if persistenceSettings.ExpiredCertificatesMaxDaysRetention != 0 {
|
||||
if persistenceSettings.CertificatesRetentionMaxDays != 0 {
|
||||
ret, err := s.certificateRepo.DeleteWhere(
|
||||
context.Background(),
|
||||
dbx.NewExp(fmt.Sprintf("validityNotAfter<DATETIME('now', '-%d days')", persistenceSettings.ExpiredCertificatesMaxDaysRetention)),
|
||||
dbx.NewExp(fmt.Sprintf("validityNotAfter<DATETIME('now', '-%d days')", persistenceSettings.CertificatesRetentionMaxDays)),
|
||||
)
|
||||
if err != nil {
|
||||
app.GetLogger().Error("failed to delete expired certificates", slog.Any("error", err))
|
||||
|
||||
@@ -402,7 +402,7 @@ type AccessConfigForRainYun struct {
|
||||
|
||||
type AccessConfigForRatPanel struct {
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
AccessTokenId int64 `json:"accessTokenId"`
|
||||
AccessToken string `json:"accessToken"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
@@ -462,7 +462,7 @@ type AccessConfigForTechnitiumDNS struct {
|
||||
|
||||
type AccessConfigForTelegramBot struct {
|
||||
BotToken string `json:"botToken"`
|
||||
ChatId int64 `json:"chatId,omitempty"`
|
||||
ChatId string `json:"chatId,omitempty"`
|
||||
}
|
||||
|
||||
type AccessConfigForTencentCloud struct {
|
||||
|
||||
@@ -12,6 +12,11 @@ type Settings struct {
|
||||
Content SettingsContent `json:"content" db:"content"`
|
||||
}
|
||||
|
||||
const (
|
||||
SettingsNameSSLProvider = "sslProvider"
|
||||
SettingsNamePersistence = "persistence"
|
||||
)
|
||||
|
||||
type SettingsContent map[string]any
|
||||
|
||||
type SettingsContentForSSLProvider struct {
|
||||
@@ -20,8 +25,9 @@ type SettingsContentForSSLProvider struct {
|
||||
}
|
||||
|
||||
type SettingsContentForPersistence struct {
|
||||
WorkflowRunsMaxDaysRetention int `json:"workflowRunsMaxDaysRetention"`
|
||||
ExpiredCertificatesMaxDaysRetention int `json:"expiredCertificatesMaxDaysRetention"`
|
||||
CertificatesWarningDaysBeforeExpire int `json:"certificatesWarningDaysBeforeExpire"`
|
||||
CertificatesRetentionMaxDays int `json:"certificatesRetentionMaxDays"`
|
||||
WorkflowRunsRetentionMaxDays int `json:"workflowRunsRetentionMaxDays"`
|
||||
}
|
||||
|
||||
func (c SettingsContent) AsSSLProvider() *SettingsContentForSSLProvider {
|
||||
@@ -38,5 +44,18 @@ func (c SettingsContent) AsSSLProvider() *SettingsContentForSSLProvider {
|
||||
func (c SettingsContent) AsPersistence() *SettingsContentForPersistence {
|
||||
content := &SettingsContentForPersistence{}
|
||||
xmaps.Populate(c, content)
|
||||
|
||||
if content.CertificatesWarningDaysBeforeExpire <= 0 {
|
||||
content.CertificatesWarningDaysBeforeExpire = 21
|
||||
}
|
||||
|
||||
if content.CertificatesRetentionMaxDays < 0 {
|
||||
content.CertificatesRetentionMaxDays = 0
|
||||
}
|
||||
|
||||
if content.WorkflowRunsRetentionMaxDays < 0 {
|
||||
content.WorkflowRunsRetentionMaxDays = 0
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
+12
-12
@@ -114,7 +114,7 @@ type WorkflowNodeConfig map[string]any
|
||||
|
||||
func (c WorkflowNodeConfig) AsDelay() WorkflowNodeConfigForDelay {
|
||||
return WorkflowNodeConfigForDelay{
|
||||
Wait: xmaps.GetInt32(c, "wait"),
|
||||
Wait: xmaps.GetInt(c, "wait"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,13 +156,13 @@ func (c WorkflowNodeConfig) AsBizApply() WorkflowNodeConfigForBizApply {
|
||||
PreferredChain: xmaps.GetString(c, "preferredChain"),
|
||||
ACMEProfile: xmaps.GetString(c, "acmeProfile"),
|
||||
Nameservers: nameservers,
|
||||
DnsPropagationWait: xmaps.GetInt32(c, "dnsPropagationWait"),
|
||||
DnsPropagationTimeout: xmaps.GetInt32(c, "dnsPropagationTimeout"),
|
||||
DnsTTL: xmaps.GetInt32(c, "dnsTTL"),
|
||||
HttpDelayWait: xmaps.GetInt32(c, "httpDelayWait"),
|
||||
DnsPropagationWait: xmaps.GetInt(c, "dnsPropagationWait"),
|
||||
DnsPropagationTimeout: xmaps.GetInt(c, "dnsPropagationTimeout"),
|
||||
DnsTTL: xmaps.GetInt(c, "dnsTTL"),
|
||||
HttpDelayWait: xmaps.GetInt(c, "httpDelayWait"),
|
||||
DisableFollowCNAME: xmaps.GetBool(c, "disableFollowCNAME"),
|
||||
DisableARI: xmaps.GetBool(c, "disableARI"),
|
||||
SkipBeforeExpiryDays: xmaps.GetInt32(c, "skipBeforeExpiryDays"),
|
||||
SkipBeforeExpiryDays: xmaps.GetInt(c, "skipBeforeExpiryDays"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ func (c WorkflowNodeConfig) AsBizNotify() WorkflowNodeConfigForBizNotify {
|
||||
}
|
||||
|
||||
type WorkflowNodeConfigForDelay struct {
|
||||
Wait int32 `json:"wait"` // 等待时间
|
||||
Wait int `json:"wait"` // 等待时间
|
||||
}
|
||||
|
||||
type WorkflowNodeConfigForBranchBlock struct {
|
||||
@@ -230,13 +230,13 @@ type WorkflowNodeConfigForBizApply struct {
|
||||
PreferredChain string `json:"preferredChain,omitempty"` // 首选证书链
|
||||
ACMEProfile string `json:"acmeProfile,omitempty"` // ACME Profiles Extension
|
||||
Nameservers []string `json:"nameservers,omitempty"` // DNS 服务器列表,以半角分号分隔
|
||||
DnsPropagationWait int32 `json:"dnsPropagationWait,omitempty"` // DNS 传播等待时间,等同于 lego 的 `--dns-propagation-wait` 参数
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"` // DNS 传播检查超时时间(零值时使用提供商的默认值)
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"` // DNS 解析记录 TTL(零值时使用提供商的默认值)
|
||||
HttpDelayWait int32 `json:"httpDelayWait,omitempty"` // HTTP 等待时间
|
||||
DnsPropagationWait int `json:"dnsPropagationWait,omitempty"` // DNS 传播等待时间,等同于 lego 的 `--dns-propagation-wait` 参数
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"` // DNS 传播检查超时时间(零值时使用提供商的默认值)
|
||||
DnsTTL int `json:"dnsTTL,omitempty"` // DNS 解析记录 TTL(零值时使用提供商的默认值)
|
||||
HttpDelayWait int `json:"httpDelayWait,omitempty"` // HTTP 等待时间
|
||||
DisableFollowCNAME bool `json:"disableFollowCNAME,omitempty"` // 是否关闭 CNAME 跟随
|
||||
DisableARI bool `json:"disableARI,omitempty"` // 是否关闭 ARI
|
||||
SkipBeforeExpiryDays int32 `json:"skipBeforeExpiryDays,omitempty"` // 证书到期前多少天前跳过续期
|
||||
SkipBeforeExpiryDays int `json:"skipBeforeExpiryDays,omitempty"` // 证书到期前多少天前跳过续期
|
||||
}
|
||||
|
||||
type WorkflowNodeConfigForBizUpload struct {
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := telegrambot.NewNotifierProvider(&telegrambot.NotifierProviderConfig{
|
||||
BotToken: credentials.BotToken,
|
||||
ChatId: xmaps.GetOrDefaultInt64(options.ProviderExtendedConfig, "chatId", credentials.ChatId),
|
||||
ChatId: xmaps.GetOrDefaultString(options.ProviderExtendedConfig, "chatId", credentials.ChatId),
|
||||
})
|
||||
return provider, err
|
||||
}); err != nil {
|
||||
|
||||
@@ -43,7 +43,7 @@ func init() {
|
||||
WebhookData: xmaps.GetOrDefaultString(options.ProviderExtendedConfig, "webhookData", credentials.DataString),
|
||||
Method: credentials.Method,
|
||||
Headers: mergedHeaders,
|
||||
Timeout: xmaps.GetInt32(options.ProviderExtendedConfig, "timeout"),
|
||||
Timeout: xmaps.GetInt(options.ProviderExtendedConfig, "timeout"),
|
||||
AllowInsecureConnections: credentials.AllowInsecureConnections,
|
||||
})
|
||||
return provider, err
|
||||
|
||||
@@ -2,6 +2,12 @@ package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
|
||||
"github.com/certimate-go/certimate/internal/app"
|
||||
"github.com/certimate-go/certimate/internal/domain"
|
||||
@@ -14,63 +20,81 @@ func NewStatisticsRepository() *StatisticsRepository {
|
||||
}
|
||||
|
||||
func (r *StatisticsRepository) Get(ctx context.Context) (*domain.Statistics, error) {
|
||||
rs := &domain.Statistics{}
|
||||
statistics := &domain.Statistics{}
|
||||
|
||||
// 所有证书
|
||||
certTotal := struct {
|
||||
// 读取设置
|
||||
var persistenceSettings *domain.SettingsContentForPersistence
|
||||
rsSettings := struct {
|
||||
Content string `db:"content"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT content FROM settings WHERE name = {:name}").
|
||||
Bind(dbx.Params{"name": domain.SettingsNamePersistence}).
|
||||
One(&rsSettings); err != nil {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
persistenceSettings = (domain.SettingsContent{}).AsPersistence()
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
json.Unmarshal([]byte(rsSettings.Content), &persistenceSettings)
|
||||
}
|
||||
|
||||
// 统计所有证书
|
||||
rsCertTotal := struct {
|
||||
Total int `db:"total"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT COUNT(*) AS total FROM certificate WHERE deleted = ''").
|
||||
One(&certTotal); err != nil {
|
||||
One(&rsCertTotal); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rs.CertificateTotal = certTotal.Total
|
||||
statistics.CertificateTotal = rsCertTotal.Total
|
||||
|
||||
// 即将过期证书
|
||||
certExpiringSoonTotal := struct {
|
||||
// 统计即将过期证书
|
||||
rsCertExpiringSoonTotal := struct {
|
||||
Total int `db:"total"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT COUNT(*) AS total FROM certificate WHERE validityNotAfter > DATETIME('now') and validityNotAfter < DATETIME('now', '+20 days') AND deleted = ''").
|
||||
One(&certExpiringSoonTotal); err != nil {
|
||||
NewQuery(fmt.Sprintf("SELECT COUNT(*) AS total FROM certificate WHERE validityNotAfter <= DATETIME('now', '+%d days') AND validityNotAfter > DATETIME('now') AND isRevoked = 0 AND deleted = ''", persistenceSettings.CertificatesWarningDaysBeforeExpire)).
|
||||
One(&rsCertExpiringSoonTotal); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rs.CertificateExpiringSoon = certExpiringSoonTotal.Total
|
||||
statistics.CertificateExpiringSoon = rsCertExpiringSoonTotal.Total
|
||||
|
||||
// 已过期证书
|
||||
certExpiredTotal := struct {
|
||||
// 统计已过期证书
|
||||
rsCertExpiredTotal := struct {
|
||||
Total int `db:"total"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT COUNT(*) AS total FROM certificate WHERE validityNotAfter < DATETIME('now') AND deleted = ''").
|
||||
One(&certExpiredTotal); err != nil {
|
||||
NewQuery("SELECT COUNT(*) AS total FROM certificate WHERE validityNotAfter <= DATETIME('now') AND deleted = ''").
|
||||
One(&rsCertExpiredTotal); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rs.CertificateExpired = certExpiredTotal.Total
|
||||
statistics.CertificateExpired = rsCertExpiredTotal.Total
|
||||
|
||||
// 所有工作流
|
||||
workflowTotal := struct {
|
||||
// 统计所有工作流
|
||||
rsWorkflowTotal := struct {
|
||||
Total int `db:"total"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT COUNT(*) AS total FROM workflow").
|
||||
One(&workflowTotal); err != nil {
|
||||
One(&rsWorkflowTotal); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rs.WorkflowTotal = workflowTotal.Total
|
||||
statistics.WorkflowTotal = rsWorkflowTotal.Total
|
||||
|
||||
// 已启用工作流
|
||||
workflowEnabledTotal := struct {
|
||||
// 统计已启用工作流
|
||||
rsWorkflowEnabledTotal := struct {
|
||||
Total int `db:"total"`
|
||||
}{}
|
||||
if err := app.GetDB().
|
||||
NewQuery("SELECT COUNT(*) AS total FROM workflow WHERE enabled IS TRUE").
|
||||
One(&workflowEnabledTotal); err != nil {
|
||||
One(&rsWorkflowEnabledTotal); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rs.WorkflowEnabled = workflowEnabledTotal.Total
|
||||
rs.WorkflowDisabled = workflowTotal.Total - workflowEnabledTotal.Total
|
||||
statistics.WorkflowEnabled = rsWorkflowEnabledTotal.Total
|
||||
statistics.WorkflowDisabled = rsWorkflowTotal.Total - rsWorkflowEnabledTotal.Total
|
||||
|
||||
return rs, nil
|
||||
return statistics, nil
|
||||
}
|
||||
|
||||
@@ -100,13 +100,6 @@ func (ne *bizApplyNodeExecutor) Execute(execCtx *NodeExecutionContext) (*NodeExe
|
||||
return execRes, err
|
||||
}
|
||||
|
||||
// 解析证书
|
||||
certX509, err := xcert.ParseCertificateFromPEM(obtainResp.FullChainCertificate)
|
||||
if err != nil {
|
||||
ne.logger.Warn("could not parse certificate, may be the CA responded error")
|
||||
return execRes, err
|
||||
}
|
||||
|
||||
// 保存证书实体
|
||||
certificate := &domain.Certificate{
|
||||
Source: domain.CertificateSourceTypeRequest,
|
||||
@@ -120,7 +113,7 @@ func (ne *bizApplyNodeExecutor) Execute(execCtx *NodeExecutionContext) (*NodeExe
|
||||
WorkflowRunId: execCtx.RunId,
|
||||
WorkflowNodeId: execCtx.Node.Id,
|
||||
}
|
||||
certificate.PopulateFromX509(certX509)
|
||||
certificate.PopulateFromPEM(obtainResp.FullChainCertificate, obtainResp.PrivateKey)
|
||||
if certificate, err := ne.certificateRepo.Save(execCtx.ctx, certificate); err != nil {
|
||||
ne.logger.Warn("could not save certificate")
|
||||
return execRes, err
|
||||
@@ -308,7 +301,7 @@ func (ne *bizApplyNodeExecutor) executeObtain(execCtx *NodeExecutionContext, nod
|
||||
}
|
||||
return ""
|
||||
}),
|
||||
ValidityTo: lo.
|
||||
ValidityNotAfter: lo.
|
||||
If(nodeCfg.ValidityLifetime == "", time.Time{}).
|
||||
ElseF(func() time.Time {
|
||||
duration, err := str2duration.ParseDuration(nodeCfg.ValidityLifetime)
|
||||
|
||||
@@ -150,19 +150,23 @@ func (s *WorkflowService) Shutdown(ctx context.Context) {
|
||||
}
|
||||
|
||||
func (s *WorkflowService) cleanupHistoryRuns(ctx context.Context) error {
|
||||
settings, err := s.settingsRepo.GetByName(ctx, "persistence")
|
||||
settings, err := s.settingsRepo.GetByName(ctx, domain.SettingsNamePersistence)
|
||||
if err != nil {
|
||||
if errors.Is(err, domain.ErrRecordNotFound) {
|
||||
return nil
|
||||
}
|
||||
|
||||
app.GetLogger().Error("failed to get persistence settings", slog.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
persistenceSettings := settings.Content.AsPersistence()
|
||||
if persistenceSettings.WorkflowRunsMaxDaysRetention != 0 {
|
||||
if persistenceSettings.WorkflowRunsRetentionMaxDays != 0 {
|
||||
ret, err := s.workflowRunRepo.DeleteWhere(
|
||||
ctx,
|
||||
dbx.NewExp(fmt.Sprintf("status!='%s'", string(domain.WorkflowRunStatusTypePending))),
|
||||
dbx.NewExp(fmt.Sprintf("status!='%s'", string(domain.WorkflowRunStatusTypeProcessing))),
|
||||
dbx.NewExp(fmt.Sprintf("endedAt<DATETIME('now', '-%d days')", persistenceSettings.WorkflowRunsMaxDaysRetention)),
|
||||
dbx.NewExp(fmt.Sprintf("endedAt<DATETIME('now', '-%d days')", persistenceSettings.WorkflowRunsRetentionMaxDays)),
|
||||
)
|
||||
if err != nil {
|
||||
app.GetLogger().Error("failed to delete workflow history runs", slog.Any("error", err))
|
||||
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := collection.Fields.AddMarshaledJSONAt(10, []byte(`{
|
||||
if err := collection.Fields.AddMarshaledJSONAt(11, []byte(`{
|
||||
"hidden": false,
|
||||
"id": "number2453290051",
|
||||
"max": null,
|
||||
|
||||
@@ -30,6 +30,18 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
// update collection `settings`
|
||||
// - modify field `content` schema of `persistence`
|
||||
{
|
||||
if _, err := app.DB().NewQuery("UPDATE settings SET content = REPLACE(content, '\"expiredCertificatesMaxDaysRetention\"', '\"certificatesRetentionMaxDays\"') WHERE name = 'persistence'").Execute(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := app.DB().NewQuery("UPDATE settings SET content = REPLACE(content, '\"workflowRunsMaxDaysRetention\"', '\"workflowRunsRetentionMaxDays\"') WHERE name = 'persistence'").Execute(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
tracer.Printf("done")
|
||||
return nil
|
||||
}, func(app core.App) error {
|
||||
@@ -15,7 +15,7 @@ type NotifierProviderConfig struct {
|
||||
// Telegram Bot API Token。
|
||||
BotToken string `json:"botToken"`
|
||||
// Telegram Chat ID。
|
||||
ChatId int64 `json:"chatId"`
|
||||
ChatId string `json:"chatId"`
|
||||
}
|
||||
|
||||
type NotifierProvider struct {
|
||||
|
||||
@@ -17,14 +17,14 @@ const (
|
||||
|
||||
var (
|
||||
fApiToken string
|
||||
fChatId int64
|
||||
fChatId string
|
||||
)
|
||||
|
||||
func init() {
|
||||
argsPrefix := "CERTIMATE_NOTIFIER_TELEGRAMBOT_"
|
||||
|
||||
flag.StringVar(&fApiToken, argsPrefix+"APITOKEN", "", "")
|
||||
flag.Int64Var(&fChatId, argsPrefix+"CHATID", 0, "")
|
||||
flag.StringVar(&fChatId, argsPrefix+"CHATID", "", "")
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -32,7 +32,7 @@ Shell command to run this test:
|
||||
|
||||
go test -v ./telegrambot_test.go -args \
|
||||
--CERTIMATE_NOTIFIER_TELEGRAMBOT_APITOKEN="your-api-token" \
|
||||
--CERTIMATE_NOTIFIER_TELEGRAMBOT_CHATID=123456
|
||||
--CERTIMATE_NOTIFIER_TELEGRAMBOT_CHATID="your-chat-id"
|
||||
*/
|
||||
func TestNotify(t *testing.T) {
|
||||
flag.Parse()
|
||||
|
||||
@@ -29,7 +29,7 @@ type NotifierProviderConfig struct {
|
||||
Headers map[string]string `json:"headers,omitempty"`
|
||||
// 请求超时(单位:秒)。
|
||||
// 零值时默认值 30。
|
||||
Timeout int32 `json:"timeout,omitempty"`
|
||||
Timeout int `json:"timeout,omitempty"`
|
||||
// 是否允许不安全的连接。
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type ChallengeProviderConfig struct {
|
||||
Mode string `json:"mode"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -12,8 +12,8 @@ type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
Region string `json:"region"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -36,7 +36,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
HTTPTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ type DNSProvider struct {
|
||||
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 300)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 300),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
@@ -239,7 +239,7 @@ func (d *DNSProvider) addOrUpdateDNSRecord(siteId int64, effectiveFQDN, value st
|
||||
Data: &aliesa.CreateRecordRequestData{
|
||||
Value: tea.String(value),
|
||||
},
|
||||
Ttl: tea.Int32(d.config.TTL),
|
||||
Ttl: tea.Int32(int32(d.config.TTL)),
|
||||
}
|
||||
_, err = d.client.CreateRecord(request)
|
||||
return err
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := alidns.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := arvancloud.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -14,8 +14,8 @@ type ChallengeProviderConfig struct {
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
Region string `json:"region"`
|
||||
HostedZoneId string `json:"hostedZoneId"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -32,7 +32,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := route53.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -15,8 +15,8 @@ type ChallengeProviderConfig struct {
|
||||
ClientId string `json:"clientId"`
|
||||
ClientSecret string `json:"clientSecret"`
|
||||
CloudName string `json:"cloudName,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -39,7 +39,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := azuredns.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/go-acme/lego/v4/challenge/dns01"
|
||||
"github.com/go-acme/lego/v4/platform/config/env"
|
||||
"github.com/google/uuid"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -33,7 +34,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
HTTPTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ type DNSProvider struct {
|
||||
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 300)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 300),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
@@ -169,7 +170,7 @@ func (d *DNSProvider) addOrUpdateDNSRecord(zoneName, subDomain, value string) er
|
||||
Type: "TXT",
|
||||
Rr: subDomain,
|
||||
Value: value,
|
||||
Ttl: &d.config.TTL,
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
}
|
||||
err := d.client.CreateRecord(zoneName, request, d.generateClientToken())
|
||||
return err
|
||||
@@ -178,7 +179,7 @@ func (d *DNSProvider) addOrUpdateDNSRecord(zoneName, subDomain, value string) er
|
||||
Type: "TXT",
|
||||
Rr: subDomain,
|
||||
Value: value,
|
||||
Ttl: &d.config.TTL,
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
}
|
||||
err := d.client.UpdateRecord(zoneName, record.Id, request, d.generateClientToken())
|
||||
return err
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := bookmyname.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := bunny.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
DnsApiToken string `json:"dnsApiToken"`
|
||||
ZoneApiToken string `json:"zoneApiToken,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := cloudflare.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AuthId string `json:"authId"`
|
||||
AuthPassword string `json:"authPassword"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := cloudns.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/go-acme/lego/v4/challenge"
|
||||
"github.com/go-acme/lego/v4/challenge/dns01"
|
||||
"github.com/go-acme/lego/v4/platform/config/env"
|
||||
"github.com/samber/lo"
|
||||
"gitlab.ecloud.com/ecloud/ecloudsdkclouddns"
|
||||
"gitlab.ecloud.com/ecloud/ecloudsdkclouddns/model"
|
||||
"gitlab.ecloud.com/ecloud/ecloudsdkcore/config"
|
||||
@@ -36,7 +37,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
ReadTimeOut int
|
||||
ConnectTimeout int
|
||||
}
|
||||
@@ -50,7 +51,7 @@ func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
ReadTimeOut: env.GetOrDefaultInt(EnvReadTimeOut, 30),
|
||||
ConnectTimeout: env.GetOrDefaultInt(EnvConnectTimeout, 30),
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 600)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 600),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
}
|
||||
@@ -118,7 +119,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||
Description: "certimate acme",
|
||||
Type: model.CreateRecordOpenapiBodyTypeEnumTxt,
|
||||
Value: info.Value,
|
||||
Ttl: &d.config.TTL,
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
@@ -140,7 +141,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||
LineId: "0",
|
||||
Type: model.ModifyRecordOpenapiBodyTypeEnumTxt,
|
||||
Value: info.Value,
|
||||
Ttl: &d.config.TTL,
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := constellix.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -24,7 +24,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.AccessKeyId = config.AccessKeyId
|
||||
providerConfig.SecretAccessKey = config.SecretAccessKey
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
if config.DnsPropagationTimeout != 0 {
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
Token string `json:"token"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := desec.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := digitalocean.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiId string `json:"apiId"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -27,7 +27,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := internal.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/go-acme/lego/v4/challenge"
|
||||
"github.com/go-acme/lego/v4/challenge/dns01"
|
||||
"github.com/go-acme/lego/v4/platform/config/env"
|
||||
"github.com/samber/lo"
|
||||
|
||||
dnslasdk "github.com/certimate-go/certimate/pkg/sdk3rd/dnsla"
|
||||
)
|
||||
@@ -201,25 +202,24 @@ func (d *DNSProvider) addOrUpdateDNSRecord(zoneName, subDomain, value string) er
|
||||
return err
|
||||
}
|
||||
|
||||
const recordTypeTXT = 16
|
||||
if record == nil {
|
||||
request := &dnslasdk.CreateRecordRequest{
|
||||
DomainId: zone.Id,
|
||||
Type: 16,
|
||||
Host: subDomain,
|
||||
Data: value,
|
||||
Ttl: int32(d.config.TTL),
|
||||
DomainId: lo.ToPtr(zone.Id),
|
||||
Type: lo.ToPtr(int32(recordTypeTXT)),
|
||||
Host: lo.ToPtr(subDomain),
|
||||
Data: lo.ToPtr(value),
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
}
|
||||
_, err := d.client.CreateRecord(request)
|
||||
return err
|
||||
} else {
|
||||
reqType := int32(16)
|
||||
reqTtl := int32(d.config.TTL)
|
||||
request := &dnslasdk.UpdateRecordRequest{
|
||||
Id: record.Id,
|
||||
Type: &reqType,
|
||||
Host: &subDomain,
|
||||
Data: &value,
|
||||
Ttl: &reqTtl,
|
||||
Id: lo.ToPtr(record.Id),
|
||||
Type: lo.ToPtr(int32(recordTypeTXT)),
|
||||
Host: lo.ToPtr(subDomain),
|
||||
Data: lo.ToPtr(value),
|
||||
Ttl: lo.ToPtr(int32(d.config.TTL)),
|
||||
}
|
||||
_, err := d.client.UpdateRecord(request)
|
||||
return err
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := dnsmadeeasy.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
Token string `json:"token"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := dynu.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
HttpToken string `json:"httpToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -25,7 +25,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := internal.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
PersonalAccessToken string `json:"personalAccessToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := gandiv5.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiToken string `json:"apiToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := gcore.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AppId string `json:"appId"`
|
||||
AppKey string `json:"appKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -27,7 +27,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := internal.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := godaddy.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiToken string `json:"apiToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := hetzner.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := hostingde.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiToken string `json:"apiToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := hostinger.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -13,8 +13,8 @@ type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
Region string `json:"region"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -36,7 +36,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
providerConfig.TTL = int32(config.DnsTTL)
|
||||
}
|
||||
|
||||
provider, err := hwc.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := infomaniak.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKeyPublicPrefix string `json:"apiKeyPublicPrefix"`
|
||||
ApiKeySecret string `json:"apiKeySecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := ionos.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -36,7 +36,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
HTTPTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ type DNSProvider struct {
|
||||
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 300)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 300),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
|
||||
@@ -12,8 +12,8 @@ type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
RegionId string `json:"regionId"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := linode.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
Username string `json:"username"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := namecheap.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
Username string `json:"username"`
|
||||
ApiToken string `json:"apiToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := namedotcom.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := namesilo.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -13,8 +13,8 @@ type ChallengeProviderConfig struct {
|
||||
CustomerNumber string `json:"customerNumber"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiPassword string `json:"apiPassword"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -30,7 +30,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := netcup.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiToken string `json:"apiToken"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := netlify.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := ns1.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -18,8 +18,8 @@ type ChallengeProviderConfig struct {
|
||||
ConsumerKey string `json:"consumerKey,omitempty"`
|
||||
ClientId string `json:"clientId,omitempty"`
|
||||
ClientSecret string `json:"clientSecret,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -46,7 +46,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := ovh.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
SecretApiKey string `json:"secretApiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := porkbun.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -16,8 +16,8 @@ type ChallengeProviderConfig struct {
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -38,7 +38,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := pdns.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := rainyun.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -17,8 +17,8 @@ type ChallengeProviderConfig struct {
|
||||
TsigAlgorithm string `json:"tsigAlgorithm,omitempty"`
|
||||
TsigKey string `json:"tsigKey,omitempty"`
|
||||
TsigSecret string `json:"tsigSecret,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -43,7 +43,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := rfc2136.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := spaceship.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -15,8 +15,8 @@ type ChallengeProviderConfig struct {
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiToken string `json:"apiToken"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -36,7 +36,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := technitium.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -36,7 +36,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
HTTPTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ type DNSProvider struct {
|
||||
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 300)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 300),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
|
||||
@@ -12,8 +12,8 @@ type ChallengeProviderConfig struct {
|
||||
SecretId string `json:"secretId"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
ZoneId string `json:"zoneId"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
SecretId string `json:"secretId"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := tencentcloud.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -36,7 +36,7 @@ type Config struct {
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
TTL int32
|
||||
TTL int
|
||||
HTTPTimeout time.Duration
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ type DNSProvider struct {
|
||||
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
TTL: int32(env.GetOrDefaultInt(EnvTTL, 600)),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, 600),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 2*time.Minute),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
|
||||
@@ -12,8 +12,8 @@ type ChallengeProviderConfig struct {
|
||||
PrivateKey string `json:"privateKey"`
|
||||
PublicKey string `json:"publicKey"`
|
||||
ProjectId string `json:"projectId,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiAccessToken string `json:"apiAccessToken"`
|
||||
TeamId string `json:"teamId,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := vercel.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := volcengine.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -26,7 +26,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := vultr.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
type ChallengeProviderConfig struct {
|
||||
Username string `json:"username"`
|
||||
ApiPassword string `json:"apiPassword"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int32 `json:"dnsTTL,omitempty"`
|
||||
DnsPropagationTimeout int `json:"dnsPropagationTimeout,omitempty"`
|
||||
DnsTTL int `json:"dnsTTL,omitempty"`
|
||||
}
|
||||
|
||||
func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger, error) {
|
||||
@@ -28,7 +28,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (core.ACMEChallenger,
|
||||
providerConfig.PropagationTimeout = time.Duration(config.DnsPropagationTimeout) * time.Second
|
||||
}
|
||||
if config.DnsTTL != 0 {
|
||||
providerConfig.TTL = int(config.DnsTTL)
|
||||
providerConfig.TTL = config.DnsTTL
|
||||
}
|
||||
|
||||
provider, err := westcn.NewDNSProviderConfig(providerConfig)
|
||||
|
||||
@@ -191,7 +191,7 @@ func (d *SSLDeployerProvider) deployToCertificate(ctx context.Context, certPEM s
|
||||
{
|
||||
// 获取证书详情
|
||||
getWebsiteSSLResp, err := sdkClient.GetWebsiteSSL(d.config.CertificateId)
|
||||
d.logger.Debug("sdk request '1panel.GetWebsiteSSL'", slog.Any("sslId", d.config.CertificateId), slog.Any("response", getWebsiteSSLResp))
|
||||
d.logger.Debug("sdk request '1panel.GetWebsiteSSL'", slog.Int64("sslId", d.config.CertificateId), slog.Any("response", getWebsiteSSLResp))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request '1panel.GetWebsiteSSL': %w", err)
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ func (d *SSLDeployerProvider) deployToCloudNative(ctx context.Context, certPEM s
|
||||
// REF: https://help.aliyun.com/zh/api-gateway/cloud-native-api-gateway/developer-reference/api-apig-2024-03-27-getdomain
|
||||
getDomainReq := &aliapig.GetDomainRequest{}
|
||||
getDomainResp, err := d.sdkClients.CloudNativeAPIGateway.GetDomain(tea.String(domainId), getDomainReq)
|
||||
d.logger.Debug("sdk request 'apig.GetDomain'", slog.Any("domainId", domainId), slog.Any("request", getDomainReq), slog.Any("response", getDomainResp))
|
||||
d.logger.Debug("sdk request 'apig.GetDomain'", slog.String("domainId", domainId), slog.Any("request", getDomainReq), slog.Any("response", getDomainResp))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'apig.GetDomain': %w", err)
|
||||
}
|
||||
@@ -222,7 +222,7 @@ func (d *SSLDeployerProvider) deployToCloudNative(ctx context.Context, certPEM s
|
||||
CertIdentifier: tea.String(upres.ExtendedData["CertIdentifier"].(string)),
|
||||
}
|
||||
updateDomainResp, err := d.sdkClients.CloudNativeAPIGateway.UpdateDomain(tea.String(domainId), updateDomainReq)
|
||||
d.logger.Debug("sdk request 'apig.UpdateDomain'", slog.Any("domainId", domainId), slog.Any("request", updateDomainReq), slog.Any("response", updateDomainResp))
|
||||
d.logger.Debug("sdk request 'apig.UpdateDomain'", slog.String("domainId", domainId), slog.Any("request", updateDomainReq), slog.Any("response", updateDomainResp))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'apig.UpdateDomain': %w", err)
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
setCdnDomainSSLCertificateReq := &alicdn.SetCdnDomainSSLCertificateRequest{
|
||||
DomainName: tea.String(domain),
|
||||
CertType: tea.String("cas"),
|
||||
CertId: tea.Int64(int64(certId)),
|
||||
CertId: tea.Int64(certId),
|
||||
CertRegion: lo.
|
||||
If(d.config.Region == "" || strings.HasPrefix(d.config.Region, "cn-"), tea.String("cn-hangzhou")).
|
||||
Else(tea.String("ap-southeast-1")),
|
||||
|
||||
@@ -96,7 +96,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
setVodDomainSSLCertificateReq := &alivod.SetVodDomainSSLCertificateRequest{
|
||||
DomainName: tea.String(d.config.Domain),
|
||||
CertType: tea.String("cas"),
|
||||
CertId: tea.Int64(int64(certId)),
|
||||
CertId: tea.Int64(certId),
|
||||
CertName: tea.String(upres.CertName),
|
||||
CertRegion: lo.
|
||||
If(d.config.Region == "" || strings.HasPrefix(d.config.Region, "cn-"), tea.String("cn-hangzhou")).
|
||||
|
||||
@@ -95,7 +95,7 @@ func (d *SSLDeployerProvider) deployToSite(ctx context.Context, certPEM string,
|
||||
// 获取单个网站详情
|
||||
// REF: https://doc.cdnfly.cn/wangzhanguanli-v1-sites.html#%E8%8E%B7%E5%8F%96%E5%8D%95%E4%B8%AA%E7%BD%91%E7%AB%99%E8%AF%A6%E6%83%85
|
||||
getSiteResp, err := d.sdkClient.GetSite(d.config.SiteId)
|
||||
d.logger.Debug("sdk request 'cdnfly.GetSite'", slog.Any("siteId", d.config.SiteId), slog.Any("response", getSiteResp))
|
||||
d.logger.Debug("sdk request 'cdnfly.GetSite'", slog.String("siteId", d.config.SiteId), slog.Any("response", getSiteResp))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'cdnfly.GetSite': %w", err)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
// 获取证书
|
||||
// REF: https://api.gcore.com/docs/cdn#tag/SSL-certificates/paths/~1cdn~1sslData~1%7Bssl_id%7D/get
|
||||
getCertificateDetailResp, err := d.sdkClients.SSLCerts.Get(context.TODO(), d.config.CertificateId)
|
||||
d.logger.Debug("sdk request 'sslcerts.Get'", slog.Any("sslId", d.config.CertificateId), slog.Any("response", getCertificateDetailResp))
|
||||
d.logger.Debug("sdk request 'sslcerts.Get'", slog.Int64("sslId", d.config.CertificateId), slog.Any("response", getCertificateDetailResp))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to execute sdk request 'sslcerts.Get': %w", err)
|
||||
}
|
||||
@@ -111,7 +111,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
ValidateRootCA: false,
|
||||
}
|
||||
changeCertificateResp, err := d.sdkClients.SSLCerts.Update(context.TODO(), getCertificateDetailResp.ID, changeCertificateReq)
|
||||
d.logger.Debug("sdk request 'sslcerts.Update'", slog.Any("sslId", getCertificateDetailResp.ID), slog.Any("request", changeCertificateReq), slog.Any("response", changeCertificateResp))
|
||||
d.logger.Debug("sdk request 'sslcerts.Update'", slog.Int64("sslId", getCertificateDetailResp.ID), slog.Any("request", changeCertificateReq), slog.Any("response", changeCertificateResp))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to execute sdk request 'sslcerts.Update': %w", err)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ type SSLDeployerProviderConfig struct {
|
||||
// 雨云 API 密钥。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// RCDN 实例 ID。
|
||||
InstanceId int32 `json:"instanceId"`
|
||||
InstanceId int64 `json:"instanceId"`
|
||||
// 加速域名(支持泛域名)。
|
||||
Domain string `json:"domain"`
|
||||
}
|
||||
@@ -80,13 +80,13 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
|
||||
// RCDN SSL 绑定域名
|
||||
// REF: https://apifox.com/apidoc/shared/a4595cc8-44c5-4678-a2a3-eed7738dab03/api-184214120
|
||||
certId, _ := strconv.ParseInt(upres.CertId, 10, 32)
|
||||
certId, _ := strconv.ParseInt(upres.CertId, 10, 64)
|
||||
rcdnInstanceSslBindReq := &rainyunsdk.RcdnInstanceSslBindRequest{
|
||||
CertId: int32(certId),
|
||||
CertId: certId,
|
||||
Domains: []string{d.config.Domain},
|
||||
}
|
||||
rcdnInstanceSslBindResp, err := d.sdkClient.RcdnInstanceSslBind(d.config.InstanceId, rcdnInstanceSslBindReq)
|
||||
d.logger.Debug("sdk request 'rcdn.InstanceSslBind'", slog.Any("instanceId", d.config.InstanceId), slog.Any("request", rcdnInstanceSslBindReq), slog.Any("response", rcdnInstanceSslBindResp))
|
||||
d.logger.Debug("sdk request 'rcdn.InstanceSslBind'", slog.Int64("instanceId", d.config.InstanceId), slog.Any("request", rcdnInstanceSslBindReq), slog.Any("response", rcdnInstanceSslBindResp))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to execute sdk request 'rcdn.InstanceSslBind': %w", err)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func TestDeploy(t *testing.T) {
|
||||
|
||||
deployer, err := provider.NewSSLDeployerProvider(&provider.SSLDeployerProviderConfig{
|
||||
ApiKey: fApiKey,
|
||||
InstanceId: int32(fInstanceId),
|
||||
InstanceId: fInstanceId,
|
||||
Domain: fDomain,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -15,7 +15,7 @@ type SSLDeployerProviderConfig struct {
|
||||
// 耗子面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 耗子面板访问令牌 ID。
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
AccessTokenId int64 `json:"accessTokenId"`
|
||||
// 耗子面板访问令牌。
|
||||
AccessToken string `json:"accessToken"`
|
||||
// 是否允许不安全的连接。
|
||||
@@ -70,7 +70,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
return &core.SSLDeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSDKClient(serverUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
func createSDKClient(serverUrl string, accessTokenId int64, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
client, err := rpsdk.NewClient(serverUrl, accessTokenId, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -54,7 +54,7 @@ func TestDeploy(t *testing.T) {
|
||||
|
||||
deployer, err := provider.NewSSLDeployerProvider(&provider.SSLDeployerProviderConfig{
|
||||
ServerUrl: fServerUrl,
|
||||
AccessTokenId: int32(fAccessTokenId),
|
||||
AccessTokenId: fAccessTokenId,
|
||||
AccessToken: fAccessToken,
|
||||
AllowInsecureConnections: true,
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ type SSLDeployerProviderConfig struct {
|
||||
// 耗子面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 耗子面板访问令牌 ID。
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
AccessTokenId int64 `json:"accessTokenId"`
|
||||
// 耗子面板访问令牌。
|
||||
AccessToken string `json:"accessToken"`
|
||||
// 是否允许不安全的连接。
|
||||
@@ -77,7 +77,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke
|
||||
return &core.SSLDeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSDKClient(serverUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
func createSDKClient(serverUrl string, accessTokenId int64, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
client, err := rpsdk.NewClient(serverUrl, accessTokenId, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestDeploy(t *testing.T) {
|
||||
|
||||
deployer, err := provider.NewSSLDeployerProvider(&provider.SSLDeployerProviderConfig{
|
||||
ServerUrl: fServerUrl,
|
||||
AccessTokenId: int32(fAccessTokenId),
|
||||
AccessTokenId: fAccessTokenId,
|
||||
AccessToken: fAccessToken,
|
||||
AllowInsecureConnections: true,
|
||||
SiteName: fSiteName,
|
||||
|
||||
@@ -22,7 +22,7 @@ type SSLDeployerProviderConfig struct {
|
||||
ResourceType string `json:"resourceType"`
|
||||
// 证书 ID。
|
||||
// 部署资源类型为 [RESOURCE_TYPE_CERTIFICATE] 时必填。
|
||||
CertificateId int32 `json:"certificateId,omitempty"`
|
||||
CertificateId int64 `json:"certificateId,omitempty"`
|
||||
}
|
||||
|
||||
type SSLDeployerProvider struct {
|
||||
|
||||
@@ -30,7 +30,7 @@ type SSLDeployerProviderConfig struct {
|
||||
Headers map[string]string `json:"headers,omitempty"`
|
||||
// 请求超时(单位:秒)。
|
||||
// 零值时默认值 30。
|
||||
Timeout int32 `json:"timeout,omitempty"`
|
||||
Timeout int `json:"timeout,omitempty"`
|
||||
// 是否允许不安全的连接。
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
)
|
||||
|
||||
type CreateRecordRequest struct {
|
||||
DomainId string `json:"domainId"`
|
||||
DomainId *string `json:"domainId"`
|
||||
GroupId *string `json:"groupId,omitempty"`
|
||||
LineId *string `json:"lineId,omitempty"`
|
||||
Type int32 `json:"type"`
|
||||
Host string `json:"host"`
|
||||
Data string `json:"data"`
|
||||
Ttl int32 `json:"ttl"`
|
||||
Type *int32 `json:"type"`
|
||||
Host *string `json:"host"`
|
||||
Data *string `json:"data"`
|
||||
Ttl *int32 `json:"ttl"`
|
||||
Weight *int32 `json:"weight,omitempty"`
|
||||
Preference *int32 `json:"preference,omitempty"`
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type UpdateRecordRequest struct {
|
||||
Id string `json:"id"`
|
||||
Id *string `json:"id"`
|
||||
GroupId *string `json:"groupId,omitempty"`
|
||||
LineId *string `json:"lineId,omitempty"`
|
||||
Type *int32 `json:"type,omitempty"`
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type RcdnInstanceSslBindRequest struct {
|
||||
CertId int32 `json:"cert_id"`
|
||||
CertId int64 `json:"cert_id"`
|
||||
Domains []string `json:"domains"`
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ type RcdnInstanceSslBindResponse struct {
|
||||
apiResponseBase
|
||||
}
|
||||
|
||||
func (c *Client) RcdnInstanceSslBind(instanceId int32, req *RcdnInstanceSslBindRequest) (*RcdnInstanceSslBindResponse, error) {
|
||||
func (c *Client) RcdnInstanceSslBind(instanceId int64, req *RcdnInstanceSslBindRequest) (*RcdnInstanceSslBindResponse, error) {
|
||||
return c.RcdnInstanceSslBindWithContext(context.Background(), instanceId, req)
|
||||
}
|
||||
|
||||
func (c *Client) RcdnInstanceSslBindWithContext(ctx context.Context, instanceId int32, req *RcdnInstanceSslBindRequest) (*RcdnInstanceSslBindResponse, error) {
|
||||
func (c *Client) RcdnInstanceSslBindWithContext(ctx context.Context, instanceId int64, req *RcdnInstanceSslBindRequest) (*RcdnInstanceSslBindResponse, error) {
|
||||
if instanceId == 0 {
|
||||
return nil, fmt.Errorf("sdkerr: unset instanceId")
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ type SslCenterGetResponse struct {
|
||||
Data *SslDetail `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) SslCenterGet(sslId int32) (*SslCenterGetResponse, error) {
|
||||
func (c *Client) SslCenterGet(sslId int64) (*SslCenterGetResponse, error) {
|
||||
return c.SslCenterGetWithContext(context.Background(), sslId)
|
||||
}
|
||||
|
||||
func (c *Client) SslCenterGetWithContext(ctx context.Context, sslId int32) (*SslCenterGetResponse, error) {
|
||||
func (c *Client) SslCenterGetWithContext(ctx context.Context, sslId int64) (*SslCenterGetResponse, error) {
|
||||
if sslId == 0 {
|
||||
return nil, fmt.Errorf("sdkerr: unset sslId")
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ func (r *apiResponseBase) GetMessage() string {
|
||||
var _ apiResponse = (*apiResponseBase)(nil)
|
||||
|
||||
type SslRecord struct {
|
||||
ID int32 `json:"ID"`
|
||||
UID int32 `json:"UID"`
|
||||
ID int64 `json:"ID"`
|
||||
UID int64 `json:"UID"`
|
||||
Domain string `json:"Domain"`
|
||||
Issuer string `json:"Issuer"`
|
||||
StartDate int64 `json:"StartDate"`
|
||||
@@ -45,5 +45,5 @@ type SslDetail struct {
|
||||
Issuer string `json:"Issuer"`
|
||||
StartDate int64 `json:"StartDate"`
|
||||
ExpireDate int64 `json:"ExpDate"`
|
||||
RemainDays int32 `json:"RemainDays"`
|
||||
RemainDays int64 `json:"RemainDays"`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user