structured logs

This commit is contained in:
m5r
2024-07-19 02:24:11 +02:00
parent c202885684
commit 61cf3ec24d
8 changed files with 142 additions and 106 deletions

View File

@@ -3,6 +3,7 @@ package certs
import (
"github.com/go-acme/lego/v4/challenge/dns01"
"local-ip.sh/utils"
"local-ip.sh/xip"
)
@@ -11,12 +12,14 @@ type DNSProviderLocalIp struct {
}
func (d *DNSProviderLocalIp) Present(domain, token, keyAuth string) error {
utils.Logger.Debug().Str("domain", domain).Msg("DNS01 challenge - present")
fqdn, value := dns01.GetRecord(domain, keyAuth)
d.xip.SetTXTRecord(fqdn, value)
return nil
}
func (d *DNSProviderLocalIp) CleanUp(domain, token, keyAuth string) error {
utils.Logger.Debug().Str("domain", domain).Msg("DNS01 challenge - cleanup")
fqdn, _ := dns01.GetRecord(domain, keyAuth)
d.xip.UnsetTXTRecord(fqdn)
return nil