android icon indicating copy to clipboard operation
android copied to clipboard

Auto VPN connect on mobile app

Open dolenec opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. My problem is that my HA is blocked from outside internet access and I need to open Wireguard VPN profile before I open HA mobile app.

Describe the solution you'd like

  • Option to choose VPN profile (OpenVPN, IPsec, Wireguard etc..) installed on mobile device.
  • Option to make mobile app auto connect to VPN profile.
  • In case of no-auto connect option enabled it should show option to connect to choosen VPN profile on mobile app connection error.
  • When opening HA app it should auto connect to VPN profile in case of auto-connect option enabled.
  • Option to auto disconnect from VPN profile on idle time etc..

Describe alternatives you've considered, if any

Additional context

dolenec avatar Jan 31 '24 07:01 dolenec

last i remember wireguard required special 3rd party permissions that the app needs to add to the manifest which we are not going to do as changes added to the app need to be added in a way that is not 3rd party specific.

are there any non-VPN apps that let you do this today?

dshokouhi avatar Jan 31 '24 15:01 dshokouhi

Wire guard does now have support for third party control.

The intent is here https://github.com/WireGuard/wireguard-android/blob/master/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt#L228

And somebody has already hacked together a VPN first, ha second flow here https://community.home-assistant.io/t/using-tasker-to-establish-a-wireguard-tunnel-before-starting-the-home-assistant-companion-app/610210

kquinsland avatar Jun 23 '24 22:06 kquinsland

I'm pretty sure they still require their own permissions first. The reason why tasker works is because they have their permission added in the manifest.

dshokouhi avatar Jun 23 '24 23:06 dshokouhi

I'm pretty sure they still require their own permissions first. The reason why tasker works is because they have their permission added in the manifest.

Ahhh. I vaguely remember reading through those threads years ago but assumed that drama had been resolved when I saw the "allow 3rd party control" setting in Wireguard app.

For reference, the manifest modifications are documented here.

... add to the manifest which we are not going to do as changes added to the app need to be added in a way that is not 3rd party specific.

For what it's worth, the adjusted manifest pattern seems to be the standard way of doing this on android. What's the reasoning for not doing so here?

kquinsland avatar Jun 23 '24 23:06 kquinsland