From 7d4b57f5176bf09e043196e0f392a34e93e0f5c2 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 11 Mar 2024 09:49:42 +0100 Subject: [PATCH 1/3] Removed donation messages --- Duplicati/CommandLine/Commands.cs | 9 -- Duplicati/Library/Main/Utility.cs | 48 ---------- .../WebServer/RESTMethods/SystemInfo.cs | 23 +---- Duplicati/Server/webroot/ngax/index.html | 12 --- Duplicati/Server/webroot/ngax/less/base.less | 91 ------------------- .../controllers/SystemSettingsController.js | 22 ----- .../webroot/ngax/templates/restore.html | 4 - .../webroot/ngax/templates/settings.html | 7 -- 8 files changed, 1 insertion(+), 215 deletions(-) diff --git a/Duplicati/CommandLine/Commands.cs b/Duplicati/CommandLine/Commands.cs index c5e81c8c3..2b550f327 100644 --- a/Duplicati/CommandLine/Commands.cs +++ b/Duplicati/CommandLine/Commands.cs @@ -579,15 +579,6 @@ namespace Duplicati.CommandLine output.MessageEvent(string.Format("Restored {0} ({1}) files to {2}", res.RestoredFiles, Library.Utility.Utility.FormatSizeString(res.SizeOfRestoredFiles), string.IsNullOrEmpty(restorePath) ? "original path" : restorePath)); output.MessageEvent(string.Format("Duration of restore: {0:hh\\:mm\\:ss}", res.Duration)); - if (res.RestoredFiles > 0 && !Library.Main.Utility.SuppressDonationMessages) - { - output.MessageEvent("***********************************************"); - output.MessageEvent("Did we help save your files? If so, please support Duplicati with a donation. We suggest 10€ for private use and 100€ for commercial use."); - output.MessageEvent(""); - output.MessageEvent("https://www.duplicati.com/donate/"); - output.MessageEvent("***********************************************"); - } - if (output.FullResults) Library.Utility.Utility.PrintSerializeObject(res, outwriter); diff --git a/Duplicati/Library/Main/Utility.cs b/Duplicati/Library/Main/Utility.cs index 52c95d2ca..5ec04b19f 100644 --- a/Duplicati/Library/Main/Utility.cs +++ b/Duplicati/Library/Main/Utility.cs @@ -180,54 +180,6 @@ namespace Duplicati.Library.Main db.SetDbOptions(newDict, transaction); } } - - /// - /// The filename for the marker file that the user can add to suppress donation messages - /// - private const string SUPPRESS_DONATIONS_FILENAME = "suppress_donation_messages.txt"; - - - /// - /// Gets or sets donation message suppression - /// - public static bool SuppressDonationMessages - { - get - { - try - { - var folder = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AutoUpdater.AutoUpdateSettings.AppName); - return File.Exists(Path.Combine(folder, SUPPRESS_DONATIONS_FILENAME)); - } - catch - { - } - - return true; - } - set - { - try - { - var folder = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AutoUpdater.AutoUpdateSettings.AppName); - if (!Directory.Exists(folder)) - Directory.CreateDirectory(folder); - - var path = Path.Combine(folder, SUPPRESS_DONATIONS_FILENAME); - - if (value) - using(File.OpenWrite(path)) - { - } - else - File.Delete(path); - - } - catch - { - } - } - } } } diff --git a/Duplicati/Server/WebServer/RESTMethods/SystemInfo.cs b/Duplicati/Server/WebServer/RESTMethods/SystemInfo.cs index 7a0c57686..8d2faf01e 100644 --- a/Duplicati/Server/WebServer/RESTMethods/SystemInfo.cs +++ b/Duplicati/Server/WebServer/RESTMethods/SystemInfo.cs @@ -27,7 +27,7 @@ using Duplicati.Library.Common; namespace Duplicati.Server.WebServer.RESTMethods { - public class SystemInfo : IRESTMethodGET, IRESTMethodPOST, IRESTMethodDocumented + public class SystemInfo : IRESTMethodGET, IRESTMethodDocumented { public string Description { get { return "Gets various system properties"; } } public IEnumerable> Types @@ -45,26 +45,6 @@ namespace Duplicati.Server.WebServer.RESTMethods info.BodyWriter.OutputOK(SystemData(info)); } - public void POST(string key, RequestInfo info) - { - switch ((key ?? "").ToLowerInvariant()) - { - case "suppressdonationmessages": - Library.Main.Utility.SuppressDonationMessages = true; - info.OutputOK(); - return; - - case "showdonationmessages": - Library.Main.Utility.SuppressDonationMessages = false; - info.OutputOK(); - return; - - default: - info.ReportClientError("No such action", System.Net.HttpStatusCode.NotFound); - return; - } - } - private static object SystemData(RequestInfo info) { var browserlanguage = RESTHandler.ParseDefaultRequestCulture(info) ?? System.Globalization.CultureInfo.InvariantCulture; @@ -107,7 +87,6 @@ namespace Duplicati.Server.WebServer.RESTMethods ServerModules = Serializable.ServerSettings.ServerModules, UsingAlternateUpdateURLs = Duplicati.Library.AutoUpdater.AutoUpdateSettings.UsesAlternateURLs, LogLevels = Enum.GetNames(typeof(Duplicati.Library.Logging.LogMessageType)), - SuppressDonationMessages = Duplicati.Library.Main.Utility.SuppressDonationMessages, SpecialFolders = from n in SpecialFolders.Nodes select new { ID = n.id, Path = n.resolvedpath }, BrowserLocale = new { diff --git a/Duplicati/Server/webroot/ngax/index.html b/Duplicati/Server/webroot/ngax/index.html index 7ddb218ee..5119b6c7e 100755 --- a/Duplicati/Server/webroot/ngax/index.html +++ b/Duplicati/Server/webroot/ngax/index.html @@ -148,11 +148,6 @@ - - -
@@ -253,13 +248,6 @@
-