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

dns/ddclient: add inwx native API for ddclient #4000

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hellow554
Copy link

Hey everyone,

This is my first commit on this repo, so please point everything out that isn't correct.

My problem is, that INWX is currently only supported by dyndns2.
This costs money on INWX, but they provide a handy web based API, so I did that.

This enabled the usage of xmlrpc / jsonrpc to add and modify the DNS entries on INWX.

This works on my opnsense machine and is running for two days by now, so it should work :)

I think I need to adapt the documentation, if anyone could point me to it, that would be nice.

This enabled the usage of xmlrpc / jsonrpc to add and modify the DNS
entries on INWX.
@AdSchellevis AdSchellevis self-assigned this May 27, 2024
@AdSchellevis
Copy link
Member

@hellow554 I've looked briefly through the code, but why does it need xmlrpc? at a first glance it only seems to require json data, but maybe I'm overlooking something. I think this can be simplified quite a bit if we only stick to the essentials.

The documentation for this plugin can be found here https://github.com/opnsense/docs/blob/master/source/manual/dynamic_dns.rst

@hellow554
Copy link
Author

hellow554 commented May 27, 2024

I've looked briefly through the code, but why does it need xmlrpc

I took the original code from the inwx repo (https://github.com/inwx/python-client).
I can remove the XML code and just rely on json, that's fine.
My original thought was to stick as close as possible to the original code.

I'm changing it.

removing the xml part as well as stripping down to just the needed
things
@hellow554
Copy link
Author

Thanks for looking through my code.

I have two more questions.
INWX accounts can be secured by a 2FA and the API supports it. Yet, the GUI in Opnsense has only fields for username and password.
Would it be suitable to add a new field 2fa token to support these usecases?

Second: It's possible to print debug outputs for cases where something goes wrong: https://github.com/hellow554/opnsense_plugins/blob/f325b3d7e48d2dc22d97c4ef9b6e055027e838e1/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/inwx_native.py#L107-L109

Do you think I should link that to the verbose option in the OpnSense GUI?

@AdSchellevis
Copy link
Member

INWX accounts can be secured by a 2FA and the API supports it. Yet, the GUI in Opnsense has only fields for username and password.
Would it be suitable to add a new field 2fa token to support these usecases?

Personally I find it pretty weird to have two factors which are basically the same, unless it would be a dongle of some sort handling the additional security. In theory it would be possible to add a field to calculate the value, but it wouldn't add much in terms of security.

Second: It's possible to print debug outputs for cases where something goes wrong: https://github.com/hellow554/opnsense_plugins/blob/f325b3d7e48d2dc22d97c4ef9b6e055027e838e1/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/inwx_native.py#L107-L109

sure, just send messages to syslog, for example:

syslog.syslog(
syslog.LOG_ERR,
'Unable to find Tenant ID for account %s (response: %s)' % (self.description, auth_target[1])
)

@hellow554
Copy link
Author

Is there something missing here? I would like this to be merged :)

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.

3 participants