config: Remove erronous yaml entries

This commit is contained in:
Tom Wiesing 2023-03-08 12:25:32 +01:00
parent 7371cc2163
commit 840efd5c03
No known key found for this signature in database
8 changed files with 13 additions and 14 deletions

View file

@ -4,8 +4,8 @@ listen:
ports: null
# The ssh port that is shown to the user in various interfaces.
# This port is not automatically included in the ports to listen to.
advertise_ssh: null
# This port is automatically included in the ports to listen to.
ssh: null
paths:
# A WissKI Distillery needs to store a lot of data on disk.
@ -79,7 +79,6 @@ triplestore:
# The default here is 720hours (== 30 days)
age: null
# Various components use password-based-authentication.
# These passwords are generated automatically.
# This variable can be used to determine their length.

View file

@ -88,7 +88,7 @@ func (legacy *Legacy) Migrate(cfg *config.Config) error {
if legacy.CertbotEmail != "" {
cfg.Listen.Ports = append(cfg.Listen.Ports, 443)
}
cfg.Listen.AdvertisedSSHPort = legacy.PublicSSHPort
cfg.Listen.SSHPort = legacy.PublicSSHPort
cfg.TS.AdminUsername = legacy.TriplestoreAdminUser
cfg.TS.AdminPassword = legacy.TriplestoreAdminPassword
cfg.SQL.AdminUsername = legacy.MysqlAdminUser

View file

@ -12,16 +12,16 @@ type ListenConfig struct {
// This should typically be port 80 and port 443.
Ports []uint16 `yaml:"ports" default:"80" validate:"ports"`
// AdvertisedSSHPort is the port that shows up as the ssh port in various places in the interface.
// SSHPort is the port that shows up as the ssh port in various places in the interface.
// It is automaticalled added to the ports to listen to.
AdvertisedSSHPort uint16 `yaml:"advertise_ssh" default:"80" validate:"port"`
SSHPort uint16 `yaml:"ssh" default:"80" validate:"port"`
}
// ComposePorts returns a list of ports to be used within a docker-compose.yml file.
// These can be used to forward all ports to the internal port.
func (lc ListenConfig) ComposePorts(internal string) []string {
// sort and uniquify ports
ports := append([]uint16{lc.AdvertisedSSHPort}, lc.Ports...)
ports := append([]uint16{lc.SSHPort}, lc.Ports...)
slices.Sort(ports)
ports = slices.Compact(ports)

View file

@ -80,8 +80,8 @@ func (tpl *Template) SetDefaults() (err error) {
func (tpl Template) Generate() Config {
return Config{
Listen: ListenConfig{
Ports: []uint16{80},
AdvertisedSSHPort: 80,
Ports: []uint16{80},
SSHPort: 80,
},
Paths: PathsConfig{
Root: tpl.RootPath,