cli

package
v0.0.0-...-851e5e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Overview

Package cli provides command line interface to interact with vpn and fileshare daemons.

Index

Constants

View Source
const (
	AllowlistAddPortUsageText     = "Adds port to the allowlist"
	AllowlistAddPortArgsUsageText = `<port> [protocol <protocol>]`
	AllowlistAddPortDescription   = `` /* 277-byte string literal not displayed */

)

Allowlist add port help text

View Source
const (
	AllowlistAddPortsUsageText     = "Adds port range to the allowlist"
	AllowlistAddPortsArgsUsageText = `<port_from> <port_to> [protocol <protocol>]`
	AllowlistAddPortsDescription   = `` /* 294-byte string literal not displayed */

)

Allowlist add ports help text

View Source
const (
	AllowlistAddSubnetUsageText     = "Adds subnet to the allowlist"
	AllowlistAddSubnetArgsUsageText = `<address>`
	AllowlistAddSubnetDescription   = `` /* 138-byte string literal not displayed */

)

Allowlist add subnet help text

View Source
const (
	AllowlistRemovePortUsageText       = "Removes port from the allowlist"
	AllowlistRemovePortArgsUsageText   = `<port> [protocol <protocol>]`
	AllowlistRemovePortArgsDescription = `` /* 300-byte string literal not displayed */

)

Allowlist remove port help text

View Source
const (
	AllowlistRemovePortsUsageText       = "Removes port range from the allowlist"
	AllowlistRemovePortsArgsUsageText   = `<port_from> <port_to> [protocol <protocol>]`
	AllowlistRemovePortsArgsDescription = `` /* 315-byte string literal not displayed */

)

Allowlist remove ports help text

View Source
const (
	AllowlistRemoveSubnetUsageText       = "Removes subnet from the allowlist"
	AllowlistRemoveSubnetArgsUsageText   = `<address>`
	AllowlistRemoveSubnetArgsDescription = `Use this command to remove subnet from the allowlist.

Example: 'nordvpn allowlist remove subnet 192.168.1.1/24'`
)

Allowlist remove subnet help text

View Source
const (
	CitiesUsageText     = "Shows a list of cities where servers are available"
	CitiesArgsUsageText = `<country>`
	CitiesDescription   = `` /* 159-byte string literal not displayed */

)

Cities help text

View Source
const (
	ConnectUsageText          = "Connects you to VPN"
	ConnectFlagGroupUsageText = "Specify a server group to connect to"
	ConnectArgsUsageText      = "[<country>|<server>|<country_code>|<city>|<group>|<country> <city>]"
	ConnectDescription        = `` /* 708-byte string literal not displayed */

)

Connect help text

View Source
const (
	LoginUsageText            = "Logs you in"
	LoginDescription          = "" /* 169-byte string literal not displayed */
	LoginNordAccountUsageText = "This option is no longer available."
	LoginFlagTokenUsageText   = "" // #nosec
	/* 204-byte string literal not displayed */
	LoginCallbackUsageText = "" /* 227-byte string literal not displayed */
)

Login descriptions

View Source
const (
	RateUsageText     = "Rates your last connection quality (1-5)"
	RateArgsUsageText = `[1-5]`
	RateDescription   = `` /* 192-byte string literal not displayed */

)

Rate help text

View Source
const (
	SetAutoconnectUsageText     = "" /* 130-byte string literal not displayed */
	SetAutoConnectArgsUsageText = `<enabled>|<disabled> [<country>|<server>|<country_code>|<city>|<group>|<country> <city>]`
	SetAutoConnectDescription   = `` /* 926-byte string literal not displayed */

)

Set autoconnect help text

View Source
const (
	SetDNSUsageText     = "Sets custom DNS servers"
	SetDNSArgsUsageText = `<servers>|<disabled>`
	SetDNSDescription   = `` /* 330-byte string literal not displayed */

)

Set DNS help text

View Source
const (
	SetFirewallUsageText     = "Enables or disables use of the firewall."
	SetFirewallMarkUsageText = "Traffic control filter used in " +
		"policy-based routing. It allows classifying packets " +
		"based on a previously set fwmark by iptables."
)
View Source
const (
	SetProtocolUsageText     = "Sets the protocol"
	SetProtocolArgsUsageText = `<protocol>`
	SetProtocolDescription   = `` /* 130-byte string literal not displayed */

)

Set protocol help text

View Source
const (
	SetTechnologyUsageText     = "Sets the technology"
	SetTechnologyArgsUsageText = `<technology>`
	SetTechnologyDescription   = `` /* 138-byte string literal not displayed */

)

