fix: couldn't save certificate source

This commit is contained in:
Fu Diwei 2025-01-05 01:16:00 +08:00
parent ddb6a88392
commit 3c70a4f455
3 changed files with 6 additions and 23 deletions

View File

@ -216,9 +216,9 @@ func apply(option *applyConfig, provider challenge.Provider) (*Certificate, erro
} }
challengeOptions := make([]dns01.ChallengeOption, 0) challengeOptions := make([]dns01.ChallengeOption, 0)
nameservers := parseNameservers(option.Nameservers) if len(option.Nameservers) > 0 {
if len(nameservers) > 0 { challengeOptions = append(challengeOptions, dns01.AddRecursiveNameservers(dns01.ParseNameservers(strings.Split(option.Nameservers, ";"))))
challengeOptions = append(challengeOptions, dns01.AddRecursiveNameservers(nameservers)) challengeOptions = append(challengeOptions, dns01.DisableAuthoritativeNssPropagationRequirement())
} }
client.Challenge.SetDNS01Provider(provider, challengeOptions...) client.Challenge.SetDNS01Provider(provider, challengeOptions...)
@ -306,23 +306,6 @@ func getReg(client *lego.Client, sslProvider *SSLProviderConfig, user *applyUser
return reg, nil return reg, nil
} }
func parseNameservers(ns string) []string {
nameservers := make([]string, 0)
lines := strings.Split(ns, ";")
for _, line := range lines {
line = strings.TrimSpace(line)
if line == "" {
continue
}
nameservers = append(nameservers, line)
}
return nameservers
}
func parseKeyAlgorithm(algo string) certcrypto.KeyType { func parseKeyAlgorithm(algo string) certcrypto.KeyType {
switch algo { switch algo {
case "RSA2048": case "RSA2048":

View File

@ -130,7 +130,7 @@ func (w *WorkflowOutputRepository) Save(ctx context.Context, output *domain.Work
} }
certRecord := models.NewRecord(certCollection) certRecord := models.NewRecord(certCollection)
certRecord.Set("source", certificate.Source) certRecord.Set("source", string(certificate.Source))
certRecord.Set("subjectAltNames", certificate.SubjectAltNames) certRecord.Set("subjectAltNames", certificate.SubjectAltNames)
certRecord.Set("certificate", certificate.Certificate) certRecord.Set("certificate", certificate.Certificate)
certRecord.Set("privateKey", certificate.PrivateKey) certRecord.Set("privateKey", certificate.PrivateKey)

View File

@ -161,9 +161,9 @@ const WorkflowList = () => {
if (record.lastRunId) { if (record.lastRunId) {
if (record.lastRunStatus === WORKFLOW_RUN_STATUSES.SUCCEEDED) { if (record.lastRunStatus === WORKFLOW_RUN_STATUSES.SUCCEEDED) {
return ( return (
<Space className="max-w-full" direction="vertical" size={4}> <Space>
<Badge status="success" count={<CheckCircleOutlinedIcon style={{ color: themeToken.colorSuccess }} />} /> <Badge status="success" count={<CheckCircleOutlinedIcon style={{ color: themeToken.colorSuccess }} />} />
<Typography.Text type="secondary">{dayjs(record.lastRunTime!).format("YYYY-MM-DD HH:mm:ss")}</Typography.Text> <Typography.Text>{dayjs(record.lastRunTime!).format("YYYY-MM-DD HH:mm:ss")}</Typography.Text>
</Space> </Space>
); );
} else if (record.lastRunStatus === WORKFLOW_RUN_STATUSES.FAILED) { } else if (record.lastRunStatus === WORKFLOW_RUN_STATUSES.FAILED) {