mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-18 18:29:58 +00:00
feat: improve workflow log
This commit is contained in:
parent
d58109f4be
commit
bd26dfecb8
@ -128,7 +128,7 @@ func (n *WorkflowNode) GetConfigForApply() WorkflowNodeConfigForApply {
|
||||
CAProvider: maputil.GetString(n.Config, "caProvider"),
|
||||
CAProviderAccessId: maputil.GetString(n.Config, "caProviderAccessId"),
|
||||
CAProviderConfig: maputil.GetKVMapAny(n.Config, "caProviderConfig"),
|
||||
KeyAlgorithm: maputil.GetString(n.Config, "keyAlgorithm"),
|
||||
KeyAlgorithm: maputil.GetOrDefaultString(n.Config, "keyAlgorithm", string(CertificateKeyAlgorithmTypeRSA2048)),
|
||||
Nameservers: maputil.GetString(n.Config, "nameservers"),
|
||||
DnsPropagationWait: maputil.GetInt32(n.Config, "dnsPropagationWait"),
|
||||
DnsPropagationTimeout: maputil.GetInt32(n.Config, "dnsPropagationTimeout"),
|
||||
|
@ -3,6 +3,7 @@ package nodeprocessor
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -35,7 +36,8 @@ func NewApplyNode(node *domain.WorkflowNode) *applyNode {
|
||||
}
|
||||
|
||||
func (n *applyNode) Process(ctx context.Context) error {
|
||||
n.logger.Info("ready to obtain certificiate ...")
|
||||
nodeCfg := n.node.GetConfigForApply()
|
||||
n.logger.Info("ready to obtain certificiate ...", slog.Any("config", nodeCfg))
|
||||
|
||||
// 查询上次执行结果
|
||||
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
||||
|
@ -33,7 +33,8 @@ func NewDeployNode(node *domain.WorkflowNode) *deployNode {
|
||||
}
|
||||
|
||||
func (n *deployNode) Process(ctx context.Context) error {
|
||||
n.logger.Info("ready to deploy certificate ...")
|
||||
nodeCfg := n.node.GetConfigForDeploy()
|
||||
n.logger.Info("ready to deploy certificate ...", slog.Any("config", nodeCfg))
|
||||
|
||||
// 查询上次执行结果
|
||||
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -31,9 +32,8 @@ func NewMonitorNode(node *domain.WorkflowNode) *monitorNode {
|
||||
}
|
||||
|
||||
func (n *monitorNode) Process(ctx context.Context) error {
|
||||
n.logger.Info("ready to monitor certificate ...")
|
||||
|
||||
nodeCfg := n.node.GetConfigForMonitor()
|
||||
n.logger.Info("ready to monitor certificate ...", slog.Any("config", nodeCfg))
|
||||
|
||||
targetAddr := net.JoinHostPort(nodeCfg.Host, fmt.Sprintf("%d", nodeCfg.Port))
|
||||
if nodeCfg.Port == 0 {
|
||||
|
@ -28,9 +28,8 @@ func NewNotifyNode(node *domain.WorkflowNode) *notifyNode {
|
||||
}
|
||||
|
||||
func (n *notifyNode) Process(ctx context.Context) error {
|
||||
n.logger.Info("ready to send notification ...")
|
||||
|
||||
nodeCfg := n.node.GetConfigForNotify()
|
||||
n.logger.Info("ready to send notification ...", slog.Any("config", nodeCfg))
|
||||
|
||||
if nodeCfg.Provider == "" {
|
||||
// Deprecated: v0.4.x 将废弃
|
||||
|
@ -3,6 +3,7 @@ package nodeprocessor
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -32,9 +33,8 @@ func NewUploadNode(node *domain.WorkflowNode) *uploadNode {
|
||||
}
|
||||
|
||||
func (n *uploadNode) Process(ctx context.Context) error {
|
||||
n.logger.Info("ready to upload certiticate ...")
|
||||
|
||||
nodeCfg := n.node.GetConfigForUpload()
|
||||
n.logger.Info("ready to upload certiticate ...", slog.Any("config", nodeCfg))
|
||||
|
||||
// 查询上次执行结果
|
||||
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user