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

Support alternative Cloudflare API token file format #714

Open
naanlizard opened this issue Mar 17, 2024 · 8 comments
Open

Support alternative Cloudflare API token file format #714

naanlizard opened this issue Mar 17, 2024 · 8 comments
Labels
design? The next step is to reflect upon the information and come up with a good design enhancement New feature or request low priority This is low priority, usually because no one has requested the feature yet
Milestone

Comments

@naanlizard
Copy link

naanlizard commented Mar 17, 2024

Small issue here, other services (letsencrypt and stuff using it) tend to use cloudflare's API key in the form of

# Cloudflare API token used by Certbot
dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567

https://certbot-dns-cloudflare.readthedocs.io/en/stable/

would it be possible to add support for that formatting so I don't need as many files kicking around?

Originally posted by @naanlizard in #668 (comment)

@favonia favonia changed the title cloud flare API key file format Support alternative Cloudflare API token file format Mar 17, 2024
@favonia
Copy link
Owner

favonia commented Mar 17, 2024

@naanlizard Thank you. I will have to think about this due to the additional complexity, and this feature might have lower priority on my list (sorry). On the other hand, I wonder if your true concern is the burden to maintain consistency across multiple configuration files, which I deeply sympathize! If so, I think tools like conf might help.

@favonia favonia added design? The next step is to reflect upon the information and come up with a good design low priority This is low priority, usually because no one has requested the feature yet enhancement New feature or request labels Mar 17, 2024
@favonia favonia added this to the far future milestone Jun 22, 2024
@favonia
Copy link
Owner

favonia commented Jul 18, 2024

@naanlizard I wonder if you have tried the tool I suggested?

In the meanwhile, I might have come up with a good solution. I wonder if you are okay with writing a regular expression to identify the token? You will need to write a regular expression and the first submatch named token will be used as the API token. For example, the regular expression to use the whole file is

^(?<token>.*)$

Design question: the first config name that comes to my mind is ridiculously long: CF_API_TOKEN_FILE_CONTENT_REGEX

@favonia
Copy link
Owner

favonia commented Aug 12, 2024

@naanlizard Hi, I have been trying various experiments and wonder how you feel about the design. BTW, I think the idea "first submatched named token" is overkill. It should just be "first numbered capture group". So the regular expression to match the whole file is just

^(.*)$

and it should probably be CF_API_TOKEN_REGEX for the whole file.

@naanlizard
Copy link
Author

I'm sorry to be so quiet here - for the moment I can't play with this, but in a few weeks I'll be redoing one of my sites and can go in depth then!

@favonia
Copy link
Owner

favonia commented Sep 13, 2024

@naanlizard I wonder if you have any new discovery?

@naanlizard
Copy link
Author

naanlizard commented Sep 19, 2024 via email

@favonia
Copy link
Owner

favonia commented Sep 19, 2024

@naanlizard Sorry but the feature was not ready yet. I was mostly only brainstorming.

@favonia
Copy link
Owner

favonia commented Sep 20, 2024

@naanlizard I should elaborate: I thought you were planning to try out tools like https://github.com/kelseyhightower/confd that can synchronize multiple configuration files. Given my commitment to backward compatibility, I'd like to ensure we have a good design before implementing anything in the updater. Sorry for my miscommunication that made you think the feature was ready. I was hoping that you could join the conversation to help me pin down a good design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design? The next step is to reflect upon the information and come up with a good design enhancement New feature or request low priority This is low priority, usually because no one has requested the feature yet
Projects
None yet
Development

No branches or pull requests

2 participants