renamed to tls instead of keys
This commit is contained in:
committed by
Jonathon Anderson
parent
c4b8595f20
commit
bcf53f7efd
@@ -44,7 +44,7 @@ type WarewulfConf struct {
|
||||
Port int `yaml:"port,omitempty" default:"9873"`
|
||||
SecurePort int `yaml:"secure port,omitempty" default:"9874"`
|
||||
SecureP *bool `yaml:"secure,omitempty" default:"true"`
|
||||
EnableHttpsP *bool `yaml:"enable https,omitempty" default:"false"`
|
||||
EnableTLSP *bool `yaml:"tls,omitempty" default:"false"`
|
||||
UpdateInterval int `yaml:"update interval,omitempty" default:"60"`
|
||||
AutobuildOverlaysP *bool `yaml:"autobuild overlays,omitempty" default:"true"`
|
||||
EnableHostOverlayP *bool `yaml:"host overlay,omitempty" default:"true"`
|
||||
@@ -56,8 +56,8 @@ func (conf WarewulfConf) Secure() bool {
|
||||
return util.BoolP(conf.SecureP)
|
||||
}
|
||||
|
||||
func (conf WarewulfConf) EnableHttps() bool {
|
||||
return util.BoolP(conf.EnableHttpsP)
|
||||
func (conf WarewulfConf) EnableTLS() bool {
|
||||
return util.BoolP(conf.EnableTLSP)
|
||||
}
|
||||
|
||||
func (conf WarewulfConf) AutobuildOverlays() bool {
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestParse(t *testing.T) {
|
||||
result: `
|
||||
warewulf:
|
||||
autobuild overlays: true
|
||||
enable https: false
|
||||
tls: false
|
||||
grubboot: false
|
||||
host overlay: true
|
||||
port: 9873
|
||||
@@ -65,7 +65,7 @@ network: 192.168.0.0
|
||||
netmask: 255.255.255.0
|
||||
warewulf:
|
||||
autobuild overlays: true
|
||||
enable https: false
|
||||
tls: false
|
||||
grubboot: false
|
||||
host overlay: true
|
||||
port: 9873
|
||||
@@ -115,7 +115,7 @@ network: 192.168.0.0
|
||||
netmask: 255.255.0.0
|
||||
warewulf:
|
||||
autobuild overlays: true
|
||||
enable https: false
|
||||
tls: false
|
||||
grubboot: false
|
||||
host overlay: true
|
||||
port: 9873
|
||||
@@ -162,7 +162,7 @@ ipaddr6: "2001:db8::1"
|
||||
prefixlen6: "64"
|
||||
warewulf:
|
||||
autobuild overlays: true
|
||||
enable https: false
|
||||
tls: false
|
||||
grubboot: false
|
||||
host overlay: true
|
||||
port: 9873
|
||||
@@ -238,7 +238,7 @@ netmask: 255.255.255.0
|
||||
network: 192.168.200.0
|
||||
warewulf:
|
||||
autobuild overlays: true
|
||||
enable https: false
|
||||
tls: false
|
||||
grubboot: false
|
||||
host overlay: true
|
||||
port: 9873
|
||||
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
GenKeys checks for existence of x509 keys and creates them if they don't exist.
|
||||
GenTLSKeys checks for existence of x509 keys and creates them if they don't exist.
|
||||
*/
|
||||
func GenKeys() error {
|
||||
func GenTLSKeys() error {
|
||||
conf := warewulfconf.Get()
|
||||
keystore := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys")
|
||||
|
||||
@@ -248,7 +248,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) {
|
||||
Ipaddr: conf.Ipaddr,
|
||||
Ipaddr6: ipaddr6,
|
||||
Port: strconv.Itoa(conf.Warewulf.Port),
|
||||
Https: conf.Warewulf.EnableHttps(),
|
||||
Https: conf.Warewulf.EnableTLS(),
|
||||
Authority: authority,
|
||||
Hostname: remoteNode.Id(),
|
||||
Hwaddr: rinfo.hwaddr,
|
||||
|
||||
@@ -86,14 +86,14 @@ func RunServer() error {
|
||||
apiHandler = api.Handler(auth, conf.API.AllowedIPNets())
|
||||
}
|
||||
|
||||
httpHandler := configureHandler(!conf.Warewulf.EnableHttps(), apiHandler)
|
||||
httpHandler := configureHandler(!conf.Warewulf.EnableTLS(), apiHandler)
|
||||
|
||||
if conf.Warewulf.EnableHttps() {
|
||||
if conf.Warewulf.EnableTLS() {
|
||||
key := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys", "warewulf.key")
|
||||
crt := path.Join(conf.Paths.Sysconfdir, "warewulf", "keys", "warewulf.crt")
|
||||
|
||||
if !util.IsFile(key) || !util.IsFile(crt) {
|
||||
wwlog.Error("HTTPS 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", "keys"))
|
||||
} else {
|
||||
httpsHandler := configureHandler(true, apiHandler)
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user