-
Notifications
You must be signed in to change notification settings - Fork 320
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
feature/ MacOS show vpn name and tailscale exit node if active #279
base: master
Are you sure you want to change the base?
feature/ MacOS show vpn name and tailscale exit node if active #279
Conversation
447fa59
to
29e84ad
Compare
2f55fa2
to
296b738
Compare
scripts/network_vpn.sh
Outdated
# if tailscale is installed | ||
# | ||
# https://www.reddit.com/r/Tailscale/comments/18dirro/is_there_a_way_i_can_tell_which_exit_node_i_am/ | ||
node=$(tailscale status --peers --json | jq '.ExitNodeStatus') |
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.
I'm hesitant to rely on jq as a dependency.
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.
understandable. im planning to rework this entirely if i end up making it "production ready" and i will keep that in mind then 👍
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.
I was poking around with this and I think you could just replace this with grep since you're not actually interpreting the json and just checking if it exists. I tested it with tailscale (I am now using it) and doesn't even report ExitNodeStatus
unless you are connected to an exit node @Theoreticallyhugo
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.
cool, thanks!
i'm currently in my exam period, but im planning on revisiting this soon after :D
296b738
to
2919c24
Compare
…n tailscale is down.
so far this is tested on macos only, and i'll need to look into vpns some more before this is ready to merge also some vpns wont be detected by our scripts because they were not configured in the macs network settings. private internet access(pia) seems to be one of those candidates. maybe ill find some kind of workaround...
|
I'll test on Linux tonight. I'll also test on MacOS. For now, tailscale support is fine. We can support others as they come. |
on macos and linux the vpn option now is able to show the name of the vpn if in verbose mode or
VPN
if verbose is off.if a tailscale exit-node is used, it shows its name in verbose, or
Tailscale
if verbose is off.scutil did some funky stuff for me, so i had to filter out the asterisks 😅
new options for the network-vpn plugin
@dracula-network-vpn-label
this option is what is displayed when verbose is false.
if verbose is true, this label is the prefix to the name of the vpn/ exitnode.
@dracula-network-vpn-verbose
whether to display the vpn/ exitnode name