Set technology help text

View Source
const (
	SetThreatProtectionLiteUsageText     = "" /* 337-byte string literal not displayed */
	SetThreatProtectionLiteArgsUsageText = `<enabled>|<disabled>`
	SetThreatProtectionLiteDescription   = `` /* 647-byte string literal not displayed */

)

Set Threat Protection Lite help text

View Source
const (
	// MaxLoginAttempts defines maximal login attempts count
	MaxLoginAttempts = 3
	// ConfigDirName defines configuration subdirectory name
	ConfigDirName = "nordvpn/"
	// ConfigFilePath defines config file path
	ConfigFilePath = ConfigDirName + "nordvpn.conf"
	// AllowlistProtocol defines allowlist commands argument
	AllowlistProtocol = "protocol"
	// AllowlistMinPort defines min port which can be allowlisted
	AllowlistMinPort = 1
	// AllowlistMaxPort defines max port which can be allowlisted
	AllowlistMaxPort = 65535
)
View Source
const (
	ArgumentCountError   = "The command you entered has incorrect number of arguments. Enter '%s --help' to see the options."
	ArgumentParsingError = "The command you entered is not valid. Enter '%s --help' to see the options."

	LoginSuccess          = "Welcome to NordVPN! You can now connect to VPN by using '%s connect'."
	LogoutSuccess         = "You are logged out."
	LogoutTokenSuccess    = "You have been logged out. To keep your account secure, we've revoked your current access token. If you want to reuse your next access token despite the potential risks, use the --" + flagPersistToken + " option when logging out."
	LogoutUsageText       = "Logs you out"
	PersistTokenUsageText = "Keep your current access token valid after logging out."

	RateNoArgsMessage    = "Type [1–5] to rate your previous connection (1 – poor, 5 – great): "
	RateNoConnectionMade = "It seems you haven’t connected to VPN yet. Please rate your experience after your first session."
	RateAlreadyRated     = "You have already provided a rating for your active/previous connection."
	RateSuccess          = "Thank you for your feedback!"

	SetReconnect = "You are connected to NordVPN. Please reconnect to enable the setting."

	MsgNothingToRate = "There was no connection - nothing to rate."
	// MsgSetSuccess is a generic success message template.
	MsgSetSuccess = "%s is set to '%s' successfully."
	// MsgAlreadySet is a generic noop message template.
	MsgAlreadySet = "%s is already set to '%s'."
	// MsgInUse is a generic dependency error message template.
	MsgInUse              = "%s is currently used by %s. Disable it first."
	MsgSetBoolArgsUsage   = `<enabled>|<disabled>`
	MsgSetBoolDescription = `` /* 186-byte string literal not displayed */

	ObfuscateOnServerNotObfuscated              = "" /* 155-byte string literal not displayed */
	ObfuscateOffServerObfuscated                = "" /* 169-byte string literal not displayed */
	AutoConnectOnNonObfuscatedServerObfuscateOn = "Your selected server doesn’t support obfuscation. Choose a different server or turn off obfuscation."
	AutoConnectOnObfuscatedServerObfuscateOff   = "Turn on obfuscation to connect to obfuscated servers."
	SetAutoConnectForceOff                      = "" /* 173-byte string literal not displayed */

	SetThreatProtectionLiteDisableDNS = "Disabling DNS."
	SetThreatProtectionLiteAlreadySet = "Threat Protection Lite already set to %s."

	SetDefaultsSuccess = "Settings were successfully restored to defaults."

	FirewallRequired = "Firewall must be enabled to use '%s'."

	SetNotifySuccess      = "Notifications are set to '%s' successfully."
	SetNotifyNothingToSet = "Notifications are already set to '%s'."

	SetObfuscateUnavailable = "Obfuscation is not available with the current technology. Change the technology to OpenVPN to use obfuscation."

	SetProtocolUnavailable = "Protocol setting is not available when the set technology is not OpenVPN"
	SetProtocolAlreadySet  = "Protocol is already set to %s"

	SetTechnologyDepsError = "Missing %s kernel module or configuration utility."

	SetDNSDisableThreatProtectionLite = "Disabling Threat Protection Lite."
	SetDNSInvalidAddress              = "The provided IP address is invalid."
	SetDNSTooManyValues               = "More than 3 DNS addresses provided."
	SetDNSAlreadySet                  = "DNS is already set to %s."

	SetLANDiscoveryUsage          = "Access printers, TVs, and other devices on your local network while connected to a VPN."
	SetLANDiscoveryAlreadyEnabled = "LAN discovery is already set to %s."
	SetLANDiscoveryAllowlistReset = "Just a little heads-up: Enabling local network discovery will remove your private subnets from the allowlist."

	AllowlistAddPortExistsError = "Port %d (%s) is already allowlisted."
	AllowlistAddPortSuccess     = "Port %d (%s) is allowlisted successfully."

	AllowlistAddPortsExistsError = "Ports %d - %d (%s) are already allowlisted."
	AllowlistAddPortsSuccess     = "Ports %d - %d (%s) are allowlisted successfully."

	AllowlistAddSubnetExistsError  = "Subnet %s is already allowlisted."
	AllowlistAddSubnetSuccess      = "Subnet %s is allowlisted successfully."
	AllowlistAddSubnetLANDiscovery = "Allowlisting a private subnet is not available while local network discovery is enabled."

	AllowlistRemovePortExistsError = "Port %d (%s) is not allowlisted."
	AllowlistRemovePortSuccess     = "Port %d (%s) is removed from the allowlist successfully."

	AllowlistRemovePortsExistsError = "Ports %d - %d (%s) are not allowlisted."
	AllowlistRemovePortsSuccess     = "Ports %d - %d (%s) are removed from the allowlist successfully."

	AllowlistRemoveSubnetExistsError = "Subnet %s is not allowlisted."
	AllowlistRemoveSubnetSuccess     = "Subnet %s is removed from the allowlist successfully."

	AllowlistRemoveAllError   = "Allowlist elements could not be removed."
	AllowlistRemoveAllSuccess = "All ports and subnets have been removed from the allowlist successfully."

	AllowlistPortRangeError  = "Port %d value is out of range [%d - %d]."
	AllowlistPortsRangeError = "Ports %d - %d value is out of range [%d - %d]."

	AccountCreationSuccess = "Account has been successfully created."
	// AccountInvalidData is displayed when backend returns bad request (400)
	AccountInvalidData = "" /* 139-byte string literal not displayed */
	// AccountEmailTaken is displayed when backend returns conflict (409)
	AccountEmailTaken = "User with the specified email address already exists."
	// AccountInternalError is returned when backend returns internal error (500)
	AccountInternalError          = "It's not you, it's us. We're having trouble with our servers. If the issue persists, please contact our customer support."
	AccountTokenUnauthorizedError = "" /* 147-byte string literal not displayed */
	AccountCantFetchVPNService    = "We were not able to fetch your VPN service data. If the issue persists, please contact our customer support."
	UpdateAvailableMessage        = "A new version of NordVPN is available! Please update the application."
	DisconnectNotConnected        = "You are not connected to NordVPN."
	DisconnectConnectionRating    = "How would you rate your connection quality on a scale from 1 (poor) to 5 (excellent)? Type '%s rate [1-5]'."

	CitiesNotFoundError = "Servers by city are not available for this country."

	CheckYourInternetConnMessage = "Please check your internet connection and try again."
	ExpiredAccountMessage        = "Your account has expired. Renew your subscription now to continue enjoying the ultimate privacy and security with NordVPN."
	NoSuchCommand                = "Command '%s' doesn't exist."
	MsgListIsEmpty               = "We couldn’t load the list of %s. Please try again later."

	// Meshnet
	MsgSetMeshnetUsage       = "Enables or disables Meshnet on this device."
	MsgSetMeshnetArgsUsage   = `<enabled>|<disabled>`
	MsgSetMeshnetDescription = `` /* 240-byte string literal not displayed */

	MsgSetMeshnetSuccess            = "Meshnet is set to '%s' successfully."
	MsgMeshnetAlreadyEnabled        = "Meshnet is already enabled."
	MsgMeshnetAlreadyDisabled       = "Meshnet is already disabled."
	MsgMeshnetNotEnabled            = "Meshnet is not enabled. Use the \"nordvpn set meshnet on\" command to enable it."
	MsgMeshnetNordlynxMustBeEnabled = "NordLynx technology must be set to use this feature."
	MsgMeshnetVersionNotSupported   = "Current application version does not support the Meshnet feature."
	MsgMeshnetUsage                 = "" /* 355-byte string literal not displayed */

	MsgMeshnetRefreshUsage = "Refreshes the Meshnet in case it was not updated automatically."
	MsgMeshnetPeerUnknown  = "Peer '%s' is unknown."

	// Invites
	MsgMeshnetInviteUsage                     = "Add other users' devices to your Meshnet."
	MsgMeshnetInviteDescription               = MsgMeshnetInviteUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/linking-devices-in-meshnet"
	MsgMeshnetInviteListUsage                 = "Displays the list of all sent and received Meshnet invitations."
	MsgMeshnetInviteAcceptUsage               = "Accepts an invitation to join inviter's mesh network."
	MsgMeshnetInviteDenyUsage                 = "Denies an invitation to join inviter's mesh network."
	MsgMeshnetInviteRevokeUsage               = "Revokes a sent invitation."
	MsgMeshnetInviteNoInvitationFound         = "no invitation from '%s' was found"
	MsgMeshnetInviteArgsUsage                 = "[email]"
	MsgMeshnetInviteAcceptSuccess             = "Meshnet invitation from '%s' was accepted."
	MsgMeshnetInviteAcceptDeviceCount         = "Maximum device count reached. Consider removing one or more of your devices."
	MsgMeshnetInviteSentSuccess               = "Meshnet invitation to '%s' was sent."
	MsgMeshnetInviteDenySuccess               = "Meshnet invitation from '%s' was denied."
	MsgMeshnetInviteRevokeSuccess             = "Meshnet invitation to '%s' was revoked."
	MsgMeshnetInviteSendUsage                 = "Sends an invitation to join the mesh network."
	MsgMeshnetInviteSendAlreadyExists         = "Meshnet invitation for '%s' already exists."
	MsgMeshnetInviteSendInvalidEmail          = "Invalid email '%s'."
	MsgMeshnetInviteSendSameAccountEmail      = "Email should belong to a different user."
	MsgMeshnetInviteSendDeviceCount           = "The peer you're trying to invite has maximum device count reached."
	MsgMeshnetInviteWeeklyLimit               = "Weekly invitation limit reached."
	MsgMeshnetInviteAllowIncomingTrafficUsage = "Allow incoming traffic from a peer."
	MsgMeshnetAllowTrafficRoutingUsage        = "Allow the peer to route traffic through this device."
	MsgMeshnetAllowLocalNetworkUsage          = "Allow the peer to access local network when routing traffic through this device."
	MsgMeshnetAllowFileshare                  = "Allow the peer to send you files."

	// Meshnet set commands group
	MsgMeshnetSetUsage = "Set a Meshnet configuration option."

	MsgMeshnetSetMachineNicknameUsage = "Sets a nickname for this machine within Meshnet."
	MsgMeshnetSetNicknameArgsUsage    = "<new_nickname>"
	MsgMeshnetSetNicknameSuccessful   = "The nickname for this machine is now set to '%s'."

	// Meshnet remove commands group
	MsgMeshnetRemoveUsage = "Remove a Meshnet configuration option."

	MsgMeshnetRemoveMachineNicknameUsage = "Removes the nickname currently set for this machine within Meshnet."
	MsgMeshnetRemoveNicknameSuccessful   = "The nickname for this machine has been removed."

	// Peers
	MsgMeshnetPeerListFilters = "" /* 180-byte string literal not displayed */
	MsgMeshnetPeerUsage       = "Manage Meshnet peers."
	MsgMeshnetPeerDescription = `` /* 364-byte string literal not displayed */

	MsgMeshnetPeerArgsUsage     = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey>"
	MsgMeshnetPeerListUsage     = "Lists available peers in a Meshnet."
	MsgMeshnetPeerRemoveUsage   = "Removes a peer from a Meshnet."
	MsgMeshnetPeerRemoveSuccess = "Peer '%s' has been removed from the Meshnet."

	MsgMeshnetPeerRoutingUsage          = "Allows/denies a peer device to route all traffic through this device."
	MsgMeshnetPeerRoutingDescription    = MsgMeshnetPeerRoutingUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/traffic-routing-permissions"
	MsgMeshnetPeerRoutingAllowUsage     = "Allows a Meshnet peer to route its' traffic through this device."
	MsgMeshnetPeerRoutingDenyUsage      = "Denies a Meshnet peer to route its' traffic through this device."
	MsgMeshnetPeerRoutingAlreadyAllowed = "Traffic routing for '%s' is already allowed."
	MsgMeshnetPeerRoutingAlreadyDenied  = "Traffic routing for '%s' is already denied."
	MsgMeshnetPeerRoutingAllowSuccess   = "Traffic routing for '%s' has been allowed."
	MsgMeshnetPeerRoutingDenySuccess    = "Traffic routing for '%s' has been denied."

	MsgMeshnetPeerIncomingUsage          = "Allows/denies a peer device to access this device remotely (incoming connections)."
	MsgMeshnetPeerIncomingDescription    = MsgMeshnetPeerIncomingUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/remote-access-permissions"
	MsgMeshnetPeerIncomingAllowUsage     = "Allows a Meshnet peer to send traffic to this device."
	MsgMeshnetPeerIncomingDenyUsage      = "Denies a Meshnet peer to send traffic to this device."
	MsgMeshnetPeerIncomingAlreadyAllowed = "Incoming traffic for '%s' is already allowed."
	MsgMeshnetPeerIncomingAlreadyDenied  = "Incoming traffic for '%s' is already denied."
	MsgMeshnetPeerIncomingAllowSuccess   = "Incoming traffic for '%s' has been allowed."
	MsgMeshnetPeerIncomingDenySuccess    = "Incoming traffic for '%s' has been denied."

	MsgMeshnetPeerLocalNetworkUsage          = "Allows/denies access to your local network when a peer device is routing traffic through this device."
	MsgMeshnetPeerLocalNetworkDescription    = MsgMeshnetPeerLocalNetworkUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/local-network-permissions"
	MsgMeshnetPeerLocalNetworkAllowUsage     = "Allows a Meshnet peer to access local network when routing traffic through this device."
	MsgMeshnetPeerLocalNetworkDenyUsage      = "Denies a Meshnet peer to access local network when routing traffic through this device."
	MsgMeshnetPeerLocalNetworkAlreadyAllowed = "Local network access for '%s' is already allowed."
	MsgMeshnetPeerLocalNetworkAlreadyDenied  = "Local network access for '%s' is already denied."
	MsgMeshnetPeerLocalNetworkAllowSuccess   = "Local network access for '%s' has been allowed."
	MsgMeshnetPeerLocalNetworkDenySuccess    = "Local network access for '%s' has been denied."

	MsgMeshnetPeerFileshareUsage          = "Allows/denies peer to send files to this device."
	MsgMeshnetPeerFileshareDescription    = MsgMeshnetPeerFileshareUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/file-sharing-permissions"
	MsgMeshnetPeerFileshareAllowUsage     = "Allows a Meshnet peer to send files to this device."
	MsgMeshnetPeerFileshareDenyUsage      = "Denies a Meshnet peer to send files to this device."
	MsgMeshnetPeerFileshareAlreadyAllowed = "Fileshare for '%s' is already allowed."
	MsgMeshnetPeerFileshareAlreadyDenied  = "Fileshare for '%s' is already denied."
	MsgMeshnetPeerFileshareAllowSuccess   = "Fileshare for '%s' has been allowed."
	MsgMeshnetPeerFileshareDenySuccess    = "Fileshare for '%s' has been denied."

	MsgMeshnetPeerAutomaticFileshareUsage              = "" /* 140-byte string literal not displayed */
	MsgMeshnetPeerAutomaticFileshareAllowUsage         = "Enables automatic fileshare from device."
	MsgMeshnetPeerAutomaticFileshareDenyUsage          = "Denies automatic fileshare from device."
	MsgMeshnetPeerAutomaticFileshareAlreadyEnabled     = "Automatic fileshare for '%s' is already allowed."
	MsgMeshnetPeerAutomaticFileshareAlreadyDisabled    = "Automatic fileshare for '%s' is already denied."
	MsgMeshnetPeerAutomaticFileshareEnableSuccess      = "Automatic fileshare for '%s' has been allowed."
	MsgMeshnetPeerAutomaticFileshareDisableSuccess     = "Automatic fileshare for '%s' has been denied."
	MsgMeshnetPeerAutomaticFileshareDefaultDirNotFound = "We couldn't enable auto-accept because the download directory doesn't exist."

	MsgMeshnetPeerConnectUsage        = "Treats a peer as a VPN server and connects to it if the peer has allowed traffic routing."
	MsgMeshnetPeerConnectSuccess      = "You are connected to Meshnet exit node '%s'."
	MsgMeshnetPeerDoesNotAllowRouting = "Meshnet peer '%s' does not allow traffic routing."
	MsgMeshnetPeerAlreadyConnected    = "You are already connected."
	MsgMeshnetPeerConnectFailed       = "Connect to other mesh peer failed - check if peer '%s' is online."

	MsgMeshnetPeerNicknameUsage           = "Sets/removes a peer device nickname within Meshnet."
	MsgMeshnetPeerSetNicknameUsage        = "Sets a nickname for the specified peer device."
	MsgMeshnetPeerSetNicknameArgsUsage    = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey> <new_peer_nickname>"
	MsgMeshnetPeerRemoveNicknameUsage     = "Removes the nickname currently set for the specified peer device."
	MsgMeshnetPeerRemoveNicknameArgsUsage = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey>"
	MsgMeshnetPeerSetNicknameSuccessful   = "The nickname for the peer '%s' is now set to '%s'."
	MsgMeshnetNicknameAlreadyEmpty        = "The nickname is already removed for this device."
	MsgMeshnetPeerResetNicknameSuccessful = "The nickname for the peer '%s' has been removed. The default hostname is '%s'."

	// errors received for meshnet nicknames
	MsgMeshnetSetSameNickname           = "The nickname '%s' is already set for this device."
	MsgMeshnetNicknameIsDomainName      = "The nickname is unavailable: A domain with this name already exists in your system."
	MsgMeshnetRateLimitReach            = "You've reached the weekly limit for nickname changes."
	MsgMeshnetNicknameTooLong           = "This nickname is too long. Nicknames can have up to 25 characters."
	MsgMeshnetDuplicateNickname         = "A device with this nickname already exists."
	MsgMeshnetContainsForbiddenWord     = "This nickname contains a restricted word."
	MsgMeshnetInvalidPrefixOrSuffix     = "This nickname contains a disallowed prefix or suffix."
	MsgMeshnetNicknameWithDoubleHyphens = "Nicknames can't contain double dashes ('--')."
	MsgMeshnetContainsInvalidChars      = "This nickname contains disallowed characters."

	// Fileshare
	FileshareName       = "fileshare"
	FileshareSendName   = "send"
	FileshareAcceptName = "accept"
	FileshareCancelName = "cancel"
	FileshareListName   = "list"
	FileshareClearName  = "clear"

	MsgFileshareUsage                     = "Transfer files of any size between Meshnet peers securely and privately"
	MsgFileshareDescription               = MsgFileshareUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/sharing-files-in-meshnet\n\nNote: most arguments (peer name, transfer ID, file name) in fileshare commands can be entered faster using auto-completion. Simply press Tab and the app will suggest valid options for you."
	MsgFileshareTransferNotFound          = "Transfer not found."
	MsgFileshareInvalidPath               = "Invalid path provided: %s"
	MsgFilesharePathNotFound              = "Download directory %q does not exist. Make sure the directory exists or provide an alternative via --" + flagFilesharePath
	MsgFileshareAcceptPathIsASymlink      = "A download path can’t be a symbolic link. Please provide a directory as a download path to accept the transfer."
	MsgFileshareAcceptPathIsNotADirectory = "Please provide a directory as a download path to accept the transfer."
	MsgFileshareInvalidPeer               = "Peer name is invalid."
	MsgFileshareDisconnectedPeer          = "Peer is disconnected."
	MsgFileshareFileNotFound              = "File not found."
	MsgFileshareSocketNotFound            = "" /* 143-byte string literal not displayed */
	MsgFileshareUserNotLoggedIn           = "You’re not logged in. To share files, please log in to NordVPN and ensure Meshnet is enabled."

	MsgFileshareAcceptHomeError      = "Cannot determine default download path. Please provide download path explicitly via --" + flagFilesharePath
	MsgFileshareAcceptAllError       = "Download couldn't start."
	MsgFileshareAcceptOutgoingError  = "Can't accept outgoing transfer."
	MsgFileshareAlreadyAcceptedError = "This transfer is already completed."
	MsgFileshareFileInvalidated      = "The transfer of this file is already completed or canceled."
	MsgFileshareTransferInvalidated  = "This transfer is already completed or canceled."
	MsgTooManyFiles                  = "Number of files in a transfer cannot exceed 1000. Try archiving the directory."
	MsgNoFiles                       = "The directory you’re trying to send is empty. Please choose another one."
	MsgDirectoryToDeep               = "File depth cannot exceed 5 directories. Try archiving the directory."
	MsgSendingNotAllowed             = "This peer does not allow file transfers from you."
	MsgFileNotInProgress             = "This file is not in progress"
	MsgNotEnoughSpace                = "The transfer can't be accepted because there's not enough storage on your device."
	MsgNoPermissions                 = "You don’t have write permissions for the download directory %s. To receive the file transfer, choose another download directory using the --" + flagFilesharePath + " parameter."

	MsgFileshareSendUsage       = "Send files or directories to a Meshnet peer."
	MsgFileshareSendArgsUsage   = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey> <path_1> [path_2...]"
	MsgFileshareSendDescription = MsgFileshareSendUsage + "\n\nTo cancel a transfer in progress, press Ctrl+C"
	MsgFileshareNoWaitUsage     = "" /* 167-byte string literal not displayed */
	MsgFileshareSendNoWait      = "File transfer %s has started in the background."
	MsgFileshareAcceptNoWait    = "File transfer has started in the background."
	MsgFileshareWaitAccept      = "Waiting for the peer to accept your transfer..."
	MsgTransferNotCreated       = "Can’t send the files. Please check if you have the \"read\" permission for the files you want to send."

	MsgFileshareListUsage       = "Lists transfers. If transfer ID is provided, lists files in the transfer."
	MsgFileshareListArgsUsage   = `[transfer_id]`
	MsgFileshareListDescription = `` /* 129-byte string literal not displayed */

	MsgFileshareListInUsage       = "Show only incoming transfers."
	MsgFileshareListOutUsage      = "Show only outgoing transfers."
	MsgFileshareCancelUsage       = "" /* 156-byte string literal not displayed */
	MsgFileshareCancelArgsUsage   = "<transfer_id> [file_id]"
	MsgFileshareCancelSuccess     = "File transfer canceled."
	MsgFileshareAcceptUsage       = "" /* 158-byte string literal not displayed */
	MsgFileshareAcceptArgsUsage   = "<transfer_id> [file_id1] [file_id2...]"
	MsgFileshareAcceptDescription = MsgFileshareAcceptUsage + "\n\nTo cancel a transfer in progress, press Ctrl+C"
	MsgFileshareAcceptPathUsage   = "Specify download path (default: $XDG_DOWNLOAD_DIR or $HOME/Downloads)"
	MsgFileshareClearUsage        = "Clear entries older than the specified time period from the file transfer history."
	MsgFileshareClearArgsUsage    = "all|<time_period> [time_period...]"
	MsgFileshareClearDescription  = MsgFileshareClearUsage + "\n\nSpecify the time period using the systemd time span syntax: https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html\n\nFor example, \"nordvpn fileshare clear 1d 12h\" clears entries older than 36 hours. Use \"nordvpn fileshare clear all\" to remove all entries."
	MsgFileshareClearSuccess      = "File transfer history cleared."
	MsgFileshareClearFailure      = "Can't clear file transfer history. See nordfileshared.log for more details."

	MsgFileshareProgressOngoing        = "File transfer [%s] progress [%d%%]"
	MsgFileshareProgressFinished       = "File transfer [%s] completed.      " // Need extra spaces to cover the progress message
	MsgFileshareProgressFinishedErrors = "File transfer [%s] completed. Some of the files have failed to transfer."
	MsgFileshareProgressCanceledByPeer = "File transfer [%s] canceled by peer."
	MsgFileshareProgressCanceled       = "File transfer [%s] canceled by other process."
	MsgFileshareStartedByOtherUser     = "" /* 153-byte string literal not displayed */

	MsgNoSnapPermissions = "" /* 187-byte string literal not displayed */
)
View Source
const AccountUsageText = "Shows account information"

