tsnet: add Server.AdvertiseTags option (#15840)
Updates #8531 Change-Id: I9b6653872c66929e692bd592ef3f438430c657b5 Signed-off-by: Valentin Alekseev <valentin.alekseev@gmail.com> Co-authored-by: Valentin Alekseev <valentin.alekseev@gmail.com>
This commit is contained in:
@@ -124,6 +124,13 @@ type Server struct {
|
|||||||
// field at zero unless you know what you are doing.
|
// field at zero unless you know what you are doing.
|
||||||
Port uint16
|
Port uint16
|
||||||
|
|
||||||
|
// AdvertiseTags specifies groups that this embedded server wants to join, for
|
||||||
|
// purposes of ACL enforcement. These can be referenced from the ACL
|
||||||
|
// security policy. Note that advertising a tag doesn't guarantee that
|
||||||
|
// the control server will allow you to take on the rights for that
|
||||||
|
// tag.
|
||||||
|
AdvertiseTags []string
|
||||||
|
|
||||||
getCertForTesting func(*tls.ClientHelloInfo) (*tls.Certificate, error)
|
getCertForTesting func(*tls.ClientHelloInfo) (*tls.Certificate, error)
|
||||||
|
|
||||||
initOnce sync.Once
|
initOnce sync.Once
|
||||||
@@ -662,6 +669,7 @@ func (s *Server) start() (reterr error) {
|
|||||||
prefs.WantRunning = true
|
prefs.WantRunning = true
|
||||||
prefs.ControlURL = s.ControlURL
|
prefs.ControlURL = s.ControlURL
|
||||||
prefs.RunWebClient = s.RunWebClient
|
prefs.RunWebClient = s.RunWebClient
|
||||||
|
prefs.AdvertiseTags = s.AdvertiseTags
|
||||||
authKey := s.getAuthKey()
|
authKey := s.getAuthKey()
|
||||||
err = lb.Start(ipn.Options{
|
err = lb.Start(ipn.Options{
|
||||||
UpdatePrefs: prefs,
|
UpdatePrefs: prefs,
|
||||||
|
|||||||
Reference in New Issue
Block a user