Files
warewulf/internal/pkg/config/buildconfig.go.in
Jonathon Anderson cec95b14f0 Update default warewulfd port to match initial configuration
We've been shipping a warewulf.conf that defines the warewulfd port as
9873, and a firewalld service that uses this port as well; but the
default value in the YAML data-structure has been 9983.

This changes the default port to 9873 to match the configuration we've
been shipping, and removes the port from the initial configuration file
(to use the default value).

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-06 19:07:05 -07:00

58 lines
2.0 KiB
Go

package config
import (
"path"
)
var ConfigFile = "@SYSCONFDIR@/warewulf/warewulf.conf"
type BuildConfig struct {
Bindir string `default:"@BINDIR@"`
Sysconfdir string `default:"@SYSCONFDIR@"`
Localstatedir string `default:"@LOCALSTATEDIR@"`
Cachedir string `default:"@CACHEDIR@"`
Ipxesource string `default:"@IPXESOURCE@"`
Srvdir string `default:"@SRVDIR@"`
Firewallddir string `default:"@FIREWALLDDIR@"`
Systemddir string `default:"@SYSTEMDDIR@"`
WWOverlaydir string `default:"@WWOVERLAYDIR@"`
WWChrootdir string `default:"@WWCHROOTDIR@"`
WWProvisiondir string `default:"@WWPROVISIONDIR@"`
WWClientdir string `default:"@WWCLIENTDIR@"`
}
const Version = "@VERSION@"
const Release = "@RELEASE@"
// must be set .in file so that its available for tests
const Confversion = "45"
type TFTPConf struct {
Enabled bool `yaml:"enabled" default:"true"`
TftpRoot string `yaml:"tftproot" default:"@TFTPDIR@"`
SystemdName string `yaml:"systemd name" default:"tftp"`
IpxeBinaries map[string]string `yaml:"ipxe" default:"{\"00:09\": \"ipxe-snponly-x86_64.efi\",\"00:00\": \"undionly.kpxe\",\"00:0B\": \"arm64-efi/snponly.efi\",\"00:07\": \"ipxe-snponly-x86_64.efi\"}"`
}
// WarewulfConf adds additional Warewulf-specific configuration to
// BaseConf.
type WarewulfConf struct {
Port int `yaml:"port" default:"9873"`
Secure bool `yaml:"secure" default:"true"`
UpdateInterval int `yaml:"update interval" default:"60"`
AutobuildOverlays bool `yaml:"autobuild overlays" default:"true"`
EnableHostOverlay bool `yaml:"host overlay" default:"true"`
Syslog bool `yaml:"syslog" default:"false"`
DataStore string `yaml:"datastore" default:"@DATADIR@"`
GrubBoot bool `yaml:"grubboot" default:"false"`
}
func (paths BuildConfig) OciBlobCachedir() string {
return path.Join(paths.Cachedir, "warewulf")
}
func (paths BuildConfig) OverlayProvisiondir() string {
return path.Join(paths.WWProvisiondir, "overlays")
}