diff --git a/BTCPayServer/Controllers/HomeController.cs b/BTCPayServer/Controllers/HomeController.cs index 6747570ff..01dcccbee 100644 --- a/BTCPayServer/Controllers/HomeController.cs +++ b/BTCPayServer/Controllers/HomeController.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using BTCPayServer.Models; -using NBitcoin.DataEncoders; using NBitcoin.Payment; using System.Net.Http; using Newtonsoft.Json.Linq; diff --git a/BTCPayServer/HostedServices/CssThemeManager.cs b/BTCPayServer/HostedServices/CssThemeManager.cs index 1e240c940..6b2c6b139 100644 --- a/BTCPayServer/HostedServices/CssThemeManager.cs +++ b/BTCPayServer/HostedServices/CssThemeManager.cs @@ -45,10 +45,12 @@ namespace BTCPayServer.HostedServices } public bool ShowRegister { get; set; } + public bool DiscourageSearchEngines { get; set; } internal void Update(PoliciesSettings data) { ShowRegister = !data.LockSubscription; + DiscourageSearchEngines = data.DiscourageSearchEngines; } } diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index 39aeb4994..8f7cf3f30 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -3,7 +3,6 @@ using System.Reflection; using System.Linq; using Microsoft.AspNetCore.Builder; using System; -using System.Collections.Generic; using System.Text; using Microsoft.Extensions.DependencyInjection; @@ -14,7 +13,6 @@ using BTCPayServer.Authentication; using Microsoft.EntityFrameworkCore; using BTCPayServer.Filters; using Microsoft.AspNetCore.Mvc.Infrastructure; -using BTCPayServer.Services; using BTCPayServer.Models; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.HttpOverrides; diff --git a/BTCPayServer/Services/PoliciesSettings.cs b/BTCPayServer/Services/PoliciesSettings.cs index b1ef0a423..cc2766483 100644 --- a/BTCPayServer/Services/PoliciesSettings.cs +++ b/BTCPayServer/Services/PoliciesSettings.cs @@ -18,5 +18,9 @@ namespace BTCPayServer.Services [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] [Display(Name = "Disable registration")] public bool LockSubscription { get; set; } + + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + [Display(Name = "Discourage search engines from indexing this site")] + public bool DiscourageSearchEngines { get; set; } } } diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/Server/Policies.cshtml index 69f072da2..85af6780c 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/Server/Policies.cshtml @@ -21,6 +21,10 @@
+
+
+ +
diff --git a/BTCPayServer/Views/Shared/_Layout.cshtml b/BTCPayServer/Views/Shared/_Layout.cshtml index 2f2a54e04..2f963dd94 100644 --- a/BTCPayServer/Views/Shared/_Layout.cshtml +++ b/BTCPayServer/Views/Shared/_Layout.cshtml @@ -15,6 +15,10 @@ + @if (themeManager.DiscourageSearchEngines) + { + + } BTCPay Server @@ -58,7 +62,7 @@