Add pre/post up/down support for rooted GoBackend
When using the GoBackend on a rooted device allow for pre/post up/down actions to be executed when the tunnel state changes. On non-rooted devices the scripts are not executed but will still be parsed from the configuration file. %i syntax is not supported. If any script fails to execute the remaining scripts in that step are skipped
This is part of my efforts to make my AndroidTV device (Nvidia Shield) support the traditional WireGuard server options. I tested the GoBackend on my rooted Nvidia Shield and the scripts were executed. The changes the the wg-quick script are untested as I do not have access to a device with the kernel module installed.
I am unsure of the expected behavior of any failing scripts in the pre/post up/down section of the configs. As currently implemented, a failure results in the rest of the scripts not running. If other WireGuard implementations have a different behavior, I am happy to make this match the existing behavior.
I didn't implement the %i functionality since it is unclear to me if there is a standard interface name for Android's VPNs (it is tun0 on my Pixel3 and my Nvidia shield). If this is the standard name i can do the %i replacement. Using the normal tunnelName from the code doesn't work since that name comes from the WG config's name which doesn't match the actual interface name on Android.
We're looking at the possibility of allowing wg-quick to control GoBackend tunnels as well, once we're able to know if that's doable we'll revisit this.
We're looking at the possibility of allowing wg-quick to control GoBackend tunnels as well, once we're able to know if that's doable we'll revisit this.
Thanks for the update.
Would this be something beyond the existing WG_QUICK_USERSPACE_IMPLEMENTATION environment variable that wg-quick supports? I ask because at one point I did compile the wireguard-go binary to for Android and tried using wg-quick with the backend specified and it wasn't able to modify the device interfaces.
We're looking at the possibility of allowing wg-quick to control GoBackend tunnels as well, once we're able to know if that's doable we'll revisit this.
Thanks for the update.
Would this be something beyond the existing
WG_QUICK_USERSPACE_IMPLEMENTATIONenvironment variable thatwg-quicksupports? I ask because at one point I did compile thewireguard-gobinary to for Android and tried usingwg-quickwith the backend specified and it wasn't able to modify the device interfaces.
Yes it's going to be different. We're currently evaluating if the infrastructure we've built for remote control apps can be leveraged by wg-quick through calls to am.
Mavent 上没有1.0.20220516,这个怎么解决
Failed to resolve: com.wireguard.android:tunnel:1.0.20220516
@msfjarvis Are there still any major blockers on this? Will it be merged at some point? Or is this a dead PR?