Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
bitmask-vpn
Commits
0f43c044
Commit
0f43c044
authored
9 months ago
by
Pea Nut
Committed by
jkito
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Use v5 implementation if configured or env is set
parent
8ef9441d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!198
v5 implementation with a single Bitmask struct
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/vpn/bitmask.go
+24
-1
24 additions, 1 deletion
pkg/vpn/bitmask.go
pkg/vpn/openvpn.go
+9
-0
9 additions, 0 deletions
pkg/vpn/openvpn.go
with
33 additions
and
1 deletion
pkg/vpn/bitmask.go
+
24
−
1
View file @
0f43c044
...
...
@@ -29,6 +29,7 @@ import (
"0xacab.org/leap/bitmask-vpn/pkg/snowflake"
"0xacab.org/leap/bitmask-vpn/pkg/vpn/bonafide"
"0xacab.org/leap/bitmask-vpn/pkg/vpn/management"
"0xacab.org/leap/bitmask-vpn/pkg/vpn/menshen"
obfsvpn
"0xacab.org/leap/obfsvpn/client"
)
...
...
@@ -61,7 +62,29 @@ func Init() (*Bitmask, error) {
return
nil
,
err
}
api
:=
bonafide
.
New
()
var
api
apiInterface
if
os
.
Getenv
(
"API_VERSION"
)
==
"5"
{
config
.
ApiVersion
=
5
log
.
Debug
()
.
Msg
(
"Enforcing API v5 by env variable"
)
}
log
.
Debug
()
.
Int
(
"apiVersion"
,
config
.
ApiVersion
)
.
Msg
(
"Using specific API backend version"
)
if
config
.
ApiVersion
==
5
{
api
,
err
=
menshen
.
New
()
if
err
!=
nil
{
return
nil
,
err
}
}
else
if
config
.
ApiVersion
==
3
{
api
=
bonafide
.
New
()
}
else
{
log
.
Warn
()
.
Int
(
"apiVersion"
,
config
.
ApiVersion
)
.
Msg
(
"ApiVersion of provider was not set correctly. Version 3 and 5 is supported. Using v3 for backwards compatiblity"
)
api
=
bonafide
.
New
()
}
launch
,
err
:=
launcher
.
NewLauncher
()
if
err
!=
nil
{
return
nil
,
err
...
...
This diff is collapsed.
Click to expand it.
pkg/vpn/openvpn.go
+
9
−
0
View file @
0f43c044
...
...
@@ -204,6 +204,15 @@ func (b *Bitmask) startOpenVPN(ctx context.Context) error {
*/
b
.
statusCh
<-
Starting
if
b
.
GetTransport
()
==
"obfs4"
{
if
config
.
ApiVersion
==
5
{
// if I return an error, the GUI state does not get updated properly to Failed/Stopped and
// continues to stay in state Connecting (also clicking Cancel doesnot work)
log
.
Fatal
()
.
Msg
(
"Could not start OpenVPN with obfs4. This is currently not supported via v5"
)
// menshen/v5 has different api endpoints: gateways and bridges
// gw.Options is always empty right now
}
var
gw
bonafide
.
Gateway
var
gateways
[]
bonafide
.
Gateway
var
proxy
string
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment