summaryrefslogtreecommitdiff
path: root/internal/server/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 1182f15..2148f85 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -178,7 +178,15 @@ func (s *Server) SetProfileID(id string) error {
if err != nil {
return err
}
+ oldP := cs.Profiles.Current
cs.Profiles.Current = id
+
+ if s.t == srvtypes.TypeSecureInternet {
+ if cs.LocationProfiles == nil {
+ cs.LocationProfiles = make(map[string]string)
+ }
+ cs.LocationProfiles[cs.CountryCode] = oldP
+ }
return nil
}
@@ -211,19 +219,6 @@ func (s *Server) ProfileID() (string, error) {
return cs.Profiles.Current, nil
}
-// SetLocation sets the secure internet location for the server
-func (s *Server) SetLocation(loc string) error {
- if s.t != srvtypes.TypeSecureInternet {
- return errors.New("changing secure internet location is only possible when the server is a secure location")
- }
- cs, err := s.cfgServer()
- if err != nil {
- return err
- }
- cs.CountryCode = loc
- return nil
-}
-
// SetCurrent sets the current server in the state file to this one
func (s *Server) SetCurrent() error {
if s.storage == nil {