lib/config: Update size constraints and URL (ref #3086)

This commit is contained in:
Jakob Borg
2016-05-13 14:02:47 +02:00
parent 62142c8ccd
commit b4f941784f
5 changed files with 30 additions and 5 deletions
+12 -1
View File
@@ -24,7 +24,7 @@ import (
const (
OldestHandledVersion = 10
CurrentVersion = 12
CurrentVersion = 13
MaxRescanIntervalS = 365 * 24 * 60 * 60
)
@@ -185,6 +185,9 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
if cfg.Version == 11 {
convertV11V12(cfg)
}
if cfg.Version == 12 {
convertV12V13(cfg)
}
// Build a list of available devices
existingDevices := make(map[protocol.DeviceID]bool)
@@ -234,6 +237,14 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
}
}
func convertV12V13(cfg *Configuration) {
if cfg.Options.ReleasesURL == "https://api.github.com/repos/syncthing/syncthing/releases?per_page=30" {
cfg.Options.ReleasesURL = "https://upgrades.syncthing.net/meta.json"
}
cfg.Version = 13
}
func convertV11V12(cfg *Configuration) {
// Change listen address schema
for i, addr := range cfg.Options.ListenAddress {