Browse Source

lib/model: Verify versioning on configuration reload (fixes #9106) (#9154)

Jakob Borg 2 years ago
parent
commit
a64ae36bcc
1 changed files with 10 additions and 0 deletions
  1. 10 0
      lib/model/model.go

+ 10 - 0
lib/model/model.go

@@ -2976,6 +2976,16 @@ func (*model) VerifyConfiguration(from, to config.Configuration) error {
 			return errors.New("folder type must not be changed from/to receive-encrypted")
 		}
 	}
+
+	// Verify that any requested versioning is possible to construct, or we
+	// will panic later when starting the folder.
+	for _, to := range to.Folders {
+		if to.Versioning.Type != "" {
+			if _, err := versioner.New(to); err != nil {
+				return err
+			}
+		}
+	}
 	return nil
 }