fix: dns update comment
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/cloudflare/cloudflare-go"
|
"github.com/cloudflare/cloudflare-go"
|
||||||
)
|
)
|
||||||
@@ -64,6 +65,7 @@ func (a DnsProvider) SetDomainRecord(domain, ip string) error {
|
|||||||
|
|
||||||
// update record
|
// update record
|
||||||
record := dnsRecords[0]
|
record := dnsRecords[0]
|
||||||
|
comment := fmt.Sprintf("updates on %s by BitSrunLoginGo", time.Now().Format("2006-01-02 15:04:05"))
|
||||||
record, err = a.Api.UpdateDNSRecord(context.TODO(), &rc, cloudflare.UpdateDNSRecordParams{
|
record, err = a.Api.UpdateDNSRecord(context.TODO(), &rc, cloudflare.UpdateDNSRecordParams{
|
||||||
ID: record.ID,
|
ID: record.ID,
|
||||||
Name: record.Name,
|
Name: record.Name,
|
||||||
@@ -71,7 +73,7 @@ func (a DnsProvider) SetDomainRecord(domain, ip string) error {
|
|||||||
Content: ip,
|
Content: ip,
|
||||||
TTL: record.TTL,
|
TTL: record.TTL,
|
||||||
Proxied: record.Proxied,
|
Proxied: record.Proxied,
|
||||||
Comment: &record.Comment,
|
Comment: &comment,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user