From b600beb3eae24d53f2f599b33938562187b0ce64 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 17 Dec 2025 18:41:03 -0600 Subject: [PATCH] feat(privacy): remove telemetry, analytics, fingerprinting --- frontend/src/Shared/piwikCheck.js | 12 +----------- .../src/Store/Middleware/createSentryMiddleware.js | 4 +--- src/NzbDrone.Common/HashUtil.cs | 4 ++-- .../Configuration/ConfigFileProvider.cs | 2 +- src/NzbDrone.Core/Update/UpdatePackageProvider.cs | 12 ------------ src/Radarr.Http/Frontend/InitializeJsonController.cs | 2 -- 6 files changed, 5 insertions(+), 31 deletions(-) diff --git a/frontend/src/Shared/piwikCheck.js b/frontend/src/Shared/piwikCheck.js index aadc9cec7a..9be05b5882 100644 --- a/frontend/src/Shared/piwikCheck.js +++ b/frontend/src/Shared/piwikCheck.js @@ -1,11 +1 @@ -if (window.Radarr.analytics) { - const d = document; - const g = d.createElement('script'); - const s = d.getElementsByTagName('script')[0]; - - g.type = 'text/javascript'; - g.async = true; - g.defer = true; - g.src = '//piwik.sonarr.tv/piwik.js'; - s.parentNode.insertBefore(g, s); -} +// Piwik analytics removed for privacy diff --git a/frontend/src/Store/Middleware/createSentryMiddleware.js b/frontend/src/Store/Middleware/createSentryMiddleware.js index e3c8e98769..3c5944772f 100644 --- a/frontend/src/Store/Middleware/createSentryMiddleware.js +++ b/frontend/src/Store/Middleware/createSentryMiddleware.js @@ -92,7 +92,6 @@ export default function createSentryMiddleware() { branch, version, release, - userHash, isProduction } = window.Radarr; @@ -107,7 +106,7 @@ export default function createSentryMiddleware() { dsn, environment: branch, release, - sendDefaultPii: true, + sendDefaultPii: false, beforeSend: cleanseData, integrations: [ new Integrations.RewriteFrames({ iteratee: stripUrlBase }), @@ -116,7 +115,6 @@ export default function createSentryMiddleware() { }); sentry.configureScope((scope) => { - scope.setUser({ username: userHash }); scope.setTag('version', version); scope.setTag('production', isProduction); }); diff --git a/src/NzbDrone.Common/HashUtil.cs b/src/NzbDrone.Common/HashUtil.cs index fadbf831d1..b72841bd3b 100644 --- a/src/NzbDrone.Common/HashUtil.cs +++ b/src/NzbDrone.Common/HashUtil.cs @@ -30,8 +30,8 @@ public static string CalculateCrc(string input) public static string AnonymousToken() { - var seed = $"{Environment.ProcessorCount}_{Environment.OSVersion.Platform}_{Environment.MachineName}_{Environment.UserName}"; - return HashUtil.CalculateCrc(seed); + // Machine fingerprinting removed for privacy - return non-identifying placeholder + return "anonymous"; } } } diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 1f88db6281..8b3b2aaa6e 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -232,7 +232,7 @@ public AuthenticationType AuthenticationMethod ? enumValue : GetValueEnum("AuthenticationRequired", AuthenticationRequiredType.Enabled); - public bool AnalyticsEnabled => _logOptions.AnalyticsEnabled ?? GetValueBoolean("AnalyticsEnabled", true, persist: false); + public bool AnalyticsEnabled => _logOptions.AnalyticsEnabled ?? GetValueBoolean("AnalyticsEnabled", false, persist: true); public string Branch => _updateOptions.Branch ?? GetValue("Branch", "master").ToLowerInvariant(); diff --git a/src/NzbDrone.Core/Update/UpdatePackageProvider.cs b/src/NzbDrone.Core/Update/UpdatePackageProvider.cs index b0543366fa..26dfedfe0c 100644 --- a/src/NzbDrone.Core/Update/UpdatePackageProvider.cs +++ b/src/NzbDrone.Core/Update/UpdatePackageProvider.cs @@ -45,12 +45,6 @@ public UpdatePackage GetLatestUpdate(string branch, Version currentVersion) .AddQueryParam("includeMajorVersion", true) .SetSegment("branch", branch); - if (_analyticsService.IsEnabled) - { - // Send if the system is active so we know which versions to deprecate/ignore - request.AddQueryParam("active", _analyticsService.InstallIsActive.ToString().ToLower()); - } - var update = _httpClient.Get(request.Build()).Resource; if (!update.Available) @@ -77,12 +71,6 @@ public List GetRecentUpdates(string branch, Version currentVersio request.AddQueryParam("prevVersion", previousVersion); } - if (_analyticsService.IsEnabled) - { - // Send if the system is active so we know which versions to deprecate/ignore - request.AddQueryParam("active", _analyticsService.InstallIsActive.ToString().ToLower()); - } - var updates = _httpClient.Get>(request.Build()); return updates.Resource; diff --git a/src/Radarr.Http/Frontend/InitializeJsonController.cs b/src/Radarr.Http/Frontend/InitializeJsonController.cs index 3089fa6ac9..708859cf60 100644 --- a/src/Radarr.Http/Frontend/InitializeJsonController.cs +++ b/src/Radarr.Http/Frontend/InitializeJsonController.cs @@ -1,7 +1,6 @@ using System.Text; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Analytics; using NzbDrone.Core.Configuration; @@ -53,7 +52,6 @@ private string GetContent() builder.AppendLine($" \"theme\": \"{_configFileProvider.Theme.ToString()}\","); builder.AppendLine($" \"branch\": \"{_configFileProvider.Branch.ToLower()}\","); builder.AppendLine($" \"analytics\": {_analyticsService.IsEnabled.ToString().ToLowerInvariant()},"); - builder.AppendLine($" \"userHash\": \"{HashUtil.AnonymousToken()}\","); builder.AppendLine($" \"urlBase\": \"{_urlBase}\","); builder.AppendLine($" \"isProduction\": {RuntimeInfo.IsProduction.ToString().ToLowerInvariant()}"); builder.AppendLine("}");