Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a comment referencing the update time #180

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cloudflare-ddns.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import threading
import time
import requests
from datetime import datetime

CONFIG_PATH = os.environ.get('CONFIG_PATH', os.getcwd())

Expand Down Expand Up @@ -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 Cloudflare DDNS at {timestamp}."
}
dns_records = cf_api(
"zones/" + option['zone_id'] +
Expand Down