Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/model, lib/config: Apply sensible defaults for auto-accepted encrypted folder (fixes #8296) #8427

Merged
merged 3 commits into from Jul 22, 2022

Conversation

acolomb
Copy link
Member

@acolomb acolomb commented Jul 11, 2022

Purpose

Encrypted folders should not have the fs watcher enabled and rarely benefit from a scheduled rescan. Versioning does not work well for them either. The GUI adjusts the suggested settings accordingly (watcher disabled, one day rescan interval, no versioning) when accepting a receive-encrypted folder. Mirror that behavior to the auto-accept case where the GUI is not involved.

For watcher and rescan, the defaults are overridden especially in handleAutoAccepts(), while the versioning is filtered out completely in the backend's FolderConfiguration.prepare().

Fixes #8296.

Testing

Manual testing with auto-accept enabled or disabled from a certain remote device.

Documentation

Is it worth mentioning this automatic override in the docs? The only place I've found is at https://docs.syncthing.net/users/config.html#config-option-device.autoacceptfolders, which is pretty terse in general.

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 does not work well for encrypted folders.  The GUI adjusts
the suggested settings accordingly (no versioning) when accepting a
receive-encrypted folder.  Add it to the hard requirements enforced in
FolderConfiguration.prepare() in the backend as well, so it also
applies to the auto-accept case where the GUI is not involved.
@imsodin
Copy link
Member

imsodin commented Jul 14, 2022

Lets maybe do the versioning in the model/auto-accept as well. While it's cumbersome and unlikely to be useful in the real world, I do think versioning is theoretically usable (one could manually get versions and decrypt them). If it were to be disabled in the folder config, we also need to disable it in the web UI (otherwise a user will set folder versioning, and we'll silently remove it -> surprises are always bad).

@acolomb
Copy link
Member Author

acolomb commented Jul 14, 2022

Sure, that's a valid point. I suppose the same could be said about "Ignore Permissions", which will get disabled silently if set in the GUI for a receive-encrypted folder. Should we avoid that in addition?

Did anyone actually test what happens with versioning enabled on a receive-encrypted folder?

@imsodin
Copy link
Member

imsodin commented Jul 14, 2022

Ignore permission controls is disabled (as in you can't uncheck it) when type is receive-encrypted. And no I haven't tested that.

@acolomb acolomb merged commit a6dba7c into syncthing:main Jul 22, 2022
@acolomb acolomb deleted the fix-encrypted-autoaccept-watcher branch July 22, 2022 09:28
calmh added a commit that referenced this pull request Jul 22, 2022
* main:
  lib/model, lib/config: Apply sensible defaults for auto-accepted encrypted folder (fixes #8296) (#8427)
  gui: Move filesystem watcher explanation from tooltip to help block (#8432)
  gui: Use discovered IDs from cache when adding a new remote device (#8382)
  build: Update goleveldb (#8440)
calmh added a commit to calmh/syncthing that referenced this pull request Jul 26, 2022
* main:
  lib/model, lib/config: Apply sensible defaults for auto-accepted encrypted folder (fixes syncthing#8296) (syncthing#8427)
  gui: Move filesystem watcher explanation from tooltip to help block (syncthing#8432)
  gui: Use discovered IDs from cache when adding a new remote device (syncthing#8382)
  build: Update goleveldb (syncthing#8440)
@calmh calmh added this to the v1.21.0 milestone Jul 26, 2022
calmh added a commit to calmh/syncthing that referenced this pull request Jul 28, 2022
* main:
  cmd/syncthing, lib/config: Remove restartOnWakeup option & functionality (fixes syncthing#8448) (syncthing#8449)
  gui: Remove blank meta tags (syncthing#8362)
  gui: Add device sync status (fixes syncthing#7981) (syncthing#8401)
  gui: Fix detailed staggered versioning information in folder info (ref syncthing#8348) (syncthing#8433)
  all: Support syncing ownership (fixes syncthing#1329) (syncthing#8434)
  gui, man, authors: Update docs, translations, and contributors
  lib/model, lib/config: Apply sensible defaults for auto-accepted encrypted folder (fixes syncthing#8296) (syncthing#8427)
  gui: Move filesystem watcher explanation from tooltip to help block (syncthing#8432)
  gui: Use discovered IDs from cache when adding a new remote device (syncthing#8382)
  build: Update goleveldb (syncthing#8440)
  gui, man, authors: Update docs, translations, and contributors
  cmd/syncthing/cli: Add show discovery command (fixes syncthing#8007) (syncthing#8378)
  gui, man, authors: Update docs, translations, and contributors
  lib/osutil: Only announce address of interfaces which are up (fixes syncthing#7458) (syncthing#8422)
  gui: Fix missing span end tag and missing nbsp semicolon in HTML (syncthing#8419)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jul 22, 2023
@syncthing syncthing locked and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-accepted receive-encrypted folders should have more sensible defaults
4 participants