- add key generation and import for warewulfd - add https port to warewulfd - configuration optiions for port and keys
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package keys
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
|
|
)
|
|
|
|
var (
|
|
baseCmd = &cobra.Command{
|
|
DisableFlagsInUseLine: true,
|
|
Use: "keys [OPTIONS]",
|
|
Short: "Manage and initialize x509 keys",
|
|
Long: "This application allows you to manage the x509 keys for Warewulf\n" +
|
|
"based on the configuration in the warewulf.conf file.",
|
|
RunE: CobraRunE,
|
|
Args: cobra.NoArgs,
|
|
ValidArgsFunction: completions.None,
|
|
}
|
|
importPath string
|
|
exportPath string
|
|
create bool
|
|
force bool
|
|
)
|
|
|
|
func init() {
|
|
baseCmd.PersistentFlags().StringVar(&importPath, "import", "", "Import keys from directory")
|
|
baseCmd.PersistentFlags().StringVar(&exportPath, "export", "", "Export keys to directory")
|
|
baseCmd.PersistentFlags().BoolVar(&create, "create", false, "Create keys if they do not exist")
|
|
baseCmd.PersistentFlags().BoolVarP(&force, "force", "f", false, "Enforce creation of keys even if they exist")
|
|
}
|
|
|
|
// GetCommand returns the root cobra.Command for the application.
|
|
func GetCommand() *cobra.Command {
|
|
return baseCmd
|
|
}
|