This commit converts all the uses of wgkey to the new key interfaces.
It now has specific machine, node and discovery keys and we now should
use them correctly.
Please note the new logic which strips a key prefix (in utils.go) that
is now standard inside tailscale.
In theory we could put it in the database, but to preserve backwards
compatibility and not spend a lot of resources on accounting for both,
we just strip them.
This commit is trying to DRY up the initiation of the gRPC client in
each command:
It renames the function to CLI instead of GRPC as it actually set up a
CLI client, not a generic grpc client
It also moves the configuration of address, timeout (which is now
consistent) and api to use Viper, allowing users to set it via env vars
and configuration file
This commit is a first in a series of commits migrating the command
interfaces to use the new gRPC client.
As a part of this commit, they have been streamlined and each command
_should_ be a bit more similar and use consistent output.
By using the new output function, we now make sure its always json
(errors and everything) if the user asks for JSON.
This commit adds a debug command tree, intended to host commands used
for debugging and testing.
It adds a create node/machine command which will be used later to create
machines that can be used to test the registration command.
This commit changes the way CLI and grpc-gateway communicates with the
gRPC backend to socket, instead of localhost. Unauthenticated access now
goes on the socket, while the network interface will require API key (in
the future).