srvrco / getssl

obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
GNU General Public License v3.0
2.07k stars 372 forks source link

Script dns_del_ionos problem #814

Open gasteropod opened 11 months ago

gasteropod commented 11 months ago

Describe the bug The dns_del_ionos script does not work with ionos account which have multiple domains.

The script fails with: curl: (3) URL using bad/illegal format or missing URL

because more than one zone is returned from the initial curl command. The script needs the same logic that is in the dns_add_ionos script to pick out the domain being used. It's really odd that the add script has this logic when it is missing from the del script.

There should also really be a check that a valid record exists before trying to deleted it. getssl calls the del script to cleanup and when doing a re-try at which point the record might not exist. So the script should not assume the record exists and should only delete the record if it does.

To Reproduce Steps to reproduce the behavior:

Run the script against an ionos account which has multiple domains.

Expected behavior DNS entry added by add script should be deleted.

Operating system (please complete the following information):

Additional context I'm going to re-implement the script in python since as DNS_IONOS.md states, "JSON processing in bash is ... hard" and processing with error checking will be easier with python than bash with jq.

timkimber commented 7 months ago

Hi @gasteropod

Thanks for catching this, I don't have an ionos account and from memory the dns scripts were provided by someone else. Did you manage to get your python version of the script working? If so I'm happy to add it to the repo.

Note: I currently have very little time to work on getssl due to work commitments

gasteropod commented 7 months ago

Yes, I did. Here are the two scripts in a zip file. github did not allow .tgz file despite saying it would! dns_ionos.zip