diff --git a/gui/default/assets/lang/lang-en.json b/gui/default/assets/lang/lang-en.json index 6916f8918..e53157ef5 100644 --- a/gui/default/assets/lang/lang-en.json +++ b/gui/default/assets/lang/lang-en.json @@ -22,6 +22,7 @@ "An external command handles the versioning. It has to remove the file from the synced folder.": "An external command handles the versioning. It has to remove the file from the synced folder.", "Anonymous Usage Reporting": "Anonymous Usage Reporting", "Any devices configured on an introducer device will be added to this device as well.": "Any devices configured on an introducer device will be added to this device as well.", + "Automatic upgrade now offers the choice between stable releases and release candidates.": "Automatic upgrade now offers the choice between stable releases and release candidates.", "Automatic upgrades": "Automatic upgrades", "Be careful!": "Be careful!", "Bugs": "Bugs", @@ -104,6 +105,7 @@ "Last seen": "Last seen", "Later": "Later", "Latest Change": "Latest Change", + "Learn more": "Learn more", "Listeners": "Listeners", "Local Discovery": "Local Discovery", "Local State": "Local State", @@ -148,6 +150,7 @@ "Random": "Random", "Reduced by ignore patterns": "Reduced by ignore patterns", "Release Notes": "Release Notes", + "Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases.": "Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases.", "Remote Devices": "Remote Devices", "Remove": "Remove", "Required identifier for the folder. Must be the same on all cluster devices.": "Required identifier for the folder. Must be the same on all cluster devices.", @@ -184,6 +187,7 @@ "Smallest First": "Smallest First", "Source Code": "Source Code", "Stable releases and release candidates": "Stable releases and release candidates", + "Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.": "Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.", "Stable releases only": "Stable releases only", "Staggered File Versioning": "Staggered File Versioning", "Start Browser": "Start Browser", @@ -250,6 +254,8 @@ "When adding a new device, keep in mind that this device must be added on the other side too.": "When adding a new device, keep in mind that this device must be added on the other side too.", "When adding a new folder, keep in mind that the Folder ID is used to tie folders together between devices. They are case sensitive and must match exactly between all devices.": "When adding a new folder, keep in mind that the Folder ID is used to tie folders together between devices. They are case sensitive and must match exactly between all devices.", "Yes": "Yes", + "You can change your choice at any time in the Settings dialog.": "You can change your choice at any time in the Settings dialog.", + "You can read more about the two release channels at the link below.": "You can read more about the two release channels at the link below.", "You must keep at least one version.": "You must keep at least one version.", "days": "days", "directories": "directories", diff --git a/gui/default/syncthing/core/notifications.html b/gui/default/syncthing/core/notifications.html index 68dc45418..7fee92df1 100644 --- a/gui/default/syncthing/core/notifications.html +++ b/gui/default/syncthing/core/notifications.html @@ -14,3 +14,30 @@ --> + + +
+
+

 Automatic upgrades

+
+
+

Automatic upgrade now offers the choice between stable releases and release candidates.

+

+ Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases. + Stable releases are delayed by about two weeks. During this time they go through testing as release candidates. + You can read more about the two release channels at the link below. +

+

You can change your choice at any time in the Settings dialog.

+

 Learn more

+
+ +
+
\ No newline at end of file diff --git a/lib/config/config.go b/lib/config/config.go index fac91683b..722bb37d5 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -21,12 +21,13 @@ import ( "github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/rand" + "github.com/syncthing/syncthing/lib/upgrade" "github.com/syncthing/syncthing/lib/util" ) const ( OldestHandledVersion = 10 - CurrentVersion = 17 + CurrentVersion = 18 MaxRescanIntervalS = 365 * 24 * 60 * 60 ) @@ -257,6 +258,9 @@ func (cfg *Configuration) clean() error { if cfg.Version == 16 { convertV16V17(cfg) } + if cfg.Version == 17 { + convertV17V18(cfg) + } // Build a list of available devices existingDevices := make(map[protocol.DeviceID]bool) @@ -310,6 +314,24 @@ func (cfg *Configuration) clean() error { return nil } +func convertV17V18(cfg *Configuration) { + // Do channel selection for existing users. Those who have auto upgrades + // and usage reporting on default to the candidate channel. Others get + // stable. + if cfg.Options.URAccepted > 0 && cfg.Options.AutoUpgradeIntervalH > 0 { + cfg.Options.UpgradeToPreReleases = true + } + + // Show a notification to explain what's going on, except if upgrades + // are disabled by compilation or environment variable in which case + // it's not relevant. + if !upgrade.DisabledByCompilation && os.Getenv("STNOUPGRADE") == "" { + cfg.Options.UnackedNotificationIDs = append(cfg.Options.UnackedNotificationIDs, "channelNotification") + } + + cfg.Version = 18 +} + func convertV14V15(cfg *Configuration) { // Undo v0.13.0 broken migration diff --git a/lib/config/config_test.go b/lib/config/config_test.go index f286505aa..9c3f56447 100644 --- a/lib/config/config_test.go +++ b/lib/config/config_test.go @@ -200,9 +200,12 @@ func TestOverriddenValues(t *testing.T) { AlwaysLocalNets: []string{}, OverwriteRemoteDevNames: true, TempIndexMinBlocks: 100, - UnackedNotificationIDs: []string{}, + UnackedNotificationIDs: []string{ + "channelNotification", // added in 17->18 migration + }, } + os.Unsetenv("STNOUPGRADE") cfg, err := Load("testdata/overridenvalues.xml", device1) if err != nil { t.Error(err) diff --git a/lib/config/testdata/v18.xml b/lib/config/testdata/v18.xml new file mode 100644 index 000000000..4dc56e66e --- /dev/null +++ b/lib/config/testdata/v18.xml @@ -0,0 +1,15 @@ + + + + + 1 + -1 + true + + +
tcp://a
+
+ +
tcp://b
+
+