Compare commits

...
10 changed files with 30 additions and 13 deletions
+2
View File
@@ -961,6 +961,8 @@ func defaultConfig(myName string) config.Configuration {
RescanIntervalS: 60,
MinDiskFreePct: 1,
Devices: []config.FolderDeviceConfiguration{{DeviceID: myID}},
AutoNormalize: true,
MaxConflicts: -1,
},
}
newCfg.Devices = []config.DeviceConfiguration{
+1 -1
View File
@@ -469,7 +469,7 @@
<th><span class="fa fa-fw fa-thumbs-o-up"></span>&nbsp;<span translate>Introducer</span></th>
<td translate class="text-right">Yes</td>
</tr>
<tr ng-if="connections[deviceCfg.deviceID].version">
<tr ng-if="connections[deviceCfg.deviceID].clientVersion">
<th><span class="fa fa-fw fa-tag"></span>&nbsp;<span translate>Version</span></th>
<td class="text-right">{{connections[deviceCfg.deviceID].clientVersion}}</td>
</tr>
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -425,7 +425,10 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
// This way in the tests, we get away without OS specific separators
// in the test configs.
folder.RawPath = filepath.Dir(folder.RawPath + string(filepath.Separator))
if folder.RawPath[len(folder.RawPath)-1] != filepath.Separator {
// If we're not on Windows, we want the path to end with a slash to
// penetrate symlinks. On Windows, paths must not end with a slash.
if runtime.GOOS != "windows" && folder.RawPath[len(folder.RawPath)-1] != filepath.Separator {
folder.RawPath = folder.RawPath + string(filepath.Separator)
}
+6 -1
View File
@@ -91,7 +91,7 @@ func TestDeviceConfig(t *testing.T) {
expectedFolders := []FolderConfiguration{
{
ID: "test",
RawPath: "testdata" + string(filepath.Separator),
RawPath: "testdata",
Devices: []FolderDeviceConfiguration{{DeviceID: device1}, {DeviceID: device4}},
ReadOnly: true,
RescanIntervalS: 600,
@@ -103,6 +103,11 @@ func TestDeviceConfig(t *testing.T) {
MaxConflicts: -1,
},
}
if runtime.GOOS != "windows" {
expectedFolders[0].RawPath += string(filepath.Separator)
}
expectedDevices := []DeviceConfiguration{
{
DeviceID: device1,
+10 -4
View File
@@ -107,19 +107,25 @@ func (l *logger) callHandlers(level LogLevel, s string) {
// Debugln logs a line with a DEBUG prefix.
func (l *logger) Debugln(vals ...interface{}) {
l.debugln(3, vals)
}
func (l *logger) debugln(level int, vals ...interface{}) {
l.mut.Lock()
defer l.mut.Unlock()
s := fmt.Sprintln(vals...)
l.logger.Output(2, "DEBUG: "+s)
l.logger.Output(level, "DEBUG: "+s)
l.callHandlers(LevelDebug, s)
}
// Debugf logs a formatted line with a DEBUG prefix.
func (l *logger) Debugf(format string, vals ...interface{}) {
l.debugf(3, format, vals...)
}
func (l *logger) debugf(level int, format string, vals ...interface{}) {
l.mut.Lock()
defer l.mut.Unlock()
s := fmt.Sprintf(format, vals...)
l.logger.Output(2, "DEBUG: "+s)
l.logger.Output(level, "DEBUG: "+s)
l.callHandlers(LevelDebug, s)
}
@@ -293,7 +299,7 @@ func (l *facilityLogger) Debugln(vals ...interface{}) {
if !l.ShouldDebug(l.facility) {
return
}
l.logger.Debugln(vals...)
l.logger.debugln(3, vals...)
}
// Debugf logs a formatted line with a DEBUG prefix.
@@ -301,7 +307,7 @@ func (l *facilityLogger) Debugf(format string, vals ...interface{}) {
if !l.ShouldDebug(l.facility) {
return
}
l.logger.Debugf(format, vals...)
l.logger.debugf(3, format, vals...)
}
// A Recorder keeps a size limited record of log events.
+1 -1
View File
@@ -602,7 +602,7 @@ func (m *Model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
events.Default.Log(events.DeviceConnected, event)
l.Infof(`Device %s client is "%s %s named %s"`, deviceID, cm.ClientName, cm.ClientVersion, cm.DeviceName)
l.Infof(`Device %s client is "%s %s" named "%s"`, deviceID, cm.ClientName, cm.ClientVersion, cm.DeviceName)
var changed bool
+2 -1
View File
@@ -170,12 +170,13 @@ func (s *Svc) RelayStatus(uri string) (time.Duration, bool) {
}
s.mut.RLock()
defer s.mut.RUnlock()
for _, client := range s.clients {
if client.URI().String() == uri {
return client.Latency(), client.StatusOK()
}
}
s.mut.RUnlock()
return time.Hour, false
}
+1 -1
View File
@@ -89,7 +89,7 @@ func SelectLatestRelease(version string, rels []Release) (Release, error) {
sort.Sort(SortByRelease(rels))
// Check for a beta build
beta := strings.Contains(version, "-beta")
beta := strings.Contains(version, "-")
for _, rel := range rels {
if rel.Prerelease && !beta {
+1 -1
View File
@@ -62,7 +62,7 @@ var upgrades = map[string]string{
"v0.10.21": "v0.10.30",
"v0.10.29": "v0.10.30",
"v0.10.31": "v0.10.30",
"v0.10.0-alpha": "v0.10.30",
"v0.10.0-alpha": "v0.11.0-beta0",
"v0.10.0-beta": "v0.11.0-beta0",
"v0.11.0-beta0+40-g53cb66e-dirty": "v0.11.0-beta0",
}