mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
GRA-1298: License check changes, free tier limits for saas (#2418)
* set free tier limits through config * add host limit to config * check for host limit on free tier * fix license validation, replace node limit with hosts * add hosts to telemetry data * debug init * validate license every 1hr * hook manager, api to fetch server usage * hook manager, server usage api * encode json server usage api * update ngork url * update license validation endpoint * avoid setting limits on eer * adding hotfix * correct users limits env var * add comments to exported funcs --------- Co-authored-by: afeiszli <alex.feiszli@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
jwt "github.com/golang-jwt/jwt/v4"
|
||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||
@@ -274,3 +275,18 @@ type StunServer struct {
|
||||
Domain string `json:"domain" yaml:"domain"`
|
||||
Port int `json:"port" yaml:"port"`
|
||||
}
|
||||
|
||||
// HookDetails - struct to hold hook info
|
||||
type HookDetails struct {
|
||||
Hook func() error
|
||||
Interval time.Duration
|
||||
}
|
||||
|
||||
// LicenseLimits - struct license limits
|
||||
type LicenseLimits struct {
|
||||
Servers int `json:"servers"`
|
||||
Users int `json:"users"`
|
||||
Hosts int `json:"hosts"`
|
||||
Clients int `json:"clients"`
|
||||
Networks int `json:"networks"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user