chore(protocol): minor cleanup of ClusterConfig messages; remove DisableTempIndexes option (#10202)
This makes a couple of backwards compatible changes to the ClusterConfig: - Remove the `ignore_permissions` and `ignore_delete` booleans which we've never read or used for anything - Remove the `disable_temp_indexes` boolean and option entirely. We did use this one, and about 1% of users have set the option. The only thing it does is inhibits sending of periodical DownloadProgress messages while downloading data, which is a minuscule bandwidth optimisation given that we're already sending data at the time. - Change the `read_only` boolean (which indicated send-only folders) to an enum `FolderType`, where the values zero and one match the existing usage. Again, we don't actually use this value, but I can see that we might want to and then it makes more sense for it to be more comprehensive. - Change the `paused` boolean to an enum `StopReason`, where zero indicates not stopped and one indicates paused, exactly the same wire representation as previously but leaves space for additional stop reasons (errors etc).
This commit is contained in:
@@ -1453,11 +1453,10 @@ func TestReceiveEncryptedFolderFixed(t *testing.T) {
|
||||
cfg := Configuration{
|
||||
Folders: []FolderConfiguration{
|
||||
{
|
||||
ID: "foo",
|
||||
Path: "testdata",
|
||||
Type: FolderTypeReceiveEncrypted,
|
||||
DisableTempIndexes: false,
|
||||
IgnorePerms: false,
|
||||
ID: "foo",
|
||||
Path: "testdata",
|
||||
Type: FolderTypeReceiveEncrypted,
|
||||
IgnorePerms: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1468,9 +1467,6 @@ func TestReceiveEncryptedFolderFixed(t *testing.T) {
|
||||
t.Fatal("Expected one folder")
|
||||
}
|
||||
f := cfg.Folders[0]
|
||||
if !f.DisableTempIndexes {
|
||||
t.Error("DisableTempIndexes should be true")
|
||||
}
|
||||
if !f.IgnorePerms {
|
||||
t.Error("IgnorePerms should be true")
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ type FolderConfiguration struct {
|
||||
PullerDelayS float64 `json:"pullerDelayS" xml:"pullerDelayS" default:"1"`
|
||||
MaxConflicts int `json:"maxConflicts" xml:"maxConflicts" default:"10"`
|
||||
DisableSparseFiles bool `json:"disableSparseFiles" xml:"disableSparseFiles"`
|
||||
DisableTempIndexes bool `json:"disableTempIndexes" xml:"disableTempIndexes"`
|
||||
Paused bool `json:"paused" xml:"paused"`
|
||||
MarkerName string `json:"markerName" xml:"markerName"`
|
||||
CopyOwnershipFromParent bool `json:"copyOwnershipFromParent" xml:"copyOwnershipFromParent"`
|
||||
@@ -322,7 +321,6 @@ func (f *FolderConfiguration) prepare(myID protocol.DeviceID, existingDevices ma
|
||||
}
|
||||
|
||||
if f.Type == FolderTypeReceiveEncrypted {
|
||||
f.DisableTempIndexes = true
|
||||
f.IgnorePerms = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
|
||||
package config
|
||||
|
||||
type FolderType int32
|
||||
import "github.com/syncthing/syncthing/lib/protocol"
|
||||
|
||||
type FolderType protocol.FolderType
|
||||
|
||||
const (
|
||||
FolderTypeSendReceive FolderType = 0
|
||||
FolderTypeSendOnly FolderType = 1
|
||||
FolderTypeReceiveOnly FolderType = 2
|
||||
FolderTypeReceiveEncrypted FolderType = 3
|
||||
FolderTypeSendReceive = FolderType(protocol.FolderTypeSendReceive)
|
||||
FolderTypeSendOnly = FolderType(protocol.FolderTypeSendOnly)
|
||||
FolderTypeReceiveOnly = FolderType(protocol.FolderTypeReceiveOnly)
|
||||
FolderTypeReceiveEncrypted = FolderType(protocol.FolderTypeReceiveEncrypted)
|
||||
)
|
||||
|
||||
func (t FolderType) String() string {
|
||||
|
||||
Reference in New Issue
Block a user