2017-09-27 14:18:09 +09:00
|
|
|
using System.Collections.Generic;
|
2024-01-31 06:45:54 +01:00
|
|
|
using System.ComponentModel;
|
2018-05-10 16:02:49 +09:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
2019-06-25 20:41:32 +02:00
|
|
|
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
|
|
|
|
{
|
2021-02-23 10:39:26 +01:00
|
|
|
[Display(Name = "Require a confirmation email for registering")]
|
2019-04-11 16:30:23 -05:00
|
|
|
public bool RequiresConfirmedEmail { get; set; }
|
2017-12-04 00:55:39 +09:00
|
|
|
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
2021-02-23 10:39:26 +01:00
|
|
|
[Display(Name = "Disable new user registration on the server")]
|
2017-12-04 00:55:39 +09:00
|
|
|
public bool LockSubscription { get; set; }
|
2024-01-31 06:45:54 +01:00
|
|
|
|
|
|
|
[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")]
|
2024-02-06 09:04:18 +01:00
|
|
|
public bool RequiresUserApproval { get; set; }
|
2019-04-11 16:30:23 -05:00
|
|
|
|
2019-03-06 12:33:48 +01:00
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
|
|
[Display(Name = "Discourage search engines from indexing this site")]
|
|
|
|
public bool DiscourageSearchEngines { get; set; }
|
2019-08-20 10:38:15 +02:00
|
|
|
[Display(Name = "Allow non-admins to use the internal lightning node in their stores")]
|
|
|
|
public bool AllowLightningInternalNodeForAll { get; set; }
|
2019-12-18 22:28:03 +09:00
|
|
|
[Display(Name = "Allow non-admins to create hot wallets for their stores")]
|
|
|
|
public bool AllowHotWalletForAll { get; set; }
|
2021-02-23 10:39:26 +01:00
|
|
|
[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; }
|
2021-02-23 10:39:26 +01:00
|
|
|
[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; }
|
2021-02-23 10:39:26 +01:00
|
|
|
[Display(Name = "Disable notifications from automatically showing (no websockets)")]
|
2020-10-20 13:09:09 +02:00
|
|
|
public bool DisableInstantNotifications { get; set; }
|
2021-02-23 10:39:26 +01:00
|
|
|
[Display(Name = "Disable stores from using the server's email settings as backup")]
|
2020-12-04 08:08:05 +01:00
|
|
|
public bool DisableStoresToUseServerEmailSettings { get; set; }
|
2024-01-26 10:28:50 +01:00
|
|
|
[JsonIgnore]
|
|
|
|
[Display(Name = "Allow stores to use the server's SMTP email settings as a default")]
|
|
|
|
public bool EnableStoresToUseServerEmailSettings
|
|
|
|
{
|
|
|
|
get => !DisableStoresToUseServerEmailSettings;
|
|
|
|
set { DisableStoresToUseServerEmailSettings = !value; }
|
|
|
|
}
|
|
|
|
|
2021-02-23 10:39:26 +01:00
|
|
|
[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; }
|
2024-01-31 06:45:54 +01:00
|
|
|
|
|
|
|
[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
|
|
|
|
2022-11-21 10:23:25 +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; }
|
|
|
|
|
2021-04-17 13:29:50 +09:00
|
|
|
public bool DisableSSHService { get; set; }
|
|
|
|
|
2019-04-11 16:30:23 -05:00
|
|
|
[Display(Name = "Display app on website root")]
|
2019-04-12 00:13:14 -05:00
|
|
|
public string RootAppId { get; set; }
|
2023-03-17 03:56:32 +01:00
|
|
|
public string RootAppType { get; set; }
|
2021-12-31 16:59:02 +09:00
|
|
|
|
2020-10-21 09:53:05 +02: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
|
|
|
|
2019-06-25 20:41:32 +02:00
|
|
|
public List<DomainToAppMappingItem> DomainToAppMapping { get; set; } = new List<DomainToAppMappingItem>();
|
2022-05-24 13:18:16 +09:00
|
|
|
[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; }
|
2019-06-25 20:41:32 +02:00
|
|
|
|
2020-10-21 09:53:05 +02:00
|
|
|
public class BlockExplorerOverrideItem
|
|
|
|
{
|
|
|
|
public string CryptoCode { get; set; }
|
|
|
|
public string Link { get; set; }
|
|
|
|
}
|
2021-12-31 16:59:02 +09:00
|
|
|
|
2019-06-25 20:41:32 +02: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
|
|
|
|
2023-03-17 03:56:32 +01:00
|
|
|
public string AppType { get; set; }
|
2019-06-25 20:41:32 +02:00
|
|
|
}
|
2017-10-27 17:53:04 +09:00
|
|
|
}
|
2017-09-27 14:18:09 +09:00
|
|
|
}
|