diff --git a/lib/config/config.go b/lib/config/config.go index 6d0920c17..5cb20c59e 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -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 { diff --git a/lib/config/config_test.go b/lib/config/config_test.go index 008402d26..e87b5dab9 100644 --- a/lib/config/config_test.go +++ b/lib/config/config_test.go @@ -59,7 +59,7 @@ func TestDefaultValues(t *testing.T) { URURL: "https://data.syncthing.net/newdata", URInitialDelayS: 1800, URPostInsecurely: false, - ReleasesURL: "https://api.github.com/repos/syncthing/syncthing/releases?per_page=30", + ReleasesURL: "https://upgrades.syncthing.net/meta.json", AlwaysLocalNets: []string{}, } diff --git a/lib/config/optionsconfiguration.go b/lib/config/optionsconfiguration.go index cb469b389..cb78d9dfa 100644 --- a/lib/config/optionsconfiguration.go +++ b/lib/config/optionsconfiguration.go @@ -37,7 +37,7 @@ type OptionsConfiguration struct { SymlinksEnabled bool `xml:"symlinksEnabled" json:"symlinksEnabled" default:"true"` LimitBandwidthInLan bool `xml:"limitBandwidthInLan" json:"limitBandwidthInLan" default:"false"` MinHomeDiskFreePct float64 `xml:"minHomeDiskFreePct" json:"minHomeDiskFreePct" default:"1"` - ReleasesURL string `xml:"releasesURL" json:"releasesURL" default:"https://api.github.com/repos/syncthing/syncthing/releases?per_page=30"` + ReleasesURL string `xml:"releasesURL" json:"releasesURL" default:"https://upgrades.syncthing.net/meta.json"` AlwaysLocalNets []string `xml:"alwaysLocalNet" json:"alwaysLocalNets"` } diff --git a/lib/config/testdata/v13.xml b/lib/config/testdata/v13.xml new file mode 100644 index 000000000..1fec6e1bd --- /dev/null +++ b/lib/config/testdata/v13.xml @@ -0,0 +1,14 @@ + + + + + 1 + -1 + + +
tcp://a
+
+ +
tcp://b
+
+
diff --git a/lib/upgrade/upgrade_supported.go b/lib/upgrade/upgrade_supported.go index 1c948cdce..c7afd6a2f 100644 --- a/lib/upgrade/upgrade_supported.go +++ b/lib/upgrade/upgrade_supported.go @@ -39,7 +39,7 @@ const ( maxBinarySize = 64 << 20 // 64 MiB // The max expected size of the signature file. - maxSignatureSize = 1 << 10 // 1 KiB + maxSignatureSize = 10 << 10 // 10 KiB // We set the same limit on the archive. The binary will compress and we // include som other stuff - currently the release archive size is @@ -55,7 +55,7 @@ const ( readTimeout = 30 * time.Minute // The limit on the size of metadata that we accept. - maxMetadataSize = 100 << 10 // 100 KiB + maxMetadataSize = 10 << 20 // 10 MiB ) // This is an HTTP/HTTPS client that does *not* perform certificate