Skip to content

all: Add untrusted folders behind feature flag (ref #62) - #7055

Merged
imsodin merged 118 commits into
mainfrom
encryption-featureflag
Nov 9, 2020
Merged

imsodin merged 118 commits into
mainfrom
encryption-featureflag

Conversation

@imsodin

@imsodin imsodin commented Oct 23, 2020

Copy link
Copy Markdown
Member

This is a proposal for adding untrusted folders (encryption) support behind a feature flag, as discussed in https://forum.syncthing.net/t/encryption-merging-scary-changes-feature-flags/15703

The PR branch is an extension of #6727, with the feature flag added and the stdecryptfolder tool removed. That still had outstanding PR reviews and isn't necessary to have in a first iteration for testing this. Other than that I believe I addressed all the PR reviews from there and this should be ready to merge. Of course except for the feature flag code, which no one has reviewed yet.

The feature flag determines which web UI is served: The "traditional" one or the new one with controls for untrusted folders. A missing feature flag does not prevent "manual" config changes that introduce untrusted folders. My reasoning being is that it not being available by default in UI is enough of a barrier to prevent wide adoption. I can add a mechanism in the config layer to prevent untrusted folders without the flag if deemed necessary.

The feature flag itself is just a string, such that it can be reused if we ever want to use a feature flag again, instead of creating ad deprecating a bool every time.

The statics server is adjusted, such that if the feature flag is set, it looks for files in a "untrusted" subdir and serves those instead of the "normal" files if present. Those files are adjusted full copies of the originals, i.e. if other UI changes happen, those need to be kept in sync by hand. That's ugly, but I consider it manageable (thus volunteering xD ).

calmh
calmh previously approved these changes Nov 9, 2020

@calmh calmh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed some things. Merge?

* main:
  gui: Add warning when JavaScript is disabled in Web browser (fixes #7099) (#7102)
  lib/model: Add done chan to track folder-lifetime (fixes #6664) (#7094)
  lib/model: Send indexes for newly shared folder (fixes #7098) (#7100)
@calmh

calmh commented Nov 9, 2020

Copy link
Copy Markdown
Member

@imsodin please sanity check my latest merge commit

@imsodin

imsodin commented Nov 9, 2020

Copy link
Copy Markdown
Member Author

The noscript change isn't in the untrusted index.html - taking care of that.

@imsodin

imsodin commented Nov 9, 2020

Copy link
Copy Markdown
Member Author

Now the "UI copies" should match again.

I fixed some things. Merge?

Thanks, that plus fixes look good, Yes :)

calmh
calmh previously approved these changes Nov 9, 2020
@calmh

calmh commented Nov 9, 2020

Copy link
Copy Markdown
Member

TestIssue5063 is flaky and times out sometimes, reproducible with -count 100 for example, I didn't investigate yet if it's due to this change or just in general

@imsodin

imsodin commented Nov 9, 2020

Copy link
Copy Markdown
Member Author

Seems related, tests time out for me on this branch but not on main. Plus I just realized the recent index sender changes duplicate some encryption code, need to sort that out (as in a merge-leftover). Looking into it.

@imsodin

imsodin commented Nov 9, 2020

Copy link
Copy Markdown
Member Author

This PR made it worse, but the problem exists in v1.11.1 too: I messed up locking in the recent index changes. I'll file a separate PR on main and then take care of this PR.

@imsodin
imsodin merged commit 31559e9 into main Nov 9, 2020
@imsodin
imsodin deleted the encryption-featureflag branch November 9, 2020 14:33
@calmh calmh added this to the v1.12.0 milestone Nov 9, 2020
calmh added a commit to calmh/syncthing that referenced this pull request Nov 11, 2020
* main: (42 commits)
  gui: Initialise sharing when accepting new device (fixes syncthing#7113) (syncthing#7114)
  gui: Initialise sharing when accepting new device (fixes syncthing#7113) (syncthing#7114)
  lib/model: Prevent test deadlock (syncthing#7110)
  lib/api, lib/db: Add file debug endpoint (syncthing#7095)
  gui: Add advance config port mapping to gui (fixes syncthing#4824) (syncthing#7017)
  lib/tlsutil: Add O and OU to generated certificates (fixes syncthing#7108) (syncthing#7109)
  all: Add untrusted folders behind feature flag (ref syncthing#62) (syncthing#7055)
  build: Update notify (fixes syncthing#5360) (syncthing#7106)
  lib/model: Fix locking when resending cluster-configs (syncthing#7107)
  gui: Remove superfluous translate in previous (ref syncthing#7102)
  gui: Add warning when JavaScript is disabled in Web browser (fixes syncthing#7099) (syncthing#7102)
  lib/model: Add done chan to track folder-lifetime (fixes syncthing#6664) (syncthing#7094)
  lib/model: Send indexes for newly shared folder (fixes syncthing#7098) (syncthing#7100)
  lib/folder: Clear pull errors when nothing is needed anymore (syncthing#7093)
  lib/api: Fix debug endpoints (ref syncthing#7001) (syncthing#7092)
  gui, man, authors: Update docs, translations, and contributors
  lib/config: Sanity checks on MaxConcurrentWrites (ref syncthing#7064) (syncthing#7069)
  lib/ur: Fix panics in failure-reporting (fixes syncthing#7090) (syncthing#7091)
  lib/ur: Fix panics in failure-reporting (fixes syncthing#7090) (syncthing#7091)
  build: Update dependencies (syncthing#7088)
  ...
@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 Nov 10, 2021
@syncthing syncthing locked and limited conversation to collaborators Nov 10, 2021
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.

4 participants