AccountUsageText is shown next to account command by nordvpn --help

View Source
const AllowlistRemoveAllUsageText = "Removes all ports and subnets from the allowlist"

AllowlistRemoveAllUsageText is shown next to all command by nordvpn allowlist remove --help

View Source
const AppHelpTemplate = `` /* 890-byte string literal not displayed */

AppHelpTemplate is the template we use for forming the cli message on no command

View Source
const CommandHelpTemplate = `` /* 315-byte string literal not displayed */

CommandHelpTemplate is the template we use to show help

View Source
const CommandWithoutArgsHelpTemplate = `` /* 301-byte string literal not displayed */

CommandWithoutArgsHelpTemplate is the template we use to show help

View Source
const CountriesUsageText = "Shows a list of countries where servers are available"

CountriesUsageText is shown next to countries command by nordvpn --help

View Source
const DisconnectUsageText = "Disconnects you from VPN"

DisconnectUsageText is shown next to disconnect command by nordvpn --help

View Source
const GroupsUsageText = "Shows a list of available server groups"

GroupsUsageText is shown next to groups command by nordvpn --help

View Source
const (
	PeerListDescription = "Press the Tab key to see auto-suggestions for filters."
)
View Source
const RegisterUsageText = "Registers a new user account"

RegisterUsageText is shown next to register command by nordvpn --help

View Source
const SetAnalyticsUsageText = "Help us improve by sending anonymous " +
	"aggregate data: crash reports, OS version, marketing " +
	"performance, and feature usage data – nothing that could " +
	"identify you."
View Source
const SetDefaultsUsageText = "Restores settings to their default values."

SetDefaultsUsageText is shown next to defaults command by nordvpn set --help

View Source
const SetIpv6UsageText = "Enables or disables use of the IPv6."
View Source
const SetKillSwitchUsageText = "" /* 181-byte string literal not displayed */

SetKillSwitchUsageText is shown next to killswitch command by nordvpn set --help

View Source
const SetNotifyUsageText = "Enables or disables notifications"

SetNotifyUsageText is shown next to notify command by nordvpn set --help

View Source
const SetObfuscateUsageText = "" /* 173-byte string literal not displayed */

SetObfuscateUsageText is shown next to obfuscate command by nordvpn set --help

View Source
const SetRoutingUsageText = "Allows routing traffic through VPN " +
	"servers and peer devices in Meshnet. This setting must be " +
	"enabled to send your traffic through a VPN server or a peer " +
	"device. If the setting is disabled, the app will only " +
	"initiate necessary connections to a VPN server or a peer " +
	"device but won’t start traffic routing."
View Source
const SettingsUsageText = "Shows current settings"

