mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-06 13:14:24 +08:00
commit
0197de24f1
4 changed files with 5 additions and 3 deletions
|
@ -178,7 +178,7 @@ func Authorize(
|
||||||
// check if host instead of user
|
// check if host instead of user
|
||||||
if hostAllowed {
|
if hostAllowed {
|
||||||
// TODO --- should ensure that node is only operating on itself
|
// TODO --- should ensure that node is only operating on itself
|
||||||
if hostID, macAddr, _, err := logic.VerifyHostToken(authToken); err == nil && macAddr != "" {
|
if hostID, _, _, err := logic.VerifyHostToken(authToken); err == nil {
|
||||||
r.Header.Set(hostIDHeader, hostID)
|
r.Header.Set(hostIDHeader, hostID)
|
||||||
// this indicates request is from a node
|
// this indicates request is from a node
|
||||||
// used for failover - if a getNode comes from node, this will trigger a metrics wipe
|
// used for failover - if a getNode comes from node, this will trigger a metrics wipe
|
||||||
|
|
|
@ -194,7 +194,8 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !node.Connected || node.PendingDelete || node.Action == models.NODE_DELETE || time.Since(node.LastCheckIn) > time.Hour {
|
if !node.Connected || node.PendingDelete || node.Action == models.NODE_DELETE ||
|
||||||
|
(!node.LastCheckIn.IsZero() && time.Since(node.LastCheckIn) > time.Hour) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
acls, _ := ListAclsByNetwork(models.NetworkID(node.Network))
|
acls, _ := ListAclsByNetwork(models.NetworkID(node.Network))
|
||||||
|
|
|
@ -581,7 +581,7 @@ func settings() {
|
||||||
}
|
}
|
||||||
settings := logic.GetServerSettings()
|
settings := logic.GetServerSettings()
|
||||||
if settings.AuditLogsRetentionPeriodInDays == 0 {
|
if settings.AuditLogsRetentionPeriodInDays == 0 {
|
||||||
settings.AuditLogsRetentionPeriodInDays = 30
|
settings.AuditLogsRetentionPeriodInDays = 7
|
||||||
}
|
}
|
||||||
if settings.DefaultDomain == "" {
|
if settings.DefaultDomain == "" {
|
||||||
settings.DefaultDomain = servercfg.GetDefaultDomain()
|
settings.DefaultDomain = servercfg.GetDefaultDomain()
|
||||||
|
|
|
@ -191,6 +191,7 @@ func GetFailOverPeerIps(peer, node *models.Node) []net.IPNet {
|
||||||
if failOverpeer.IsRelay {
|
if failOverpeer.IsRelay {
|
||||||
for _, id := range failOverpeer.RelayedNodes {
|
for _, id := range failOverpeer.RelayedNodes {
|
||||||
rNode, _ := logic.GetNodeByID(id)
|
rNode, _ := logic.GetNodeByID(id)
|
||||||
|
logic.GetNodeEgressInfo(&rNode, eli, acls)
|
||||||
if rNode.Address.IP != nil {
|
if rNode.Address.IP != nil {
|
||||||
allowed := net.IPNet{
|
allowed := net.IPNet{
|
||||||
IP: rNode.Address.IP,
|
IP: rNode.Address.IP,
|
||||||
|
|
Loading…
Add table
Reference in a new issue