Skip to content

Commit

Permalink
feat: add command to generate a server key
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiebens committed May 17, 2022
1 parent a804aea commit 0a9aab7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions internal/cmd/key.go
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

func Command() *coral.Command {
rootCmd := rootCommand()
rootCmd.AddCommand(keyCommand())
rootCmd.AddCommand(serverCommand())
rootCmd.AddCommand(versionCommand())
rootCmd.AddCommand(tailnetCommand())
Expand Down

0 comments on commit 0a9aab7

Please sign in to comment.