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

letsencrypt: Fix and extend Gandi DNS challenge #3581

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

agners
Copy link
Member

@agners agners commented Apr 25, 2024

Fix Gandi DNS challenge using an API key. Also add support for token authentication.

Fixes: #3383

Fix Gandi DNS challenge using an API key. Also add support for token
authentication.

Fixes: #3383
@agners agners merged commit 8d0b325 into master Apr 25, 2024
10 checks passed
@agners agners deleted the letsencrypt-fix-gandi branch April 25, 2024 13:02
bashio::log.info "Use Gandi gandi_token"
echo "dns_gandi_token = $(bashio::config 'dns.gandi_token')" >> "/data/dnsapikey"
fi
if bashio::config.exists 'dns.gandi_api_key'; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an 'else' to avoid strange behavior? (Or an error if both are provided.) It looks like token is preferred according to https://api.gandi.net/docs/authentication/. Alternately maybe these should be reversed to give the token precedence.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could be smarter here, but not sure what the correct smartness is. E.g. the sharing id I think is only valid when an API key is present.

The plug-in just seem to read all of them and forward: https://github.com/obynio/certbot-plugin-gandi/blob/master/certbot_plugin_gandi/main.py#L82-L85. So why not doing it here too 🤷‍♂️ 😅

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only forwards one here. Both clauses point to the same target, and if both are set the deprecated one is used because it is last.

Copy link
Member Author

@agners agners Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, if all three are set, it forwards all three, at least with this change:

https://github.com/home-assistant/addons/blob/master/letsencrypt/rootfs/etc/services.d/lets-encrypt/run#L114-L125.

We then just rely on the upstream implementation to pick what it feels right 🤷‍♂️

Maybe it is easiest if you open a PR what you'd suggest to change, then we can discuss an actual suggestion.

miguelrjim pushed a commit to miguelrjim/ha-addons that referenced this pull request Apr 26, 2024
Fix Gandi DNS challenge using an API key. Also add support for token
authentication.

Fixes: home-assistant#3383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gandi dns not working
3 participants