feat: make TLS optional in Barkfile schema
This commit is contained in:
@@ -21,11 +21,10 @@ func (c Config) Validate() error {
|
||||
} else if err := validateListenAddress(c.Listen); err != nil {
|
||||
errs = append(errs, fmt.Errorf("listen address %q: %w", c.Listen, err))
|
||||
}
|
||||
if strings.TrimSpace(c.TLS.CertFile) == "" {
|
||||
errs = append(errs, errors.New("TLS certificate is required"))
|
||||
}
|
||||
if strings.TrimSpace(c.TLS.KeyFile) == "" {
|
||||
errs = append(errs, errors.New("TLS private key is required"))
|
||||
certificateSet := strings.TrimSpace(c.TLS.CertFile) != ""
|
||||
keySet := strings.TrimSpace(c.TLS.KeyFile) != ""
|
||||
if certificateSet != keySet {
|
||||
errs = append(errs, errors.New("tls requires both cert and key"))
|
||||
}
|
||||
if len(c.Databases) == 0 {
|
||||
errs = append(errs, errors.New("at least one database route is required"))
|
||||
|
||||
Reference in New Issue
Block a user