troykelly / hassio-addons-letsencrypt-lexicon

Home Assistant Addon that provides Let's Encrypt with Lexicon
Apache License 2.0
5 stars 2 forks source link

Godaddy integration broken (Unauthorized for url: https://api.godaddy.com/v1/domains/<mydomain>) #26

Closed shoguevara closed 1 year ago

shoguevara commented 1 year ago

Problem/Motivation

Been using the integration for more than 2 years. And btw grateful for it AF! Thanks a ton! But today I tried to renew my Let's encrypt cert (the previous one outdated yesterday) and ran into authorization error. Thought my API key and secret might be outdated, so regenerated them (actually, generated a new pair), changed addon configuration accordingly, but got the same result

localy running curl -X GET -H "Authorization: sso-key :" "https://api.godaddy.com/v1/domains/available?domain=" get's {"available":false,"definitive":true,"domain":"my.domain"} expected result - authorisation is OK

Expected behavior

Expected regular cert renewal

Actual behavior

But had errors like: deploy_challenge called: ,

Traceback (most recent call last): File "/usr/local/bin/lexicon", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/site-packages/lexicon/cli.py", line 131, in main results = client.execute() File "/usr/local/lib/python3.10/site-packages/lexicon/client.py", line 81, in execute self.provider.authenticate() File "/usr/local/lib/python3.10/site-packages/lexicon/providers/base.py", line 73, in authenticate self._authenticate() File "/usr/local/lib/python3.10/site-packages/lexicon/providers/godaddy.py", line 58, in _authenticate result = self._get(f"/domains/{domain}") File "/usr/local/lib/python3.10/site-packages/lexicon/providers/base.py", line 173, in _get return self._request("GET", url, query_params=query_params) File "/usr/local/lib/python3.10/site-packages/lexicon/providers/godaddy.py", line 331, in _request result.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.godaddy.com/v1/domains/ ERROR: deploy_challenge hook returned with non-zero exit code [19:32:11] WARNING: certificate refresh crashed, halting add-on ## Steps to reproduce Configure godaddy domain, try getting a cert from Let's Encrypt Can actually provide with temporary API key pair for testing purposes.
troykelly commented 1 year ago

Hi there @shoguevara thank you for flagging the issue. I don't have a GoDaddy account to test with I'm afraid.

Can I please confirm you have the three dns options below set with the correct values? (please don't put them in the ticket)

email: hello@home-assistant.io
domains:
  - home-assistant.io
dns:
  provider: godaddy
  godaddy_auth_key: 81d2c546-90e9-4bc6-bca2-5457ee0e554a
  godaddy_auth_secret: 78ed753d-4721-4849-b203-b3e45ab08e3d

https://dns-lexicon.readthedocs.io/en/latest/configuration_reference.html#godaddy

shoguevara commented 1 year ago
email: hello@home-assistant.io
domains:
  - home-assistant.io
dns:
  provider: godaddy
  godaddy_auth_key: 81d2c546-90e9-4bc6-bca2-5457ee0e554a
  godaddy_auth_secret: 78ed753d-4721-4849-b203-b3e45ab08e3d

Yep. All the options are filled in. Email and domains are filled in according text fields and in the "options: field there's a record, like:

provider: godaddy
godaddy_key: <here_goes_api_key>
godaddy_secret: <here_goes_api_secret>

And as I mentioned in the issue text, it was working just fine till recently. Also you can email me via my username [at]gmail.com and I'll share all the settings necessary to test it from your side, ofc if you have time/opportunity to do so. There are no vital resources associated with my domain name, so I'm not afraid of you breaking anything :D

troykelly commented 1 year ago

The godaddy options need to be

  godaddy_auth_key: <here_goes_api_key>
  godaddy_auth_secret: <here_goes_api_secret>

The recent update of lexicon changed a bunch of the option names. https://github.com/troykelly/hassio-addons-letsencrypt-lexicon/releases/tag/v3.0.2

shoguevara commented 1 year ago
godaddy_auth_secret

OMG, forgive me my inattentiveness! Now I see the difference. And I can confirm now that with the new names it works perfectly fine. Thank you so much! <3 The issue can be closed

troykelly commented 1 year ago

Totally fine @shoguevara It would have caught me as well, I always just click update... Glad it is working again. Thank you for reaching out with the issue.