Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
7461adf7
Commit
7461adf7
authored
1 year ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Improve the readability of the VPN code
parent
ffe2c8c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
services/manager.go
+1
-3
1 addition, 3 deletions
services/manager.go
services/meta.go
+3
-2
3 additions, 2 deletions
services/meta.go
services/vpn.go
+1
-0
1 addition, 0 deletions
services/vpn.go
with
5 additions
and
5 deletions
services/manager.go
+
1
−
3
View file @
7461adf7
...
...
@@ -72,12 +72,10 @@ type Cluster struct {
type
Unit
=
daeman
.
Unit
[
*
Cluster
]
func
NewManager
(
settings
*
ClusterSettings
,
node
*
HeptoMeta
,
logger
logr
.
Logger
)
*
daeman
.
Manager
[
*
Cluster
]
{
networking
:=
NewClusterNetworking
(
settings
.
Name
,
node
.
Name
)
node
.
VpnIP
=
networking
.
NodeAddress
cluster
:=
&
Cluster
{
settings
:
settings
,
thisNode
:
node
,
networking
:
networking
,
networking
:
NewClusterNetworking
(
settings
.
Name
,
node
.
Name
)
,
loopbackToken
:
uuid
.
NewString
(),
nodes
:
[]
*
HeptoMeta
{},
state
:
&
HeptoState
{
...
...
This diff is collapsed.
Click to expand it.
services/meta.go
+
3
−
2
View file @
7461adf7
...
...
@@ -13,9 +13,9 @@ type HeptoMeta struct {
Name
string
`json:"name"`
// Public address of the node
PublicIP
netip
.
Addr
`json:"ip"`
// Address of the node over the VPN
// Address of the node over the VPN
, set once the VPN is up
VpnIP
netip
.
Prefix
`json:"vpnIP"`
// Public key for the wireguard mesh VPN
// Public key for the wireguard mesh VPN
, set once the VPN is up
VpnKey
string
`json:"vpnKey"`
// Node role inside the cluster
Role
string
`json:"role"`
...
...
@@ -35,6 +35,7 @@ func (m *HeptoMeta) OverlayIP() netip.Prefix {
}
func
(
m
*
HeptoMeta
)
Routes
()
[]
netip
.
Prefix
{
// We do not currently support exposing additional routes
return
[]
netip
.
Prefix
{}
}
...
...
This diff is collapsed.
Click to expand it.
services/vpn.go
+
1
−
0
View file @
7461adf7
...
...
@@ -28,6 +28,7 @@ var vpn = &Unit{
return
err
}
c
.
settings
.
Logger
.
Info
(
"initialized vpn"
,
"key"
,
vpn
.
PubKey
.
String
())
c
.
thisNode
.
VpnIP
=
c
.
networking
.
NodeAddress
c
.
thisNode
.
VpnKey
=
vpn
.
PubKey
.
String
()
c
.
vpn
=
vpn
return
nil
...
...
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