OPNsense Forum

English Forums => Development and Code Review => Topic started by: olmari on December 20, 2021, 08:44:03 AM

Title: Adding new DynDNS provider?
Post by: olmari on December 20, 2021, 08:44:03 AM
I'm somewhat newbie on generally coding, and I'm definately newbie on OPNsense as user, yet alone coding...

I'd love to add dy.fi (https://www.dy.fi/) dyndns provider to OPNsense, but I kinda have no clue where to start... I know code exists here: https://github.com/opnsense/plugins/tree/master/dns/dyndns but code seems so alien to me :D

Dy.fi is your run of the mill dyndns provider, ipv4 only though, supports setting AAAA records (on their management page), but actual usage is IPv4 only at least thus far. Any pointers how to get started most sanely? Thank you.
Title: Re: Adding new DynDNS provider?
Post by: agh1467 on December 25, 2021, 06:19:17 PM
Looking through the commit history I found an example of the addition of a service:

https://github.com/opnsense/plugins/commit/ffa7ad54bc778a6cd804248a89f2740e92890135#diff-7163b855c3b4e1ef4141f32b9616f74b512c8b6cc44d63de6a74af55fa340592

I'm not familiar with this plugin, but based on that commit, I'd say adding a service is probably going to be similar. The main thing is the getting the correct API URL, and the inclusion of the error handler, then it's a simple matter of including it in the switch/case/if to get it to show up in the menu.
Title: Re: Adding new DynDNS provider?
Post by: olmari on December 27, 2021, 07:53:31 AM
Indeed, That looks awesome example, I don't know why didn't I figured to see commit history :D Thank you!