mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
250 stars 25 forks source link

Use own IP source #41

Closed mietzen closed 1 year ago

mietzen commented 1 year ago

You mention that IP sources and DNS providers are modular. I'm trying to write my own IP Source (caddy-dynamicdns-cmd-source) but struggling to get it working:

When testing I get:

Error: adapting config using caddyfile: parsing caddyfile tokens for 'dynamic_dns': Caddyfile:7 - Error during parsing: getting module named 'dynamic_dns.ip_sources.command': module not registered: dynamic_dns.ip_sources.command

I guess I've to change something in caddy.ModuleInfo or caddy.RegisterModule, but I don't no what.

https://github.com/mholt/caddy-dynamicdns/pull/39#issuecomment-1512754157

Did I misunderstand your comments on this? Or did I just configure it wrong?

PS.: I opened a new Issue for better discoverability.

francislavoie commented 1 year ago

What do you see when you run caddy list-modules on your built binary? How are you building it (the exact xcaddy command)?

mietzen commented 1 year ago

Oh sorry, it was my debugging setup, with xcaddyeverything works fine 👍

I created a preLaunchTask that does exactly what xcaddy does and now debugging is also working 😄 I added all necessary files and roughly documented the process: https://github.com/mietzen/caddy-dynamicdns-cmd-source#debugging

Thanks again for your help @francislavoie ❤️