Setting up DNS Server via resolvectl
Similar to my other PR, I will add a disclaimer that my code is probably awful because I do not know rust. However this does work and allows DNS to work without additional commands being run in the terminal. Unfortunately I get a password prompt for openvpn and then another for this...I'm not sure how to fix that short of having a daemon running as root as well.
Fixes #3 Duplicate of #5
~~tun0 is currently hardcoded. I need to pull that out of the logs much like this DNS server address.~~ Never mind, I wrote more probably terrible code.
Only some small changes.
I wonder whether this risks breaking the Nix build, and I think it does as resolvectl needs to be available on $PATH. I may need to take a look at this before merging (or if any past contributor is willing to look at it).
But the points being addressed and nothing else coming from my side, I'll merge the PR if I don't have the bandwidth to check the Nix Flake, there's no point on blocking it.
I'm not sure how to fix that short of having a daemon running as root as well.
Yeah... it was on my plans to eventually have a lightweight daemon, specially because of the unmanaged background running OpenVPN (and my workaround to not waste time writing a daemon was to just check and kill on startup). Unfortunately, never got to do it.
Never mind, I wrote more probably terrible code.
This project is used to this, including the unsafe impl Sync and unsafe impl Send that should've never been added in the first place (and a lot of other things). But it was the past, less experienced, me.