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

Adding DNSAPI wrapper for Websupport webhosting (Slovakia) #3392

Merged
merged 78 commits into from Apr 19, 2021

Conversation

akulumbeg
Copy link
Contributor

Hello @Neilpang, I managed to fix everything and I am opening a new pull request for easier organization. Please close the original #3184 .

A couple of things that I fixed and improved from the original script by @trgosk (again, great job!).

  • the timestamp is now generated by the _time() function as requested by @Neilpang
  • the authorization is now done via the _hmac() function
  • Solaris check passes (see the actions in my repo )

For the future reference, anyone struggling with Solaris as much as I did, read this:
Solaris shell cannot convert dates from epoch properly. Neither "date -u -d @"timestamp"", nor "date -u -r "timestamp"" work.
To mend this, after some experimenting, did another 2>/dev/null condition resulting in using the _utc_date() function modified by sed to achieve the ISO8601 format (line 161).

Please do not change this. The Websupport API is particularly sensitive to a match of the epoch timestamp and the utc date generated from the timestamp. Every other system can convert the timestamp variable into a date and work with that, so that is prioritized. If that fails, the _utc_date()/sed kicks in as a failsafe.

However, there is a (virtually nonexistent) possibility of a bug occurence, when there is a 1 (or more) second delay between execution of _time() and _utc_date(), then they won't match. Again this should never happen because we are in the 21st century and have powerful processors, but the possibility exists. In Solaris there is no other way that I know of to mend this, perhaps using some long perl scripts etc., but I don't think it's worth the time finding this solution out.

Other than that, everything works perfectly, I tested it on my Synology NAS and believe it can be pushed as-is. Once it gets pushed into the dev branch, I will update the Wiki entry.

@akulumbeg
Copy link
Contributor Author

Obviously, the DNS check will fail in the pull request due to different secrets etc, but again, the actions in my repo and my real-life test on NAS show that it is working properly.

dnsapi/dns_websupport.sh Outdated Show resolved Hide resolved
@akulumbeg
Copy link
Contributor Author

Tried all sorts of combinations for the _hmac authorization but none worked, I reverted back to what worked originally.

medmunds and others added 24 commits March 21, 2021 16:20
Just in case, make sure CR or NL don't end up in
an email header.
Improves standards compatibility and utf-8 handling
in Python 3.3-3.8. (email.policy.default becomes the
default in Python 3.9.)
Secure by default. Also try to minimize configuration errors.
(Many ESPs/ISPs require STARTTLS, and most support it.)
没有encode中文字符会导致提交失败
The API now supports a POST route for adding records. Therefore
checking for already existing records and including them in a PATCH
request is no longer necessary.
Updated dns_servercow.sh to support txt records with multiple entries. This supports wildcard certificates that require txt records with the same name and different contents.
Updated dns_servercow.sh to support txt records with multiple entries. This supports wildcard certificates that require txt records with the same name and different contents.
Hopefully the last one
@akulumbeg
Copy link
Contributor Author

The code is exactly as it was when it initially worked, passing all checks, in February. Now Oraclelinux:8 fails and the log does not give me any hint what might be wrong...

@Neilpang
Copy link
Member

you can debug oraclelinux docker locally.

It's easy to run acmetest locally: https://github.com/acmesh-official/acmetest

All the CI checks must be passing before it can be merged.

Thanks.

@akulumbeg
Copy link
Contributor Author

akulumbeg commented Apr 18, 2021

@Neilpang after some time, I got back to this. I tested everything locally and it worked flawlessly even on oracle linux. I also re-ran the checks and they all passed (see here, commit 051775b String update).

I came to the conclusion that when I was testing this a month ago, there was actually a short-term issue on the webhosting provider server, because in fact it gave me a 400 error only one one platform, without any clashes on the others.

This being said, I am confident that this implementation works, it passes all the checks, it has been tested locally on at least three platforms in DNS and Standalone modes and I think it is ready to be pushed to the dev repo, and then to master.

@Neilpang
Copy link
Member

did you create an issue for bug reporting ?

https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide

@akulumbeg
Copy link
Contributor Author

Thank you for reminding me, I did now here #3486

@Neilpang Neilpang merged commit 509d3f6 into acmesh-official:dev Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet