How to best to handle configuration warnings?
There are a couple of places where we would like a certain configuration to generate an "are you quite sure?" warning. But there are some tricky issues around that:
- Users may prefer to have a way to suppress these warnings.
- If an option is questionable, we don't necessarily want to warn about it every time reconfigure() is called, if nothing has changed since the last configuration.
Here is a possible design sketch: Give each FooConfig a warnings()
method that returns e.g. a HashSet<ConfigWarning>
. When we reconfigure, only warn!()
on those warnings that were not present before, or which are associated with a configuration value that changed.
What do we think about this?
I'm putting this in %Arti: Onion service support since we currently have two things that we might want to warn about in our hsrproxy config code:
- Not actually forwarding any onion service connections
- Forwarding connections to a public address