dns/ddclient hetzner existing record update patch#5188
dns/ddclient hetzner existing record update patch#5188jnikodemus wants to merge 7 commits intoopnsense:masterfrom
Conversation
Added workaround for API bug on update record. Thanks to @ArcanConsulting
Added LOG_NOTICE for deletion.
|
wouldn't it be better to open a ticket at their end, it feels rather weird to patch the caller in this case (assuming its a bug and not a documented change of behavior) |
|
You are right, I've contacted the hoster again. I'll write it correct. |
Updated _update method. No workaround needed.
fix: correct indentation of return statement in _update_record
|
I was just going to open a pull request for the same issue but then I found yours. Since you also removed some code duplication, your changes are ahead of mine (see 7bc1af4). One thing I have noticed is that you are including the TTL parameter in your request. This should be removed as it's not used in the update_records action (see https://docs.hetzner.cloud/reference/cloud#tag/zone-rrset-actions/update_zone_rrset_records). |
fix: removed ttl from _update_record as its not supported (thanks to Ollienator).
Thank you, appreciate the hint. I've removed the ttl from the _update_record and tested again -> success. |
|
Any news on this? |
|
I'm waiting for a merge. Using this fix since 3 weeks without problems. |
|
Would also like to see this fix included. Want to keep using ddclient and migrate to Hetzner DNS via API. |
|
I have the same trouble with updating DNS records via new Hetzner API. I can confirm pulling this patch for hetzner.py seems to work properly. |
|
@jnikodemus I (quick) checked your source code and I'm not sure that I fully understood, so let me try to explain what I would do with the given
No need to Doing it that way will be resource and cost efficient. |
|
@TheRealBecks The request to update the IP of an RRSet Record is a POST action. (https://docs.hetzner.cloud/reference/cloud#tag/zone-rrset-actions/update_zone_rrset_records) |
|
It was intended as quickfix, to get things running without overengineering. After reviewieng the logic again I would agree with @TheRealBecks that the API-Call to check for existence is not needed as it creates the record anyway if not exists (not a typocheck as I thought in the first place). However, based on my reading of the documentation, I would still keep this as a POST, as @becast mentioned. Now that we are trying to improve the implementation in efficiency, I think the API call to retrieve the zone_id may also be unnecessary (not verified in depth yet). The new API supports changes based on zone_name, which is already extracted locally via _get_zone_name(). |
|
@becast Okay, understand, I referenced the calls of type
@jnikodemus No overengineering involved, only two calls as intended (and as you also said in your last post) 🙂 |
|
@TheRealBecks I've removed the check for existence and the now unneseccary method _get_record(). I’d appreciate a quick check. |
|
Code looks good to me, but the permission doesn't seems to be correct by now: |
Fix ddclient update Hetzner for new API
Reference
pull#5082
issue#5187
Problem
The actual update method returns code 200 for an update, because it doesnt use the right entrypoint.
Fix
Changed the API entrypoint "actions" and removed code duplication.
Testing
Tested on a local OPNsense instance with multiple records.