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

Added Stun and Cloudflare support #2

Merged
merged 10 commits into from
Mar 5, 2024
Merged

Conversation

MarkusTieger
Copy link
Contributor

@MarkusTieger MarkusTieger commented Feb 5, 2024

This PR adds 2 features:

  • Adds a way to detect the outgoing public ip address (using a stun server.). Useful if it's behind a nat.
  • Adds a way to update a cloudflare record without needing to write a http request every time

@rbi
Copy link
Owner

rbi commented Feb 25, 2024

Hello @MarkusTieger , thanks for your contribution. It's nice to see that rddns seems to be useful for others.

I think the STUN server support is great to have in rddns. I would merge it with some minor fixes if it was a separate merge request.

The Cloudflare support would be the first provider specific extension. As it is in this MR it doesn't seem to be in the right module config. It also introduces several catch-all cases in match statements which makes it easier to miss them and implement bugs in case another DdnsEntry type is introduced later.

If it is implemented as DdnsEntry it should work like the other DdnsEntries HTTP and FILE. This means:

  • Proper support DdnsEntry#resolvables and DdnsEntry#resolve
  • Implementation of the update logic in a new method update_via_cloudflare in update_executers.rs. It can there use the plain hyper HTTP Client API directly like update_via_http does. There is no need for an intermediate step to first map to DdnsEntryHttp

Maybe in a future MR the update_executors can be broken up to sub-modules like it was done with the resolver module.

src/config.rs Outdated Show resolved Hide resolved
src/resolver/mod.rs Outdated Show resolved Hide resolved
src/resolver/mod.rs Outdated Show resolved Hide resolved
@MarkusTieger MarkusTieger requested a review from rbi March 1, 2024 17:18
@rbi rbi merged commit 6c5e234 into rbi:master Mar 5, 2024
@MarkusTieger MarkusTieger deleted the stun-cloudflare branch March 6, 2024 14:35
@MarkusTieger
Copy link
Contributor Author

Maybe we should increment the version

@MarkusTieger MarkusTieger mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants