feat: add command to generate a server key

This commit is contained in:
Johan Siebens
2022-05-17 22:46:35 +02:00
parent a804aea79b
commit 0a9aab79e0
2 changed files with 27 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package cmd
import (
"fmt"
"github.com/jsiebens/ionscale/internal/key"
"github.com/muesli/coral"
)
func keyCommand() *coral.Command {
command := &coral.Command{
Use: "genkey",
SilenceUsage: true,
}
command.RunE = func(command *coral.Command, args []string) error {
serverKey := key.NewServerKey()
fmt.Println()
fmt.Printf(" %s\n", serverKey.String())
fmt.Println()
return nil
}
return command
}
+1
View File
@@ -6,6 +6,7 @@ import (
func Command() *coral.Command {
rootCmd := rootCommand()
rootCmd.AddCommand(keyCommand())
rootCmd.AddCommand(serverCommand())
rootCmd.AddCommand(versionCommand())
rootCmd.AddCommand(tailnetCommand())