mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
ddclient: Cloudflare - update DNS record instead of overwriting (#3837)
Updating the record preserves proxied status, TTL, comment, and such.
This commit is contained in:
@@ -142,7 +142,6 @@ class Cloudflare(BaseAccount):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
record_id = payload['result'][0]['id']
|
record_id = payload['result'][0]['id']
|
||||||
proxied = payload['result'][0]['proxied']
|
|
||||||
if self.is_verbose:
|
if self.is_verbose:
|
||||||
syslog.syslog(
|
syslog.syslog(
|
||||||
syslog.LOG_NOTICE,
|
syslog.LOG_NOTICE,
|
||||||
@@ -156,11 +155,10 @@ class Cloudflare(BaseAccount):
|
|||||||
'type': recordType,
|
'type': recordType,
|
||||||
'name': self.settings.get('hostnames'),
|
'name': self.settings.get('hostnames'),
|
||||||
'content': str(self.current_address),
|
'content': str(self.current_address),
|
||||||
'proxied': proxied
|
|
||||||
},
|
},
|
||||||
'headers': req_opts['headers']
|
'headers': req_opts['headers']
|
||||||
}
|
}
|
||||||
response = requests.put(**req_opts)
|
response = requests.patch(**req_opts)
|
||||||
try:
|
try:
|
||||||
payload = response.json()
|
payload = response.json()
|
||||||
except requests.exceptions.JSONDecodeError:
|
except requests.exceptions.JSONDecodeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user