[os-tor] Restart relay on interface address changes
Important notices Before you add a new report, we ask you kindly to acknowledge the following:
- [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- [x] When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
In an attempt to control which interfaces are used for Tor inbound traffic, I used the Address option in os-tor, pointing to a dynamic DNS hostname that gets updated when the interfaces have an address change.
Unfortunately, Tor appears only to resolve that name at startup, so an address change once the system is running doesn't get noticed.
To Reproduce Steps to reproduce the behavior:
- Configure os-tor as a Relay, with an Address for a hostname pointing to at least one of your IP addresses. Verify that the relay starts up correctly (tor.log)
- Update the dynamic DNS hostname to contain more of your IP addresses / a different IP address.
- Monitor Tor and observe that the new IP is not used; the old one continues to be used.
- Change the IP of the interface that Tor is using.
- Monitor Tor and observe that the new IP is not being used, even though the old one is no longer functional.
Describe the solution you'd like User should be able to select interfaces in os-tor where address changes will cycle the Tor relay (possibly after a delay, to allow the Dynamic DNS client to run and the old record to expire).
Describe alternatives you've considered If you can hook arbitrary scripts to address changes / the dyndns client, then that script could restart the Tor service shortly after the address change occurs.