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
08f1ae74
Commit
08f1ae74
authored
10 months ago
by
Pea Nut
Committed by
jkito
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve logging and error handling in generateManagementPassword
parent
c994d4bb
No related branches found
No related tags found
1 merge request
!198
v5 implementation with a single Bitmask struct
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/vpn/openvpn.go
+11
-3
11 additions, 3 deletions
pkg/vpn/openvpn.go
with
11 additions
and
3 deletions
pkg/vpn/openvpn.go
+
11
−
3
View file @
08f1ae74
...
...
@@ -179,16 +179,24 @@ func maybeGetPrivateGateway() (bonafide.Gateway, bool) {
return
gw
,
true
}
//
g
enerates a password and returns the path for a temporary file where th
is
password is written
//
G
enerates a password and returns the path for a temporary file where th
e
password is written
func
(
b
*
Bitmask
)
generateManagementPassword
()
string
{
pass
:=
getRandomPass
(
12
)
tmpFile
,
err
:=
ioutil
.
TempFile
(
b
.
tempdir
,
"leap-vpn-"
)
if
err
!=
nil
{
log
.
Fatal
()
.
Err
(
err
)
.
Msg
(
"Could not create temporary file"
)
Msg
(
"Could not create temporary file to save management password"
)
}
_
,
err
=
tmpFile
.
Write
([]
byte
(
pass
))
if
err
!=
nil
{
log
.
Fatal
()
.
Str
(
"tmpFile"
,
tmpFile
.
Name
())
.
Err
(
err
)
.
Msg
(
"Could not write management password to file"
)
}
tmpFile
.
Write
([]
byte
(
pass
))
b
.
launch
.
MngPass
=
pass
return
tmpFile
.
Name
()
}
...
...
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