Windscribe / Desktop-App

Windscribe 2.0 desktop client for Windows, Mac and Linux
https://windscribe.com
GNU General Public License v2.0
610 stars 84 forks source link

Daemon based connection via CLI #163

Open candroid-man opened 1 month ago

candroid-man commented 1 month ago

I'd like to be able to close the app and let it run in the background without any extra dependencies. Typically this is done by having the backend of the desktop app work off of the CLI using a daemon, rather than relying on the GUI itself to handle the connection. This would also make the CLI much more robust and powerful. So for example, if I wanted to connect to the tunnel with the CLI, I would do:

user@fedora:~$ windscribe-cli connect best
Connecting to Kansas City - Glinda
Connected to Best Location
user@fedora:~$ 

And then if you decide to open the GUI, it would show you are connected to Glinda:

image

IVPN Example

This is what the IVPN CLI utility looks like, to give you an idea of what this would look like:

user@fedora:~$ ivpn help
Command-line interface for IVPN client (www.ivpn.net)
version:3.14.14 (date:2024-05-28 commit:c443e44905374f9a8d2962ad1d6dd89c6f887c1e) amd64

Usage: ivpn COMMAND [OPTIONS...] [COMMAND_PARAMETER] [-h|-help]

COMMANDS:
status                      Prints full info about IVPN state
connect LOCATION            Establish new VPN connection
disconnect                  Disconnect active VPN connection (if connected)
connection                  Managing active connection
servers FILTER              Show servers list
firewall                    Firewall management
splittun                    Split Tunnel management
exclude COMMAND             Run command in Split Tunnel environment
wgkeys                      WireGuard keys management
dns DNS_IP                  DNS management for VPN connection
antitracker                 Default AntiTracker configuration management for VPN connection
logs                        Logging management
login ACCOUNT_ID            Login operation (register ACCOUNT_ID on this device)
logout                      Logout from this device (if logged-in)
account                     Get info about current account
eaa                         Enhanced App Authentication
autoconnect                 Manage VPN auto-connection parameters
wifi                        WiFi control settings

Tips:
 ivpn COMMAND -h         Show detailed description of command
 ivpn -h -full           Show detailed description about all commands

IVPN gives you everything you could possibly need in the CLI utility, because the GUI is just that, a GUI for the CLI.

bernerdad commented 4 days ago

Please give our new Linux standalone CLI app, available in the v2.11.11 release, a spin and let us know if it fulfills your requirements. Cheers!

candroid-man commented 1 day ago

@bernerdad I am unable to login to my account with the CLI tool:

candroid_man@nobara:~$ windscribe-cli login "WindscribeUserName" "w4RLfYsC^7bw6DC1$m^E"
Login is in progress.  Use 'windscribe-cli status' to check for status.
candroid_man@nobara:~$ windscribe-cli status
Internet connectivity: available
Login state: Error: Incorrect username, password, or 2FA code
Firewall state: Off
Connect state: Disconnected
candroid_man@nobara:~$ 

I also tried it without quotes:

candroid_man@nobara:~$ windscribe-cli login WindscribeUserName w4RLfYsC^7bw6DC1$m^E
Login is in progress.  Use 'windscribe-cli status' to check for status.
candroid_man@nobara:~$ windscribe-cli status
Internet connectivity: available
Login state: Error: Incorrect username, password, or 2FA code
Firewall state: Off
Connect state: Disconnected
candroid_man@nobara:~$ 

I do not have 2FA enabled, my actual password is randomly generated similarly to the example password above

candroid-man commented 1 day ago

Also I think it's awesome that a CLI tool is available now! Now it would be even better if the GUI and the CLI tool worked together. So whenever you download the package from https://windscribe.com/download/ it would give you a package with the GUI and CLI tool bundled together, and the GUI just controls the CLI in the background. So that way if you connect to Windscribe using the CLI tool, and you open the GUI app, it will reflect what the current status of your connection is and the user could then use the GUI tool to disconnect for example.

jaxu commented 17 hours ago

If your password has special characters similar to the example password, you probably have to enclose the password in quotes to prevent the shell from interpreting it. In the above example the $m part would likely have been treated as a shell variable.

jaxu commented 17 hours ago

The GUI app does indeed come with a CLI client (though the GUI app must be running, since in this configuration the CLI controls the GUI in the background, rather than the other way around). It's also named windscribe-cli and behaves much the same as the standalone.

candroid-man commented 16 hours ago

As shown above I tried both with and without quotes.

jaxu commented 16 hours ago

Sorry, missed a word! I meant to say single quotes. That is, "$m" is still evaluated by the shell, but '$m' is literal.