question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Notification command to toggle wireguard tunnel

See original GitHub issue

Is your feature request related to a problem? Please describe.

I realize this one is probably kind of a long-shot since its specific to a not particularly popular app but figured it can’t hurt to ask 😃

I really like the community add-on for wireguard and have been using it for a bit to meet my home VPN needs. Sometime last year the Wireguard team worked with Tasker to add support for toggling a tunnel from Tasker. They did it generically though, all tasker actually does is fire an intent that Wireguard is listening for which means the HA android app could do it too.

I am not able to find an obvious documentation site for the Wireguard android app unfortunately. This post here by the lead developer does describe what Tasker had to do so we can borrow it.

The intents themselves are pretty straightforward, broadcast com.wireguard.android.action.SET_TUNNEL_UP and com.wireguard.android.action.SET_TUNNEL_DOWN with tunnel:<tunnel name> in the extra to com.wireguard.android. The tricky bit is they permission locked the intent. So in order to do this the HA companion app would have to add this to the manifest and declare a new permission:

<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>

The first time you try to toggle a tunnel will require user interaction since it will pop-up a prompt asking the user to accept this permission. After that the tunnel can be toggled on/off without any user interaction required. I use it currently for turning on the tunnel when I’m on any wifi other then a fixed list of trusted networks.

Describe the solution you’d like

Would love a new command like:

message: command_wireguard_tunnel
title: up/down or on/off
data:
  channel: <tunnel name>

Describe alternatives you’ve considered, if any

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mdegat01commented, Jan 28, 2021

So I’m not totally sure how it all works. But I can tell you I definitely saw the pop-up the first time I toggled the tunnel and had to accept it. And in permissions for tasker it says “additional permissions” that when clicked shows this permission So I think they did? Otherwise idk how else this would get here [EDIT] Just saw this picture on my mac, did not realize how huge it was lol. Making it a normal size

0reactions
mdegat01commented, Jan 28, 2021

Makes sense. I was wondering about that too, seemed like a better way to do it. But I guess the challenge there is clearly any app can listen to intents (since that’s exactly what Tasker does). So if you just throw an encrypted value in an extra then another app could grab that encrypted value and reuse it.

But the idea of password-protecting an intent makes a lot of sense. Seems like something android should add. Like a “secure extra” concept that manages encryption/security of that data for you and only allows the value to be read by the targeted package.

Anyway this is all an aside, would be a feature request for android anyway. Thanks for looking into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wireguard tunnel toggle : r/AutoHotkey - Reddit
I'm a Wireguard user and you need to use the command line, otherwise the drivers keeps being loaded and you can get stuck...
Read more >
Wireguard Android Client Setup [2022] - Simple and Secure ...
Click the gray toggle switch to the right of the tunnel name and after a second or so you should see the toggle...
Read more >
How to Monitor Who's Connected to Your WireGuard VPN
The simplest thing you can do is just SSH into each of the WireGuard hosts on your network, and use WireGuard's built-in status...
Read more >
WireGuard VPN with TLS Tunneling - YouTube
Need a lightweight VPN system for privacy on the go? Today, we'll set up a WireGuard server and client, then I'll demonstrate how...
Read more >
How to check VPN link status on wireguard
One method is to do ping between VPN IP addresses or run command wg show from the server or from the client. Below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found