obynio / certbot-plugin-gandi

Certbot plugin for authentication using Gandi LiveDNS
https://pypi.org/project/certbot-plugin-gandi/
MIT License
194 stars 27 forks source link

improvement: sharing ID parameter #15

Closed gbaudot closed 4 years ago

gbaudot commented 4 years ago

Hello. After a little while running with home made manual hooks, I decided to try and use "official" plugin, but as my case requires the use of sharing ID, I forked your project and made the required changes. Then my question is: would you want this to be merged (or redo it your own way: since I am not really used to Python programming, I may have made it the wrong way... even if it happens to work) or should I just keep it for my personal use ?

Regards, GB

obynio commented 4 years ago

Hello,

Yes I saw your changes when you forked the project and it seems to be a good feature to add. I'll take a look at your work to add your changes on this project :slightly_smiling_face:

For people looking at this issue, the SHARING_ID is mentionned in the LiveDNS documentation https://doc.livedns.gandi.net/

baloo commented 4 years ago

There is some description of it here: https://api.gandi.net/docs/reference/#Sharing-ID

Feel free to mention me if you need help with that feature.

gbaudot commented 4 years ago

Hello. If still willing to implement the change I made, I think most of it is harmless but for the URL parameter addition (which is dirty, indeed / quite sure there is a proper python way, just don't know it).

Regards, GB

obynio commented 4 years ago

Thank you, I just drafted a new release with your changes. I think it's cleaner to pass the sharing_id directly to the request lib which will discard it if set to None.

Titome commented 4 years ago

It's seem not to be optional... Cannot obtain certificate without sharing id

sudo certbot certonly -a certbot-plugin-gandi:dns --certbot-plugin-gandi:dns-credentials /etc/letsencrypt/gandi.ini -m XXXXX@timotheegirard.com --agree-tos -n -d \*.timotheegirard.com -d timotheegirard.com

[sudo] password for timothee: 
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator certbot-plugin-gandi:dns, Installer None
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for timotheegirard.com
dns-01 challenge for timotheegirard.com
Cleaning up challenges
Missing property in credentials configuration file /etc/letsencrypt/gandi.ini:
 * Property "certbot_plugin_gandi:dns_sharing_id" not found (should be Optional Gandi organization ID).

gandi.ini :

certbot_plugin_gandi:dns_api_key=XXXXXXXXXXXXXXX
gbaudot commented 4 years ago

Well, apparently the params passed to request (gandi_api.py, line 39) should be conditioned to the actual parameter presence. Anyway, I wish you all a happy new year, cheers!

Titome commented 4 years ago

Thanks !

It's work with this gandi.ini :

certbot_plugin_gandi:dns_api_key=XXXXXXXXXXXX
certbot_plugin_gandi:dns_sharing_id=None
obynio commented 4 years ago

Thanks @Titome, I'll publish a new release to correct this issue

obynio commented 4 years ago

I misread the certbot api and wrongly assumed the parameters could be optional. The issue should be fixed in the latest release 1.2.5. I hope it won't break anything.

gbaudot commented 4 years ago

Many thanks. I guess it is time for me now to get rid of my fork and fix my deps.

++ Gi)