mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
feat: add command to generate a server key
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
func Command() *coral.Command {
|
||||
rootCmd := rootCommand()
|
||||
rootCmd.AddCommand(keyCommand())
|
||||
rootCmd.AddCommand(serverCommand())
|
||||
rootCmd.AddCommand(versionCommand())
|
||||
rootCmd.AddCommand(tailnetCommand())
|
||||
|
||||
Reference in New Issue
Block a user