-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pre/post up/down support for rooted GoBackend #23
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jason will decide whether or not this will be merged, but I've done a preliminary review regardless.
tunnel/src/main/java/com/wireguard/android/backend/RootTunnelActionHandler.java
Outdated
Show resolved
Hide resolved
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 Signed-off-by: Adam Irr <[email protected]>
cac5e07
to
baa0b4a
Compare
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 |
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 |
for (final String script : preUp) | ||
sb.append("PreUp = ").append(script).append('\n'); | ||
for (final String script : postUp) | ||
sb.append("PostUp = ").append(script).append('\n'); | ||
for (final String script : preDown) | ||
sb.append("PreDown = ").append(script).append('\n'); | ||
for (final String script : postDown) | ||
sb.append("PostDown = ").append(script).append('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails since Android's wg-quick
implementation doesn't support these actions. I have some changes pending that add support there as well but I'll wait to send that patch until the outcome of the potential redesign is completed.
d6a2d70
to
20390d6
Compare
8f17635
to
0750c29
Compare
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? |
581ab92
to
ec126a9
Compare
77dc1ed
to
5692307
Compare
a1670c8
to
dc1860c
Compare
baa1257
to
79b8c34
Compare
c046706
to
40eaa54
Compare
827495b
to
4ba8794
Compare
Any update on this PR? |
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 istun0
on my Pixel3 and my Nvidia shield). If this is the standard name i can do the%i
replacement. Using the normaltunnelName
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.