From 7ae779195ec35cadf4d175d8bd60ae9ac7b3877e Mon Sep 17 00:00:00 2001 From: Luke Cotton Date: Sat, 10 Feb 2024 21:19:55 +0000 Subject: [PATCH 1/2] Add a comment referencing the update time --- cloudflare-ddns.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index 1d56863..a37cf08 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -15,6 +15,7 @@ import threading import time import requests +from datetime import datetime CONFIG_PATH = os.environ.get('CONFIG_PATH', os.getcwd()) @@ -137,12 +138,14 @@ def commitRecord(ip): # Check if name provided is a reference to the root domain if name != '' and name != '@': fqdn = name + "." + base_domain_name + timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") record = { "type": ip["type"], "name": fqdn, "content": ip["ip"], "proxied": proxied, - "ttl": ttl + "ttl": ttl, + "comment": f"Updated by CloudflareDDNS at {timestamp}." } dns_records = cf_api( "zones/" + option['zone_id'] + From e5bce1bdf92e0ebb9ddeabfb56a67110c053b257 Mon Sep 17 00:00:00 2001 From: Luke Cotton Date: Sat, 10 Feb 2024 21:31:16 +0000 Subject: [PATCH 2/2] Bring comment styling in line with project --- cloudflare-ddns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index a37cf08..4ea654b 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -145,7 +145,7 @@ def commitRecord(ip): "content": ip["ip"], "proxied": proxied, "ttl": ttl, - "comment": f"Updated by CloudflareDDNS at {timestamp}." + "comment": f"Updated by Cloudflare DDNS at {timestamp}." } dns_records = cf_api( "zones/" + option['zone_id'] +