mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
[management] Add support to disable geolocation service (#4901)
This commit is contained in:
@@ -2,6 +2,7 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
@@ -21,7 +22,16 @@ import (
|
||||
"github.com/netbirdio/netbird/management/server/users"
|
||||
)
|
||||
|
||||
const (
|
||||
geolocationDisabledKey = "NB_DISABLE_GEOLOCATION"
|
||||
)
|
||||
|
||||
func (s *BaseServer) GeoLocationManager() geolocation.Geolocation {
|
||||
if os.Getenv(geolocationDisabledKey) == "true" {
|
||||
log.Info("geolocation service is disabled, skipping initialization")
|
||||
return nil
|
||||
}
|
||||
|
||||
return Create(s, func() geolocation.Geolocation {
|
||||
geo, err := geolocation.NewGeolocation(context.Background(), s.Config.Datadir, !s.disableGeoliteUpdate)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user