Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Testing WG keys rotation interval
Browse files Browse the repository at this point in the history
  • Loading branch information
stenya committed May 6, 2020
1 parent c3fda0a commit 6e62585
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,12 +1150,22 @@ func (s *Service) WireGuardSetKeysRotationInterval(interval int64) {
// WireGuardGetKeys get WG keys
func (s *Service) WireGuardGetKeys() (session, wgPublicKey, wgPrivateKey, wgLocalIP string, generatedTime time.Time, updateInterval time.Duration) {
p := s._preferences

interval := p.Session.WGKeysRegenInerval

//----------------------------------------------------------------
// ONLY FOR TESTS!
// Interval change 1 day => 1 minute
// interval = time.Minute * (interval / (time.Hour * 24))
// log.Debug(fmt.Sprintf("(TESTING) Changed WG keys rotation interval %v => %v", p.Session.WGKeysRegenInerval, interval))
//----------------------------------------------------------------

return p.Session.Session,
p.Session.WGPublicKey,
p.Session.WGPrivateKey,
p.Session.WGLocalIP,
p.Session.WGKeyGenerated,
p.Session.WGKeysRegenInerval
interval //p.Session.WGKeysRegenInerval
}

// WireGuardGenerateKeys - generate new wireguard keys
Expand Down

0 comments on commit 6e62585

Please sign in to comment.