cmd/tailscale/cli: add a debug command to print the statedir
Example: ```console $ tailscale debug statedir /tmp/ts/node1 ``` Updates #18019 Change-Id: I7c93c94179bd7b56d0fa8fe57a9129df05c2c1df Signed-off-by: Alex Chan <alexc@tailscale.com>
This commit is contained in:
@@ -234,6 +234,13 @@ func (h *Handler) serveDebug(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
case "rotate-disco-key":
|
||||
err = h.b.DebugRotateDiscoKey()
|
||||
case "statedir":
|
||||
root := h.b.TailscaleVarRoot()
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
err = json.NewEncoder(w).Encode(root)
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
case "":
|
||||
err = fmt.Errorf("missing parameter 'action'")
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user