gui, lib/config: Add notification about new release channels

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3945
This commit is contained in:
Jakob Borg
2017-02-04 09:45:17 +00:00
parent ac510b26e2
commit 3eb7a9373a
5 changed files with 75 additions and 2 deletions

View File

@@ -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