Move TLS files from keys/ to tls/

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-02-17 13:50:55 -07:00
parent 226d81647b
commit 673d7627b5
8 changed files with 11 additions and 11 deletions

View File

@@ -118,7 +118,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
tlsConfig := &tls.Config{}
if conf.Warewulf.EnableTLS() {
caCert, err := os.ReadFile("/warewulf/keys/warewulf.crt")
caCert, err := os.ReadFile("/warewulf/tls/warewulf.crt")
if err != nil {
wwlog.Error("failed to read ca cert: %s", err)
return err

View File

@@ -23,7 +23,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if allFunctions {
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys")
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls")
keyFile := path.Join(keystore, "warewulf.key")
certFile := path.Join(keystore, "warewulf.crt")

View File

@@ -17,7 +17,7 @@ import (
func CobraRunE(cmd *cobra.Command, args []string) error {
conf := config.Get()
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys")
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls")
if err := os.MkdirAll(keystore, 0755); err != nil {
return fmt.Errorf("could not create keystore directory: %w", err)

View File

@@ -15,7 +15,7 @@ func Test_Keys(t *testing.T) {
defer env.RemoveAll()
// Define a keystore path within the test environment
keystoreRelPath := "etc/warewulf/keys"
keystoreRelPath := "etc/warewulf/tls"
keystorePath := env.GetPath(keystoreRelPath)
// Reload configuration to pick up the change

View File

@@ -22,7 +22,7 @@ GenTLSKeys checks for existence of x509 keys and creates them if they don't exis
*/
func GenTLSKeys() error {
conf := warewulfconf.Get()
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys")
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls")
keyFile := path.Join(keystore, "warewulf.key")
certFile := path.Join(keystore, "warewulf.crt")

View File

@@ -89,11 +89,11 @@ func RunServer() error {
httpHandler := configureHandler(!conf.Warewulf.EnableTLS(), apiHandler)
if conf.Warewulf.EnableTLS() {
key := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys", "warewulf.key")
crt := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys", "warewulf.crt")
key := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls", "warewulf.key")
crt := path.Join(conf.Paths.Sysconfdir, "warewulf", "tls", "warewulf.crt")
if !util.IsFile(key) || !util.IsFile(crt) {
wwlog.Error("TLS enabled but keys not found in %s", path.Join(conf.Paths.Sysconfdir, "warewulf", "keys"))
wwlog.Error("TLS enabled but keys not found in %s", path.Join(conf.Paths.Sysconfdir, "warewulf", "tls"))
} else {
httpsHandler := configureHandler(true, apiHandler)
go func() {