SettingsUsageText is show next to settings command by nordvpn --help

View Source
const StatusUsageText = "Shows connection status"

StatusUsageText is shown next to status command by nordvpn --help

View Source
const SubcommandHelpTemplate = `` /* 594-byte string literal not displayed */

SubcommandHelpTemplate is the template we use to show subcommand help

View Source
const (
	// TokenUsageText is shown next to login command by nordvpn --help
	TokenUsageText = "Show token information" // #nosec
)

Variables

View Source
var (
	ErrInternetConnection = errors.New(CheckYourInternetConnMessage)
	ErrAccountExpired     = errors.New(ExpiredAccountMessage)
	ErrUpdateAvailable    = errors.New(UpdateAvailableMessage)
)

Functions

func FormatSnapMissingConnsErr

func FormatSnapMissingConnsErr(err *snappb.ErrMissingConnections) string

func LoginRespHandler

func LoginRespHandler(ctx *cli.Context, resp *pb.LoginResponse) error

func MeshnetResponseToError

func MeshnetResponseToError(resp *meshpb.MeshnetResponse) error

MeshnetResponseToError returns a human readable error

func NewApp

func NewApp(version, environment, hash, salt string,
	pingErr error,
	conn *grpc.ClientConn,
	fileshareConn grpc.ClientConnInterface,
	loaderInterceptor *LoaderInterceptor,
) (*cli.App, error)

