troglobit / inadyn

In-a-Dyn is a dynamic DNS client with multiple SSL/TLS library support
https://troglobit.com/projects/inadyn/
GNU General Public License v2.0
957 stars 139 forks source link

Variables for update of ipv6prefix and ipv6 on dynv6 #485

Open zilon84 opened 3 months ago

zilon84 commented 3 months ago

Hello all,

I am using the following URL to update IPv4 on dynv6 on my unifi controller:

dynv6.com/api/update?hostname=%h&token=%u&ipv4=%i

Now, I also want to update IPv6 and/or its prefix. How to do that? What are the varaible names for IPv6 or the prefix?

Is it possible to combine everything in one URL since unifi does not accept two URLs separated by space.

Thank you!

Dzinlife commented 1 month ago

Same issue, also want to know about it.

troglobit commented 1 month ago

The API for the plugin is available here https://dynv6.com/docs/apis. The plugin, and Inadyn itself, is 100% reliant on users "scratching an itch" to drive the functionality forward. So if you can learn the API and suggest changes, I can at least review the changes and propose a build for you to test.

troglobit commented 1 month ago

Anyone had the chance yet to have a look at the API link I referenced? Would be great to get some more insight on this issue from users with dynv6 accounts.

Dzinlife commented 1 month ago

Anyone had the chance yet to have a look at the API link I referenced? Would be great to get some more insight on this issue from users with dynv6 accounts.

dynv6.com/api/update?hostname=%h&token=%u&ipv4=%i&ipv6={???%}

dynv6 uses the {ipv6} URL parameter to update. I just want to know which keyword% should be used.

troglobit commented 1 month ago

Yeah, me too. I have no means of testing this myself, so it's up to the users to help out.

cross commented 1 month ago

Where in the code is the mapping of %n (for any n) to the conceptual value that it represents? From the above example, I can see %h is hostname, %i is IPv4 address. Where are those mappings?

troglobit commented 1 month ago

@cross see plugins/generic.c

https://github.com/troglobit/inadyn/blob/b9edfbfb94b3582cf32dfc04e0dd867ecef2ba92/plugins/generic.c#L81-L139

cross commented 1 month ago

Okay, thanks. So for @zilon84 , it is not possible to put it in one URL. There are separate calls inside of the code for each of IPv4 and IPv6.

troglobit commented 1 month ago

... or maybe expand on the format specifier implementation? E.g., adding support for %I, or similar, to expand to the IPv6 address? This is software after all, everything is possible, even though it doesn't always come served on a platter.

cross commented 1 month ago

Yeah, but only skimming the code it looks a lot like there are separate paths for IPv4 and IPv6. I didn't know how practical it would be to try to make one pass through the code cover both and not have two calls. But I haven't really looked that carefully at how it does the combination of v4 and v6.

troglobit commented 1 month ago

So ... your comment is more about the amount of time needed to invest in fixing this bug? Not every change is easy, but not everything worthwhile is ever easy, or something like that.

cross commented 1 month ago

So ... your comment is more about the amount of time needed to invest in fixing this bug? Not every change is easy, but not everything worthwhile is ever easy, or something like that.

Apologies. I didn't mean to "comment" on anything. I'm all for people contributing solutions to problems, and happy to hear you are open to even significant changes. I was mostly just thinking out loud without knowing enough about the architecture to know how easy or not things were. I should not have been thinking/commenting without more information or thought. I didn't mean to imply or suggest anything.