mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
ipn/ipnlocal: start implementing web server bits of serve
Updates tailscale/corp#7515 Change-Id: I96f4016161ba3c370492da941274c6d9a234c2bb Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
c35dcd427f
commit
25e26c16ee
@@ -564,7 +564,8 @@ var devStoreSetArgs struct {
|
||||
func runDevStoreSet(ctx context.Context, args []string) error {
|
||||
// TODO(bradfitz): remove this temporary (2022-11-09) hack once
|
||||
// profile stuff and serving CLI commands are more fleshed out.
|
||||
if len(args) >= 1 && strings.HasPrefix(args[0], "_serve/") {
|
||||
isServe := len(args) >= 1 && strings.HasPrefix(args[0], "_serve/")
|
||||
if isServe {
|
||||
st, err := localClient.StatusWithoutPeers(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -584,6 +585,11 @@ func runDevStoreSet(ctx context.Context, args []string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if isServe {
|
||||
if err := json.Unmarshal(valb, new(ipn.ServeConfig)); err != nil {
|
||||
return fmt.Errorf("invalid JSON: %w", err)
|
||||
}
|
||||
}
|
||||
val = string(valb)
|
||||
}
|
||||
return localClient.SetDevStoreKeyValue(ctx, key, val)
|
||||
|
Reference in New Issue
Block a user