bluecatengineering / dora

A Rust DHCP server
Mozilla Public License 2.0
446 stars 11 forks source link

Plans for remote/dynamic configuration backend #4

Open jarus opened 1 year ago

jarus commented 1 year ago

Hi,

This is an interesting project. Have you plans to support other configuration backends beside the yaml file? For example, asking a remote HTTP server every N seconds for a new config to retrieve new reservations?

Best regards, Christoph

leshow commented 1 year ago

Not at the moment, but since leases are not stored in memory, it wouldn't take much to have a script that downloaded a new config and restarted the dora process, run on a timer.

dora will accept configuration in equivalent JSON format also FYI.

Jackbennett commented 10 months ago

Would you be open to a PR on this or is it out of scope? (depending on quality of course XD)

leshow commented 10 months ago

Can you give some more detail on what you're looking for? If it's a script that takes some URL, and polls for changes, then restarts dora I'm sure something along those lines can be found on google fairly easily.

Jackbennett commented 10 months ago

I was interested in the lease & reservations list more than config, that's easy enough to reload, but since static addresses are in the config I suspect that's where reload-questions come from.

I was looking into if ip-manager would behave if something else updated sqlite tables. There's so many tools to replicate sqlite it would be nice to use them to manage day-to-day leases and whitelist reservations. I think you could easily have concurrent servers running then if you trusted sqlite to avoid collisions by adding some transaction handling.

leshow commented 9 months ago

I was looking into if ip-manager would behave if something else updated sqlite tables.

I have not explicitly tested this, but I think it should. You may want to disable cache_threshold though since it keeps some leases in temporarily memory if you're going to modify the leases table from elsewhere.