diff --git a/.gitignore b/.gitignore index c4df8dfc..5cec64f6 100644 --- a/.gitignore +++ b/.gitignore @@ -425,4 +425,8 @@ FodyWeavers.xsd *.msi *.msix *.msm -*.msp \ No newline at end of file +*.msp + +# Telemetry DSN configuration file (contains sensitive information) +telemetry_dsn.txt +**/telemetry_dsn.txt \ No newline at end of file diff --git a/Ink Canvas/App.xaml.cs b/Ink Canvas/App.xaml.cs index 31d1d9ec..e3bcb218 100644 --- a/Ink Canvas/App.xaml.cs +++ b/Ink Canvas/App.xaml.cs @@ -1269,7 +1269,30 @@ namespace Ink_Canvas return envDsn; } - return "https://9aa07b78ee2a43edae34cc6c116ce90a@iccce.dlass.tech/2"; + string assemblyLocation = Assembly.GetExecutingAssembly().Location; + string currentDir = Path.GetDirectoryName(assemblyLocation); + + for (int i = 0; i < 5; i++) + { + string dsnFilePath = Path.Combine(currentDir, "telemetry_dsn.txt"); + if (File.Exists(dsnFilePath)) + { + string dsn = File.ReadAllText(dsnFilePath, System.Text.Encoding.UTF8).Trim(); + if (!string.IsNullOrWhiteSpace(dsn)) + { + return dsn; + } + } + + DirectoryInfo parentDir = Directory.GetParent(currentDir); + if (parentDir == null) + { + break; + } + currentDir = parentDir.FullName; + } + + return string.Empty; } catch {