enable https and key handling

- add key generation and import for warewulfd
- add https port to warewulfd
- configuration optiions for port and

keys
This commit is contained in:
Christian Goll
2025-12-01 16:15:16 +01:00
committed by Jonathon Anderson
parent 856223dadd
commit a1c11db8cc
10 changed files with 429 additions and 0 deletions

View File

@@ -1,11 +1,14 @@
package configure
import (
"fmt"
"os"
"path"
"github.com/spf13/cobra"
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/configure"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
@@ -20,6 +23,19 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if allFunctions {
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys")
keyFile := path.Join(keystore, "warewulf.key")
certFile := path.Join(keystore, "warewulf.crt")
if !util.IsFile(keyFile) || !util.IsFile(certFile) {
err = configure.GenKeys()
if err != nil {
return err
}
} else {
fmt.Printf("Keys already exist in %s\n", keystore)
}
err = configure.WAREWULFD()
if err != nil {
return err