Skip to content

Commit b01326f

Browse files
committed
repository name mbvpn-linux
1 parent 3a0d734 commit b01326f

25 files changed

Lines changed: 197 additions & 199 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-include .env
22

33
BINARY_NAME=mbvpn
4-
GO_PKG=github.com/Malwarebytes/mbvpn
4+
GO_PKG=github.com/Malwarebytes/mbvpn-linux
55
GOFLAGS ?=
66

77
# Version information

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Malwarebytes VPN for Linux
22

3-
[![Version](https://img.shields.io/github/v/release/Malwarebytes/mbvpn?style=flat-square)](https://github.com/Malwarebytes/mbvpn/releases)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/Malwarebytes/mbvpn)](https://goreportcard.com/report/github.com/Malwarebytes/mbvpn)
5-
[![License](https://img.shields.io/github/license/Malwarebytes/mbvpn?style=flat-square)](LICENSE.md)
3+
[![Version](https://img.shields.io/github/v/release/Malwarebytes/mbvpn-linux?style=flat-square)](https://github.com/Malwarebytes/mbvpn-linux/releases)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/Malwarebytes/mbvpn-linux)](https://goreportcard.com/report/github.com/Malwarebytes/mbvpn-linux)
5+
[![License](https://img.shields.io/github/license/Malwarebytes/mbvpn-linux?style=flat-square)](LICENSE.md)
66

77
## IMPORTANT
88

@@ -31,14 +31,14 @@ WireGuard tools are required for MBVPN to function properly. Install them using
3131
Install MBVPN directly using Go's package manager:
3232

3333
```bash
34-
go install github.com/Malwarebytes/mbvpn@latest
34+
go install github.com/Malwarebytes/mbvpn-linux@latest
3535
```
3636

3737
> **Note**: Ensure that your `$GOPATH/bin` (typically `~/go/bin`) is in your `$PATH` to run the `mbvpn` command.
3838
3939
### Alternative: Download from Releases
4040

41-
1. Download the latest release for your architecture from the [Releases](https://github.com/Malwarebytes/mbvpn/releases) page
41+
1. Download the latest release for your architecture from the [Releases](https://github.com/Malwarebytes/mbvpn-linux/releases) page
4242
2. Extract the binary and place it in a directory in your `$PATH` (e.g., `/usr/local/bin`)
4343

4444
## Build Configuration

cmd/cities.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
22
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
3-
43
*/
54
package cmd
65

76
import (
8-
"github.com/Malwarebytes/mbvpn/pkg/errors"
9-
"github.com/Malwarebytes/mbvpn/pkg/session"
10-
"github.com/Malwarebytes/mbvpn/pkg/vpn"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/errors"
8+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
9+
"github.com/Malwarebytes/mbvpn-linux/pkg/vpn"
1110
"github.com/spf13/cobra"
1211
)
1312

@@ -29,4 +28,4 @@ Provides more specific geographic options than countries. Requires an active ses
2928
}
3029

3130
return cmd
32-
}
31+
}

cmd/connect.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Copyright © 2025 NAME HERE <EMAIL ADDRESS>
44
package cmd
55

66
import (
7-
"github.com/Malwarebytes/mbvpn/pkg/errors"
8-
"github.com/Malwarebytes/mbvpn/pkg/session"
9-
"github.com/Malwarebytes/mbvpn/pkg/vpn"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/errors"
8+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
9+
"github.com/Malwarebytes/mbvpn-linux/pkg/vpn"
1010
"github.com/spf13/cobra"
1111
)
1212

1313
func NewConnectCommand(sm session.SessionManager, vpn vpn.Vpn) *cobra.Command {
1414
return &cobra.Command{
15-
Use: "connect",
15+
Use: "connect",
1616
Aliases: []string{"c"},
17-
Short: "Connect to a VPN server",
17+
Short: "Connect to a VPN server",
1818
Long: `Establishes a VPN connection to the specified server using WireGuard.
1919
Requires an active session (login first) and a valid server identifier.
2020
@@ -47,4 +47,4 @@ Use 'mbvpn countries' or 'mbvpn cities' to browse servers by location.`,
4747
}
4848
},
4949
}
50-
}
50+
}

cmd/countries.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
22
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
3-
43
*/
54
package cmd
65

76
import (
8-
"github.com/Malwarebytes/mbvpn/pkg/errors"
9-
"github.com/Malwarebytes/mbvpn/pkg/session"
10-
"github.com/Malwarebytes/mbvpn/pkg/vpn"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/errors"
8+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
9+
"github.com/Malwarebytes/mbvpn-linux/pkg/vpn"
1110
"github.com/spf13/cobra"
1211
)
1312

@@ -29,4 +28,4 @@ Useful for selecting servers by geographic location. Requires an active session.
2928
}
3029

3130
return cmd
32-
}
31+
}

cmd/disconnect.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ Copyright © 2025 NAME HERE <EMAIL ADDRESS>
44
package cmd
55

66
import (
7-
"github.com/Malwarebytes/mbvpn/pkg/vpn"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/vpn"
88
"github.com/spf13/cobra"
99
)
1010

1111
func NewDisconnectCommand(vpn vpn.Vpn) *cobra.Command {
1212
return &cobra.Command{
13-
Use: "disconnect",
13+
Use: "disconnect",
1414
Aliases: []string{"d"},
15-
Short: "Stops the VPN connection.",
16-
Long: `Stops the VPN connection.`,
15+
Short: "Stops the VPN connection.",
16+
Long: `Stops the VPN connection.`,
1717
Run: func(cmd *cobra.Command, args []string) {
1818
server := ""
1919
if len(args) > 0 {
2020
server = args[0]
2121
}
22-
22+
2323
err := vpn.Disconnect(server)
2424
HandleError(err)
2525
},
2626
}
27-
}
27+
}

