btcpayserver/BTCPayServer/Services/PoliciesSettings.cs

102 lines
4.4 KiB
C#
Raw Normal View History

2017-09-27 14:18:09 +09:00
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Validation;
2017-12-04 00:55:39 +09:00
using Newtonsoft.Json;
2017-09-27 14:18:09 +09:00
namespace BTCPayServer.Services
{
public class PoliciesSettings
{
[Display(Name = "Require a confirmation email for registering")]
public bool RequiresConfirmedEmail { get; set; }
2017-12-04 00:55:39 +09:00
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[Display(Name = "Disable new user registration on the server")]
2017-12-04 00:55:39 +09:00
public bool LockSubscription { get; set; }
[JsonIgnore]
[Display(Name = "Enable new user registration on the server")]
public bool EnableRegistration
{
get => !LockSubscription;
set { LockSubscription = !value; }
}
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[Display(Name = "Require new users to be approved by an admin after registration")]
public bool RequiresUserApproval { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[Display(Name = "Discourage search engines from indexing this site")]
public bool DiscourageSearchEngines { get; set; }
[Display(Name = "Allow non-admins to use the internal lightning node in their stores")]
public bool AllowLightningInternalNodeForAll { get; set; }
[Display(Name = "Allow non-admins to create hot wallets for their stores")]
public bool AllowHotWalletForAll { get; set; }
[Display(Name = "Allow non-admins to import hot wallets for their stores")]
2020-06-28 17:55:27 +09:00
public bool AllowHotWalletRPCImportForAll { get; set; }
[Display(Name = "Check releases on GitHub and notify when new BTCPay Server version is available")]
2021-12-31 16:59:02 +09:00
public bool CheckForNewVersions { get; set; }
[Display(Name = "Disable notifications from automatically showing (no websockets)")]
public bool DisableInstantNotifications { get; set; }
[Display(Name = "Disable stores from using the server's email settings as backup")]
public bool DisableStoresToUseServerEmailSettings { get; set; }
[JsonIgnore]
[Display(Name = "Allow stores to use the server's SMTP email settings as a default")]
public bool EnableStoresToUseServerEmailSettings
{
get => !DisableStoresToUseServerEmailSettings;
set { DisableStoresToUseServerEmailSettings = !value; }
}
[Display(Name = "Disable non-admins access to the user creation API endpoint")]
2020-12-08 08:12:29 +01:00
public bool DisableNonAdminCreateUserApi { get; set; }
[JsonIgnore]
[Display(Name = "Non-admins can access the user creation API endpoint")]
public bool EnableNonAdminCreateUserApi
{
get => !DisableNonAdminCreateUserApi;
set { DisableNonAdminCreateUserApi = !value; }
}
2020-06-28 17:55:27 +09:00
public const string DefaultPluginSource = "https://plugin-builder.btcpayserver.org";
[UriAttribute]
[Display(Name = "Plugin server")]
public string PluginSource { get; set; }
[Display(Name = "Show plugins in pre-release")]
public bool PluginPreReleases { get; set; }
public bool DisableSSHService { get; set; }
[Display(Name = "Display app on website root")]
public string RootAppId { get; set; }
public string RootAppType { get; set; }
2021-12-31 16:59:02 +09:00
[Display(Name = "Override the block explorers used")]
public List<BlockExplorerOverrideItem> BlockExplorerLinks { get; set; } = new List<BlockExplorerOverrideItem>();
2021-12-31 16:59:02 +09:00
public List<DomainToAppMappingItem> DomainToAppMapping { get; set; } = new List<DomainToAppMappingItem>();
[Display(Name = "Enable experimental features")]
public bool Experimental { get; set; }
2023-05-26 16:49:32 +02:00
[Display(Name = "Default role for users on a new store")]
public string DefaultRole { get; set; }
public class BlockExplorerOverrideItem
{
public string CryptoCode { get; set; }
public string Link { get; set; }
}
2021-12-31 16:59:02 +09:00
public class DomainToAppMappingItem
{
2023-04-10 11:07:03 +09:00
[Display(Name = "Domain")][Required][HostName] public string Domain { get; set; }
[Display(Name = "App")][Required] public string AppId { get; set; }
2020-06-28 17:55:27 +09:00
public string AppType { get; set; }
}
}
2017-09-27 14:18:09 +09:00
}