saumya-banthia / tailscale-control

A Decky plugin to control Tailscale, while staying in Gaming mode.
BSD 3-Clause "New" or "Revised" License
56 stars 8 forks source link

Could you add a "exit node toggle"? #6

Closed philhzss closed 10 months ago

philhzss commented 1 year ago

Hi,

Really useful plugin!! Due to a network blocking issue, I sometimes have to toggle my "exit node" on and off (one of my home machines is used as an exit node). Right now, I just use Trayscale but it would be really handy if there could be a toggle exit node switch in your plugin.

Do you think this would be doable? Thanks!!

saumya-banthia commented 1 year ago

This seems doable, although makes it a 2 step process, since it requires adding an IP for the exit node

Added to list of features to be added, but is not top priority as of now.

saumya-banthia commented 10 months ago

@philhzss I have added the node, would it be possible for you to test the plugin from this repo on your deck? I do not have an exit node set up so I could not test it out, but it should work after this commit: https://github.com/saumya-banthia/tailscale-control/commit/b82b782c4bececee51ce4a6a9617a8fa5ac518ad Report back if you are able to.

philhzss commented 10 months ago

@saumya-banthia Thank you so much for your work! Sorry for the stupid question but how do I update to the latest commit without going through Decky? I suppose you haven't pushed the new version to Decky yet before I test it, so it won't update past 0.0.4 in Decky and I'm not sure how to manually update?

saumya-banthia commented 10 months ago

AFAIK you would need to build from source. These instructions might be of help: https://github.com/SteamDeckHomebrew/decky-plugin-template?tab=readme-ov-file#developers

I could never get install from URL/Zip working for me, might be an easy process, but it was easier for me to build and deploy the plugin myself.

If you still have trouble, don't bother, I will be raising a PR to the main plugin db repo later today or tomorrow, post which it should appear in the testing version of the store.

saumya-banthia commented 10 months ago

Closing this issue, as the feature has been added to the latest PR but not tested. @philhzss Once the plugin hits the testing store, be sure to check and let me know if it is working as intended.

saumya-banthia commented 10 months ago

@philhzss it's available on the testing store, try it out and let me know.

philhzss commented 10 months ago

@philhzss it's available on the testing store, try it out and let me know.

Thank you I'm away from home for a few days with crappy internet but I'll try it asap

philhzss commented 10 months ago

It doesn't seem to work. Let me know if my testing methodology is wrong but I compare with Trayscale (discover store app) and for example, if I turn on Tailscale with your plugin, then open Trayscale, it's on. Vice versa for off, it works. However adding the exit node IP doesn't seem to do anything, Trayscale still says "exit node option" and not "exit node". If I manually turn on the exit node in Trayscale then it works

One thing I noticed, no idea if this is just Decky's fault or another bug, but the keyboard is hidden under the page? Like this: PXL_20231226_061529097.jpg

The IP I'm supposed to enter is just the Tailscale IP right? Thanks

saumya-banthia commented 10 months ago

The IP I'm supposed to enter is just the Tailscale IP right? Thanks

Did you toggle the exit node (it does not appear toggled in the image you sent), the toggle below where you enter the IP? Once you enter the IP, just toggle the exit node, by pressing the switch next to the button which reads "Toggle Exit node"

One thing I noticed, no idea if this is just Decky's fault or another bug, but the keyboard is hidden under the page? Like this: PXL_20231226_061529097.jpg

This is a known issue. I could not find a fix while implementing the feature, will keep looking though.

The IP I'm supposed to enter is just the Tailscale IP right?

Yes, and you also need to make sure that you have enabled the device as exit node, which needs to be confirmed at the tailscale dashboard.

philhzss commented 10 months ago

Yes I did toggle the exit node, sorry I just took the screenshot after because I thought it might be related but it's not. The IP I used was just Tailscale's IPV4 address for the exit node (100.xxx.xxx.xxx) then turned on the switch, but going back into Trayscale it did not seem to read that Tailscale had the exit node enabled

I also tried clearing all the toggles and fields in the plugin, (removing the exit node IP, turning off the exit node, turning off Tailscale) and then launching Trayscale. Tailscale was indeed off, so I turned it back on and enabled the exit node within Trayscale. When I returned to the plugin, it did see that Tailscale was now on, as it has always done, but the exit node IP field was blank and the exit node toggle was off. I tested this because I thought that just like the plugin "reads" the current state of Tailscale (even if Tailscale is turned on with something else such as Trayscale), I might be able to "read" the exit node status but it didn't seem like it was able to read it, in Trayscale the exit node was turned on and active but the plugin has the exit node toggle to off I hope this helps, let me know if you want me to try something different

saumya-banthia commented 10 months ago

I thought that just like the plugin "reads" the current state of Tailscale (even if Tailscale is turned on with something else such as Trayscale), I might be able to "read" the exit node status but it didn't seem like it was able to read it, in Trayscale the exit node was turned on and active but the plugin has the exit node toggle to off

Yes it reads state, but not separately for exit node toggles. Seems like I would need to test on my own, this has been of help, Thanks.

let me know if you want me to try something different

Will do, once I push an update with a fix.

philhzss commented 10 months ago

Okay thank you! Im going to sleep now but if you like I can test with IPV6 addresses or the Tailscale "hostname" addresses tomorrow, unless you know that it should only work with the IPV4 address

By the way I think you can easily host an exit node even with the Tailscale app on android, If you want to do some quick tests

philhzss commented 10 months ago

Hey it works great now!! Tested and all is good. Thank you so much for this!

saumya-banthia commented 10 months ago

Hey it works great now!! Tested and all is good. Thank you so much for this!

@philhzss could you report your testing on the PR linked below, it'd help to get the new version published to the stable store: https://github.com/SteamDeckHomebrew/decky-plugin-database/pull/504