mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-19 02:39:57 +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"),
|
CAProvider: maputil.GetString(n.Config, "caProvider"),
|
||||||
CAProviderAccessId: maputil.GetString(n.Config, "caProviderAccessId"),
|
CAProviderAccessId: maputil.GetString(n.Config, "caProviderAccessId"),
|
||||||
CAProviderConfig: maputil.GetKVMapAny(n.Config, "caProviderConfig"),
|
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"),
|
Nameservers: maputil.GetString(n.Config, "nameservers"),
|
||||||
DnsPropagationWait: maputil.GetInt32(n.Config, "dnsPropagationWait"),
|
DnsPropagationWait: maputil.GetInt32(n.Config, "dnsPropagationWait"),
|
||||||
DnsPropagationTimeout: maputil.GetInt32(n.Config, "dnsPropagationTimeout"),
|
DnsPropagationTimeout: maputil.GetInt32(n.Config, "dnsPropagationTimeout"),
|
||||||
|
@ -3,6 +3,7 @@ package nodeprocessor
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -35,7 +36,8 @@ func NewApplyNode(node *domain.WorkflowNode) *applyNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n *applyNode) Process(ctx context.Context) error {
|
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)
|
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 {
|
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)
|
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -31,9 +32,8 @@ func NewMonitorNode(node *domain.WorkflowNode) *monitorNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n *monitorNode) Process(ctx context.Context) error {
|
func (n *monitorNode) Process(ctx context.Context) error {
|
||||||
n.logger.Info("ready to monitor certificate ...")
|
|
||||||
|
|
||||||
nodeCfg := n.node.GetConfigForMonitor()
|
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))
|
targetAddr := net.JoinHostPort(nodeCfg.Host, fmt.Sprintf("%d", nodeCfg.Port))
|
||||||
if nodeCfg.Port == 0 {
|
if nodeCfg.Port == 0 {
|
||||||
|
@ -28,9 +28,8 @@ func NewNotifyNode(node *domain.WorkflowNode) *notifyNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n *notifyNode) Process(ctx context.Context) error {
|
func (n *notifyNode) Process(ctx context.Context) error {
|
||||||
n.logger.Info("ready to send notification ...")
|
|
||||||
|
|
||||||
nodeCfg := n.node.GetConfigForNotify()
|
nodeCfg := n.node.GetConfigForNotify()
|
||||||
|
n.logger.Info("ready to send notification ...", slog.Any("config", nodeCfg))
|
||||||
|
|
||||||
if nodeCfg.Provider == "" {
|
if nodeCfg.Provider == "" {
|
||||||
// Deprecated: v0.4.x 将废弃
|
// Deprecated: v0.4.x 将废弃
|
||||||
|
@ -3,6 +3,7 @@ package nodeprocessor
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -32,9 +33,8 @@ func NewUploadNode(node *domain.WorkflowNode) *uploadNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n *uploadNode) Process(ctx context.Context) error {
|
func (n *uploadNode) Process(ctx context.Context) error {
|
||||||
n.logger.Info("ready to upload certiticate ...")
|
|
||||||
|
|
||||||
nodeCfg := n.node.GetConfigForUpload()
|
nodeCfg := n.node.GetConfigForUpload()
|
||||||
|
n.logger.Info("ready to upload certiticate ...", slog.Any("config", nodeCfg))
|
||||||
|
|
||||||
// 查询上次执行结果
|
// 查询上次执行结果
|
||||||
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
lastOutput, err := n.outputRepo.GetByNodeId(ctx, n.node.Id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user