Simplify and clarify configuration

- changed "secure port" to "tls port"
- removed the --create flag for "wwctl configure tls"; made it the default behavior
- fixed a TLS creation bug in "wwctl configure --all"
- added logging to "wwctl configure tls" and "wwctl configure --all" (for the tls case)

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-03-04 08:18:07 -07:00
parent 6ce3d33f50
commit a886b4958b
13 changed files with 65 additions and 55 deletions

View File

@@ -1,14 +1,11 @@
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"
)
@@ -23,17 +20,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if allFunctions {
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls")
keyFile := path.Join(keystore, "warewulf.key")
certFile := path.Join(keystore, "warewulf.crt")
if !util.IsFile(keyFile) || !util.IsFile(certFile) {
err = configure.GenTLSKeys()
if err != nil {
return err
}
} else {
fmt.Printf("Keys already exist in %s\n", keystore)
if _, err = configure.TLS(false); err != nil {
return err
}
err = configure.WAREWULFD()