From 9a001051d6924ff363b26dff0580a046fd37c2c0 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Wed, 10 Mar 2021 23:26:56 +0100 Subject: [PATCH] cmd/ursrv, lib/ur: Collect and present encryption usage (#7448) --- cmd/ursrv/main.go | 1 + lib/ur/contract/contract.go | 1 + lib/ur/usage_report.go | 3 +++ 3 files changed, 5 insertions(+) diff --git a/cmd/ursrv/main.go b/cmd/ursrv/main.go index 4871ace2e..497970702 100644 --- a/cmd/ursrv/main.go +++ b/cmd/ursrv/main.go @@ -745,6 +745,7 @@ func getReport(db *sql.DB) map[string]interface{} { inc(features["Folder"]["v3"], "Weak hash, custom threshold", rep.FolderUsesV3.CustomWeakHashThreshold) inc(features["Folder"]["v3"], "Filesystem watcher", rep.FolderUsesV3.FsWatcherEnabled) inc(features["Folder"]["v3"], "Case sensitive FS", rep.FolderUsesV3.CaseSensitiveFS) + inc(features["Folder"]["v3"], "Mode, receive encrypted", rep.FolderUsesV3.ReceiveEncrypted) add(featureGroups["Folder"]["v3"], "Conflicts", "Disabled", rep.FolderUsesV3.ConflictsDisabled) add(featureGroups["Folder"]["v3"], "Conflicts", "Unlimited", rep.FolderUsesV3.ConflictsUnlimited) diff --git a/lib/ur/contract/contract.go b/lib/ur/contract/contract.go index 28387f27c..8e8e31e1e 100644 --- a/lib/ur/contract/contract.go +++ b/lib/ur/contract/contract.go @@ -129,6 +129,7 @@ type Report struct { BlockPullOrder map[string]int `json:"blockPullOrder,omitempty" since:"3"` CopyRangeMethod map[string]int `json:"copyRangeMethod,omitempty" since:"3"` CaseSensitiveFS int `json:"caseSensitiveFS,omitempty" since:"3"` + ReceiveEncrypted int `json:"receiveencrypted,omitempty" since:"3"` } `json:"folderUsesV3,omitempty" since:"3"` DeviceUsesV3 struct { diff --git a/lib/ur/usage_report.go b/lib/ur/usage_report.go index a0b978ef5..b2b2dfd58 100644 --- a/lib/ur/usage_report.go +++ b/lib/ur/usage_report.go @@ -267,6 +267,9 @@ func (s *Service) reportData(ctx context.Context, urVersion int, preview bool) ( if cfg.CaseSensitiveFS { report.FolderUsesV3.CaseSensitiveFS++ } + if cfg.Type == config.FolderTypeReceiveEncrypted { + report.FolderUsesV3.ReceiveEncrypted++ + } } sort.Ints(report.FolderUsesV3.FsWatcherDelays)