Browse Source

cmd/ursrv, lib/ur: Collect and present encryption usage (#7448)

Simon Frei 4 years ago
parent
commit
9a001051d6
3 changed files with 5 additions and 0 deletions
  1. 1 0
      cmd/ursrv/main.go
  2. 1 0
      lib/ur/contract/contract.go
  3. 3 0
      lib/ur/usage_report.go

+ 1 - 0
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)

+ 1 - 0
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 {

+ 3 - 0
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)