mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
lib/model, lib/config: Apply sensible defaults for auto-accepted encrypted folder (fixes #8296) (#8427)
* lib/model: Override scan config for auto-accepted encrypted folders. Encrypted folders should not have the fs watcher enabled and rarely benefit from a scheduled rescan. The GUI adjusts the suggested settings (watcher disabled, one day rescan interval) when accepting a receive-encrypted folder. Mirror that behavior to the auto-accept case where the GUI is not involved. Versioning also does not work well for encrypted folders, same treatment.
This commit is contained in:
parent
2eabc79d4c
commit
a6dba7c6d6
@ -1675,6 +1675,11 @@ func (m *model) handleAutoAccepts(deviceID protocol.DeviceID, folder protocol.Fo
|
||||
|
||||
if len(ccDeviceInfos.remote.EncryptionPasswordToken) > 0 || len(ccDeviceInfos.local.EncryptionPasswordToken) > 0 {
|
||||
fcfg.Type = config.FolderTypeReceiveEncrypted
|
||||
// Override the user-configured defaults, as normally done by the GUI
|
||||
fcfg.FSWatcherEnabled = false
|
||||
fcfg.RescanIntervalS = 3600 * 24
|
||||
fcfg.Versioning.Reset()
|
||||
// Other necessary settings are ensured by FolderConfiguration itself
|
||||
} else {
|
||||
ignores := m.cfg.DefaultIgnores()
|
||||
if err := m.setIgnores(fcfg, ignores.Lines); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user