cmd/login.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright © 2025 NAME HERE <EMAIL ADDRESS>
44
package cmd
55

66
import (
7-
"github.com/Malwarebytes/mbvpn/pkg/session"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
88
"github.com/spf13/cobra"
99
)
1010

@@ -16,15 +16,15 @@ func NewLoginCommand(sm session.SessionManager) *cobra.Command {
1616
The command claims available seat of your Malwarebytes license.`,
1717
Run: func(cmd *cobra.Command, args []string) {
1818
var err error
19-
19+
2020
key, _ := cmd.Flags().GetString("licenseKey")
2121
if key == "" {
2222
code, _ := cmd.Flags().GetString("mbCode")
2323
err = sm.LoginWithCode(code)
2424
} else {
2525
err = sm.LoginWithKey(key)
2626
}
27-
27+
2828
// Handle any errors that might have occurred
2929
HandleError(err)
3030
},
@@ -35,4 +35,4 @@ func NewLoginCommand(sm session.SessionManager) *cobra.Command {
3535
cmd.MarkFlagsOneRequired("licenseKey", "mbCode")
3636

3737
return cmd
38-
}
38+
}

cmd/logout.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ Copyright © 2025 NAME HERE <EMAIL ADDRESS>
44
package cmd
55

66
import (
7-
"github.com/Malwarebytes/mbvpn/pkg/session"
7+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
88
"github.com/spf13/cobra"
99
)
1010

1111
func NewLogoutCommand(sm session.SessionManager) *cobra.Command {
12-
return &cobra.Command{
13-
Use: "logout",
14-
Short: "Logout this device.",
15-
Long: `Deactivates this device seat and cleans local configuration.`,
16-
Run: func(cmd *cobra.Command, args []string) {
17-
err := sm.Logout()
18-
HandleError(err)
19-
},
20-
}
21-
}
12+
return &cobra.Command{
13+
Use: "logout",
14+
Short: "Logout this device.",
15+
Long: `Deactivates this device seat and cleans local configuration.`,
16+
Run: func(cmd *cobra.Command, args []string) {
17+
err := sm.Logout()
18+
HandleError(err)
19+
},
20+
}
21+
}

cmd/root.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"fmt"
88
"os"
99

10-
"github.com/Malwarebytes/mbvpn/pkg/config"
11-
"github.com/Malwarebytes/mbvpn/pkg/errors"
12-
"github.com/Malwarebytes/mbvpn/pkg/remote"
13-
"github.com/Malwarebytes/mbvpn/pkg/servers"
14-
"github.com/Malwarebytes/mbvpn/pkg/session"
15-
"github.com/Malwarebytes/mbvpn/pkg/vpn"
16-
"github.com/spf13/cobra"
10+
"github.com/Malwarebytes/mbvpn-linux/pkg/config"
11+
"github.com/Malwarebytes/mbvpn-linux/pkg/errors"
12+
"github.com/Malwarebytes/mbvpn-linux/pkg/remote"
13+
"github.com/Malwarebytes/mbvpn-linux/pkg/servers"
14+
"github.com/Malwarebytes/mbvpn-linux/pkg/session"
15+
"github.com/Malwarebytes/mbvpn-linux/pkg/vpn"
1716
log "github.com/sirupsen/logrus"
17+
"github.com/spf13/cobra"
1818
)
1919

2020
// ErrorHandler is the central error handler for all commands
@@ -45,7 +45,7 @@ your privacy settings from the terminal. Requires a valid Malwarebytes license.`
4545
log.SetLevel(log.InfoLevel)
4646
config.DebugFlag = false
4747
}
48-
48+
4949
// Initialize error handler with current debug setting
5050
ErrorHandler = errors.NewHandler()
5151
},
@@ -84,13 +84,13 @@ func HandleError(err error) {
8484
if err == nil {
8585
return
8686
}
87-
87+
8888
if ErrorHandler == nil {
8989
// Fallback if handler isn't initialized
9090
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
9191
os.Exit(1)
9292
}
93-
93+
9494
if ErrorHandler.Handle(err) {
9595
os.Exit(1)
9696
}

cmd/root_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ package cmd
33
import (
44
"testing"
55

6-
"github.com/Malwarebytes/mbvpn/pkg/errors"
6+
"github.com/Malwarebytes/mbvpn-linux/pkg/errors"
77
"github.com/spf13/cobra"
88
)
99

1010
func TestRootCommandStructure(t *testing.T) {
1111
if rootCmd.Use != "mbvpn" {
1212
t.Errorf("Expected Use to be 'mbvpn', got '%s'", rootCmd.Use)
1313
}
14-
14+
1515
if rootCmd.Short != "Malwarebytes VPN command-line client" {
1616
t.Errorf("Expected Short to be 'Malwarebytes VPN command-line client', got '%s'", rootCmd.Short)
1717
}
18-
18+
1919
expectedLong := `MBVPN is a command-line VPN client for Malwarebytes VPN service.
2020
Manage your VPN connections, browse available servers, and control
2121
your privacy settings from the terminal. Requires a valid Malwarebytes license.`
2222
if rootCmd.Long != expectedLong {
2323
t.Errorf("Expected Long to be '%s', got '%s'", expectedLong, rootCmd.Long)
2424
}
25-
25+
2626
if rootCmd.PersistentPreRun == nil {
2727
t.Error("Expected PersistentPreRun function to be defined")
2828
}
@@ -38,7 +38,7 @@ func TestRootCommandFlags(t *testing.T) {
3838
t.Errorf("Expected debug flag usage to be 'Run command in debug mode.', got '%s'", debugFlag.Usage)
3939
}
4040
}
41-
41+
4242
// Test trace flag
4343
traceFlag := rootCmd.PersistentFlags().Lookup("trace")
4444
if traceFlag == nil {
@@ -52,7 +52,7 @@ func TestRootCommandFlags(t *testing.T) {
5252

5353
func TestRootCommandSubcommands(t *testing.T) {
5454
expectedCommands := []string{"login", "logout", "servers", "countries", "cities", "connect", "disconnect", "status", "version"}
55-
55+
5656
for _, expectedCmd := range expectedCommands {
5757
found := false
5858
for _, cmd := range rootCmd.Commands() {
@@ -70,15 +70,15 @@ func TestRootCommandSubcommands(t *testing.T) {
7070
func TestPersistentPreRunInitializesErrorHandler(t *testing.T) {
7171
// Create a simple test command with the same PersistentPreRun
7272
testCmd := &cobra.Command{
73-
Use: "test",
73+
Use: "test",
7474
PersistentPreRun: rootCmd.PersistentPreRun,
7575
}
7676
testCmd.PersistentFlags().Bool("debug", false, "Run command in debug mode.")
7777
testCmd.PersistentFlags().Bool("trace", false, "Run command in trace mode.")
78-
78+
7979
// Execute PersistentPreRun
8080
testCmd.PersistentPreRun(testCmd, []string{})
81-
81+
8282
// Verify ErrorHandler is initialized
8383
if ErrorHandler == nil {
8484
t.Error("Expected ErrorHandler to be initialized")
@@ -88,7 +88,7 @@ func TestPersistentPreRunInitializesErrorHandler(t *testing.T) {
8888
func TestHandleErrorWithNilError(t *testing.T) {
8989
// Initialize ErrorHandler
9090
ErrorHandler = errors.NewHandler()
91-
91+
9292
// Test with nil error - should not panic or exit
9393
HandleError(nil)
9494
// If we reach this point, the function handled nil correctly
@@ -97,13 +97,13 @@ func TestHandleErrorWithNilError(t *testing.T) {
9797
func TestHandleErrorWithNilHandler(t *testing.T) {
9898
// Test error handling when ErrorHandler is nil
9999
ErrorHandler = nil
100-
100+
101101
// We can't test the actual os.Exit behavior, but we can verify the function exists
102102
// and would handle the fallback case
103103
if ErrorHandler != nil {
104104
t.Error("Expected ErrorHandler to be nil for this test")
105105
}
106-
106+
107107
// Reset ErrorHandler for other tests
108108
ErrorHandler = errors.NewHandler()
109-
}
109+
}

0 commit comments

Comments
 (0)