func ReadCredentialsFromTerminal

func ReadCredentialsFromTerminal() (string, string, error)

ReadCredentialsFromTerminal reads username and password from terminal this overrides current terminal and restores it upon completion

func ReadPlanFromTerminal

func ReadPlanFromTerminal() (int, error)

func RetrieveSnapConnsError

func RetrieveSnapConnsError(err error) *snappb.ErrMissingConnections

RetrieveSnapConnsError checks whether ny of the details inside gRPC error is a `SnapPermissionError` and returns pointer to it. Otherwise, returns nil

func SetLANDiscoveryErrorCodeToError

func SetLANDiscoveryErrorCodeToError(code pb.SetErrorCode, flag bool) error

func SetLANDiscoveryStatusToMessage

func SetLANDiscoveryStatusToMessage(code pb.SetLANDiscoveryStatus, flag bool)

func Status

func Status(resp *pb.StatusResponse) string

Status returns ready to print status string.

Types

type Loader

type Loader interface {
	Start()
	Stop()
}

Loader is show progress interface

func NewLoader

func NewLoader() Loader

type LoaderConfig

type LoaderConfig struct {
	Prefix string
}

type LoaderInterceptor

type LoaderInterceptor struct {
	// contains filtered or unexported fields
}

func (*LoaderInterceptor) StreamInterceptor

func (i *LoaderInterceptor) StreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string,
	streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

func (*LoaderInterceptor) UnaryInterceptor

func (i *LoaderInterceptor) UnaryInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

type PortRange

type PortRange struct {
	// contains filtered or unexported fields
}

type SilentLoader

type SilentLoader struct{}

SilentLoader do not show progress in case of non-terminal output

func (*SilentLoader) Start

func (l *SilentLoader) Start()

func (*SilentLoader) Stop

func (l *SilentLoader) Stop()

type TerminalLoader

type TerminalLoader struct {
	// contains filtered or unexported fields
}

TerminalLoader show operation progress to the human user in the terminal

func (*TerminalLoader) Start

func (l *TerminalLoader) Start()

func (*TerminalLoader) Stop

func (l *TerminalLoader) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL