diff options
author | Jakob Borg <jakob@nym.se> | 2016-05-13 09:17:10 +0000 |
---|---|---|
committer | Audrius Butkevicius <audrius.butkevicius@gmail.com> | 2016-05-13 09:17:10 +0000 |
commit | e8b4286c93db8c14a0f87981ae15a3a84a306f7f (patch) | |
tree | df39fd9d059b25718de9bae4adecb19565b71b31 | |
parent | 2e9bf0b67c9a830ac55de094b7050c31712b720f (diff) |
lib/config: Change upgrade check URL (fixes #3086)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3089
-rw-r--r-- | lib/config/config.go | 8 | ||||
-rw-r--r-- | lib/config/config_test.go | 2 | ||||
-rw-r--r-- | lib/config/optionsconfiguration.go | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/config/config.go b/lib/config/config.go index b179e92163..10a4f64709 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -291,8 +291,6 @@ func convertV12V13(cfg *Configuration) { } cfg.Options.GlobalAnnServers = newAddrs - cfg.Version = 13 - for i, fcfg := range cfg.Folders { if fcfg.DeprecatedReadOnly { cfg.Folders[i].Type = FolderTypeReadOnly @@ -301,6 +299,12 @@ func convertV12V13(cfg *Configuration) { } cfg.Folders[i].DeprecatedReadOnly = false } + + 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) { diff --git a/lib/config/config_test.go b/lib/config/config_test.go index 1e4c3b9b46..2b4a1fe13d 100644 --- a/lib/config/config_test.go +++ b/lib/config/config_test.go @@ -57,7 +57,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{}, OverwriteRemoteDevNames: false, TempIndexMinBlocks: 10, diff --git a/lib/config/optionsconfiguration.go b/lib/config/optionsconfiguration.go index ebeed6a072..ed7aecec3a 100644 --- a/lib/config/optionsconfiguration.go +++ b/lib/config/optionsconfiguration.go @@ -35,7 +35,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"` OverwriteRemoteDevNames bool `xml:"overwriteRemoteDeviceNamesOnConnect" json:"overwriteRemoteDeviceNamesOnConnect" default:"false"` TempIndexMinBlocks int `xml:"tempIndexMinBlocks" json:"tempIndexMinBlocks" default:"10"` |