Shall we write our own UI to configure VPN (definitely painful), or use the GNOME one?
If we use the GNOME one, how can we avoid the new VPN being used as part of the `main` routing table? If we
don't, then how can we avoid tor being routed over the VPN?
### VPN before Tor
To make VPN work, we need to change lot of firewall rules. This could mean that the user has "VPN" as an
option in Tor Connection (so it becomes easy mode / hide mode / vpn mode). Selecting that option would:
- change firewall rules so that VPN can actually send packets wherever they need to
- _Q_: how can we enforce that *only* VPN software can do that? Is it enough to only allow specific users
(`root`, or some `vpn-specific` user maybe) to send packets? Can we have specific iptables rules that
allow only the vpn software to send packets?
- Counterintuitively, *forbid*`tor` to send any packets on the physical interface, but allow it to send
packets to VPN interfaces (`tun0` usually)
- spawn the GNOME VPN configuration utility
- _Q_: wouldn't that have too many knobs, leading to the user being more easily able to shoot themselves in the
feet?
I tested OpenVPN. While the GNOME interface clearly puts the focus on the most relevant details, there's
plenty of space for fiddling available.
- _Q_: can we validate the configuration (which also means we only support a subset of the VPN that GNOME would
support)?
kinda: we can get [an event](https://developer-old.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Settings.html#gdbus-signal-org-freedesktop-NetworkManager-Settings.NewConnection) very early, but NetworkManager won't wait for us to handle it. So we need to quickly validate and, if everything works, do the appropriate firewall changes that will allow connections to be performed. If there is something we don't like, we can't provide information context. Sure, we can open a window, or a notification, but that will be a bit out of place.
- wait for `VPN` to be initialized, then start `tor` with the same configuration we use in easy mode.