client/web: remove DebugMode from GET /api/data

No longer using this! Readonly state fully managed via auth endpoint.
Also getting rid of old Legacy server mode.

A #cleanup

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
Sonia Appasamy
2023-11-15 16:50:03 -05:00
committed by Sonia Appasamy
parent 6f7a1b51a8
commit 2dbd546766
4 changed files with 3 additions and 20 deletions

View File

@@ -28,8 +28,6 @@ export type NodeData = {
IsTagged: boolean
Tags: string[]
RunningSSHServer: boolean
DebugMode: "" | "login" | "full" // empty when not running in any debug mode
}
type NodeState =

View File

@@ -92,10 +92,6 @@ const (
// the source's Tailscale identity. If the source browser does not have
// a valid session, a readonly version of the app is displayed.
ManageServerMode ServerMode = "manage"
// LegacyServerMode serves the legacy web client, visible to users
// prior to release of tailscale/corp#14335.
LegacyServerMode ServerMode = "legacy"
)
var (
@@ -133,7 +129,7 @@ type ServerOpts struct {
// and not the lifespan of the web server.
func NewServer(opts ServerOpts) (s *Server, err error) {
switch opts.Mode {
case LoginServerMode, ManageServerMode, LegacyServerMode:
case LoginServerMode, ManageServerMode:
// valid types
case "":
return nil, fmt.Errorf("must specify a Mode")
@@ -544,8 +540,6 @@ type nodeData struct {
ClientVersion *tailcfg.ClientVersion
LicensesURL string
DebugMode string // empty when not running in any debug mode
}
func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
@@ -559,12 +553,6 @@ func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
var debugMode string
if s.mode == ManageServerMode {
debugMode = "full"
} else if s.mode == LoginServerMode {
debugMode = "login"
}
data := &nodeData{
ID: st.Self.ID,
Status: st.BackendState,
@@ -582,7 +570,6 @@ func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
RunningSSHServer: prefs.RunSSH,
URLPrefix: strings.TrimSuffix(s.pathPrefix, "/"),
LicensesURL: licenses.LicensesURL(),
DebugMode: debugMode, // TODO(sonia,will): just pass back s.mode directly?
}
cv, err := s.lc.CheckUpdate(r.Context())
if err != nil {