Skip to content

Commit

Permalink
lib/model, lib/config: Apply sensible defaults for auto-accepted encr…
Browse files Browse the repository at this point in the history
…ypted 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.
  • Loading branch information
acolomb committed Jul 22, 2022
1 parent 2eabc79 commit a6dba7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a6dba7c

Please sign in to comment.