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

os-ddclient: opnsense backend and cloudflare: use API token if available #3435

Closed
wants to merge 1 commit into from

Conversation

juantxorena
Copy link
Contributor

If the username is "token", use the password as an API token instead of a global one. Tested locally. This should fix bug #3427.

I'm not a python programmer, please feel free to fix the style.

If the username is "token", use the password as an API token instead of a global one
@juantxorena juantxorena changed the title use API token if available os-ddclient: opnsense backend and cloudflare: use API token if available May 11, 2023
@AdSchellevis
Copy link
Member

I think this is a bit too obscure, maybe we better switch on username provided or not (no username equals Bearer).
Can I interest you to contribute to the documentation as well ? (https://github.com/opnsense/docs/blob/master/source/manual/dynamic_dns.rst#L6) I would be good to describe the different options for cloudflare.

@AdSchellevis AdSchellevis self-assigned this May 11, 2023
@juantxorena
Copy link
Contributor Author

juantxorena commented May 11, 2023

I just copied the same logic as ddclient, so the exact same config would work when changing backends. I would agree with the empty name. Maybe we can check for both empty and "token"? It wouldn't be compatible with ddclient, though.

About the documentation, maybe I can have a look at the weekend. Would there be a specific documentation for cloudflare?

@AdSchellevis
Copy link
Member

that's a good point, when it's clear from the documentation, it shouldn't be an issue to support "token" as well or maybe a simple check if it's an email address (if I understand this correctly, only email addresses are supported for X-auth-* headers)

juantxorena added a commit to juantxorena/docs that referenced this pull request May 12, 2023
Documentation for cloudflare in PR opnsense/plugins#3435
@juantxorena
Copy link
Contributor Author

I created a PR for the docs: opnsense/docs#469

I'm very bad at writing documentation, please feel free to rewrite the whole thing. I think it's better to leave the code as it is, for ddclient compatibility, and also because checking if the username is an email is harder (it's just a regex, but just checking for "token" is easier). If I have to change this, please let me know.

@AdSchellevis
Copy link
Member

merged with minor modifications in 02f273f

AdSchellevis pushed a commit to opnsense/docs that referenced this pull request May 15, 2023
Documentation for cloudflare in PR opnsense/plugins#3435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants