2017-08-11 14:57:31 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core
|
2015-12-09 04:57:38 +01:00
|
|
|
|
{
|
|
|
|
|
public class GlobalSettings
|
|
|
|
|
{
|
2017-08-02 23:02:55 +02:00
|
|
|
|
public bool SelfHosted { get; set; }
|
2019-04-26 15:52:54 +02:00
|
|
|
|
public virtual string KnownProxies { get; set; }
|
2016-02-06 07:18:25 +01:00
|
|
|
|
public virtual string SiteName { get; set; }
|
2017-04-04 16:13:16 +02:00
|
|
|
|
public virtual string StripeApiKey { get; set; }
|
2017-08-09 05:06:28 +02:00
|
|
|
|
public virtual string ProjectName { get; set; }
|
|
|
|
|
public virtual string LogDirectory { get; set; }
|
2017-08-09 23:01:37 +02:00
|
|
|
|
public virtual string LicenseDirectory { get; set; }
|
2019-07-11 02:05:07 +02:00
|
|
|
|
public string LicenseCertificatePassword { get; set; }
|
2017-08-11 14:57:31 +02:00
|
|
|
|
public virtual string PushRelayBaseUri { get; set; }
|
2018-08-16 00:43:26 +02:00
|
|
|
|
public virtual string InternalIdentityKey { get; set; }
|
2019-07-23 03:23:09 +02:00
|
|
|
|
public virtual string HibpApiKey { get; set; }
|
2017-08-28 13:50:57 +02:00
|
|
|
|
public virtual bool DisableUserRegistration { get; set; }
|
2019-04-01 14:28:36 +02:00
|
|
|
|
public virtual bool DisableEmailNewDevice { get; set; }
|
2019-06-11 22:44:59 +02:00
|
|
|
|
public virtual int OrganizationInviteExpirationHours { get; set; } = 120; // 5 days
|
2017-08-11 14:57:31 +02:00
|
|
|
|
public virtual InstallationSettings Installation { get; set; } = new InstallationSettings();
|
2017-08-04 05:12:05 +02:00
|
|
|
|
public virtual BaseServiceUriSettings BaseServiceUri { get; set; } = new BaseServiceUriSettings();
|
2019-01-16 04:07:13 +01:00
|
|
|
|
public virtual SqlSettings SqlServer { get; set; } = new SqlSettings();
|
|
|
|
|
public virtual SqlSettings PostgreSql { get; set; } = new SqlSettings();
|
2015-12-09 04:57:38 +01:00
|
|
|
|
public virtual MailSettings Mail { get; set; } = new MailSettings();
|
2019-06-13 06:10:37 +02:00
|
|
|
|
public virtual ConnectionStringSettings Storage { get; set; } = new ConnectionStringSettings();
|
|
|
|
|
public virtual ConnectionStringSettings Events { get; set; } = new ConnectionStringSettings();
|
2018-08-22 22:04:27 +02:00
|
|
|
|
public virtual NotificationsSettings Notifications { get; set; } = new NotificationsSettings();
|
2017-06-15 21:34:12 +02:00
|
|
|
|
public virtual AttachmentSettings Attachment { get; set; } = new AttachmentSettings();
|
2017-01-13 00:35:26 +01:00
|
|
|
|
public virtual IdentityServerSettings IdentityServer { get; set; } = new IdentityServerSettings();
|
2017-03-24 03:02:55 +01:00
|
|
|
|
public virtual DataProtectionSettings DataProtection { get; set; } = new DataProtectionSettings();
|
2017-01-15 05:24:02 +01:00
|
|
|
|
public virtual DocumentDbSettings DocumentDb { get; set; } = new DocumentDbSettings();
|
2018-03-23 18:33:31 +01:00
|
|
|
|
public virtual SentrySettings Sentry { get; set; } = new SentrySettings();
|
2017-05-26 06:50:27 +02:00
|
|
|
|
public virtual NotificationHubSettings NotificationHub { get; set; } = new NotificationHubSettings();
|
2017-06-15 04:40:33 +02:00
|
|
|
|
public virtual YubicoSettings Yubico { get; set; } = new YubicoSettings();
|
2017-06-21 06:04:25 +02:00
|
|
|
|
public virtual DuoSettings Duo { get; set; } = new DuoSettings();
|
2017-07-28 06:17:31 +02:00
|
|
|
|
public virtual BraintreeSettings Braintree { get; set; } = new BraintreeSettings();
|
2019-02-22 04:43:37 +01:00
|
|
|
|
public virtual BitPaySettings BitPay { get; set; } = new BitPaySettings();
|
2019-03-13 19:07:08 +01:00
|
|
|
|
public virtual AmazonSettings Amazon { get; set; } = new AmazonSettings();
|
2019-06-13 06:10:37 +02:00
|
|
|
|
public virtual ServiceBusSettings ServiceBus { get; set; } = new ServiceBusSettings();
|
2015-12-09 04:57:38 +01:00
|
|
|
|
|
2017-08-04 05:12:05 +02:00
|
|
|
|
public class BaseServiceUriSettings
|
|
|
|
|
{
|
|
|
|
|
public string Vault { get; set; }
|
2017-08-17 05:44:14 +02:00
|
|
|
|
public string VaultWithHash => $"{Vault}/#";
|
2017-08-04 05:12:05 +02:00
|
|
|
|
public string Api { get; set; }
|
|
|
|
|
public string Identity { get; set; }
|
2018-04-17 02:35:53 +02:00
|
|
|
|
public string Admin { get; set; }
|
2018-08-16 19:50:41 +02:00
|
|
|
|
public string Notifications { get; set; }
|
|
|
|
|
public string InternalNotifications { get; set; }
|
2018-04-17 02:35:53 +02:00
|
|
|
|
public string InternalAdmin { get; set; }
|
2017-08-04 05:12:05 +02:00
|
|
|
|
public string InternalIdentity { get; set; }
|
2018-03-29 14:45:04 +02:00
|
|
|
|
public string InternalApi { get; set; }
|
|
|
|
|
public string InternalVault { get; set; }
|
2017-08-04 05:12:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 04:07:13 +01:00
|
|
|
|
public class SqlSettings
|
2016-02-06 07:18:25 +01:00
|
|
|
|
{
|
2017-08-19 00:22:25 +02:00
|
|
|
|
private string _connectionString;
|
2018-10-09 23:21:12 +02:00
|
|
|
|
private string _readOnlyConnectionString;
|
2017-08-19 00:22:25 +02:00
|
|
|
|
|
|
|
|
|
public string ConnectionString
|
|
|
|
|
{
|
|
|
|
|
get => _connectionString;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_connectionString = value.Trim('"');
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-09 23:21:12 +02:00
|
|
|
|
|
|
|
|
|
public string ReadOnlyConnectionString
|
|
|
|
|
{
|
|
|
|
|
get => string.IsNullOrWhiteSpace(_readOnlyConnectionString) ?
|
|
|
|
|
_connectionString : _readOnlyConnectionString;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_readOnlyConnectionString = value.Trim('"');
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-02-06 07:18:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-13 06:10:37 +02:00
|
|
|
|
public class ConnectionStringSettings
|
2016-12-01 03:51:43 +01:00
|
|
|
|
{
|
2017-08-19 00:22:25 +02:00
|
|
|
|
private string _connectionString;
|
|
|
|
|
|
|
|
|
|
public string ConnectionString
|
|
|
|
|
{
|
|
|
|
|
get => _connectionString;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_connectionString = value.Trim('"');
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-12-01 03:51:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 21:34:12 +02:00
|
|
|
|
public class AttachmentSettings
|
|
|
|
|
{
|
2017-08-19 00:22:25 +02:00
|
|
|
|
private string _connectionString;
|
|
|
|
|
|
|
|
|
|
public string ConnectionString
|
|
|
|
|
{
|
|
|
|
|
get => _connectionString;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_connectionString = value.Trim('"');
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-08-08 23:27:01 +02:00
|
|
|
|
public string BaseDirectory { get; set; }
|
2017-06-15 21:34:12 +02:00
|
|
|
|
public string BaseUrl { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-09 04:57:38 +01:00
|
|
|
|
public class MailSettings
|
|
|
|
|
{
|
|
|
|
|
public string ReplyToEmail { get; set; }
|
2017-05-31 04:40:02 +02:00
|
|
|
|
public string SendGridApiKey { get; set; }
|
2019-03-13 21:19:00 +01:00
|
|
|
|
public string AmazonConfigSetName { get; set; }
|
2017-05-31 04:40:02 +02:00
|
|
|
|
public SmtpSettings Smtp { get; set; } = new SmtpSettings();
|
|
|
|
|
|
|
|
|
|
public class SmtpSettings
|
|
|
|
|
{
|
|
|
|
|
public string Host { get; set; }
|
2017-08-22 03:55:32 +02:00
|
|
|
|
public int Port { get; set; } = 25;
|
2019-04-10 14:44:58 +02:00
|
|
|
|
public bool StartTls { get; set; } = false;
|
2017-08-22 03:55:32 +02:00
|
|
|
|
public bool Ssl { get; set; } = false;
|
2019-01-23 03:28:56 +01:00
|
|
|
|
public bool SslOverride { get; set; } = false;
|
2017-05-31 04:40:02 +02:00
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
public string Password { get; set; }
|
2019-01-23 03:28:56 +01:00
|
|
|
|
[Obsolete]
|
2017-10-05 14:34:46 +02:00
|
|
|
|
public bool UseDefaultCredentials { get; set; } = false;
|
2019-01-23 03:28:56 +01:00
|
|
|
|
[Obsolete]
|
2018-08-23 05:40:50 +02:00
|
|
|
|
public string AuthType { get; set; }
|
2019-01-23 01:44:03 +01:00
|
|
|
|
public bool TrustServer { get; set; } = false;
|
2017-05-31 04:40:02 +02:00
|
|
|
|
}
|
2015-12-09 04:57:38 +01:00
|
|
|
|
}
|
2016-02-07 05:45:33 +01:00
|
|
|
|
|
2017-01-13 00:35:26 +01:00
|
|
|
|
public class IdentityServerSettings
|
|
|
|
|
{
|
|
|
|
|
public string CertificateThumbprint { get; set; }
|
2017-08-07 17:24:16 +02:00
|
|
|
|
public string CertificatePassword { get; set; }
|
2017-01-13 00:35:26 +01:00
|
|
|
|
}
|
2017-01-15 05:24:02 +01:00
|
|
|
|
|
2017-03-24 03:02:55 +01:00
|
|
|
|
public class DataProtectionSettings
|
|
|
|
|
{
|
|
|
|
|
public string CertificateThumbprint { get; set; }
|
2019-07-11 02:05:07 +02:00
|
|
|
|
public string CertificatePassword { get; set; }
|
2017-08-09 05:06:28 +02:00
|
|
|
|
public string Directory { get; set; }
|
2017-03-24 03:02:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-15 05:24:02 +01:00
|
|
|
|
public class DocumentDbSettings
|
|
|
|
|
{
|
|
|
|
|
public string Uri { get; set; }
|
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
}
|
2017-05-26 06:50:27 +02:00
|
|
|
|
|
2018-03-23 18:33:31 +01:00
|
|
|
|
public class SentrySettings
|
|
|
|
|
{
|
|
|
|
|
public string Dsn { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-13 06:10:37 +02:00
|
|
|
|
public class NotificationsSettings : ConnectionStringSettings
|
2018-08-22 22:04:27 +02:00
|
|
|
|
{
|
|
|
|
|
public string AzureSignalRConnectionString { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-26 06:50:27 +02:00
|
|
|
|
public class NotificationHubSettings
|
|
|
|
|
{
|
2017-08-19 00:22:25 +02:00
|
|
|
|
private string _connectionString;
|
|
|
|
|
|
|
|
|
|
public string ConnectionString
|
|
|
|
|
{
|
|
|
|
|
get => _connectionString;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_connectionString = value.Trim('"');
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-26 06:50:27 +02:00
|
|
|
|
public string HubName { get; set; }
|
|
|
|
|
}
|
2017-06-15 04:40:33 +02:00
|
|
|
|
|
|
|
|
|
public class YubicoSettings
|
|
|
|
|
{
|
|
|
|
|
public string ClientId { get; set; }
|
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
}
|
2017-06-21 06:04:25 +02:00
|
|
|
|
|
|
|
|
|
public class DuoSettings
|
|
|
|
|
{
|
|
|
|
|
public string AKey { get; set; }
|
|
|
|
|
}
|
2017-06-22 04:33:45 +02:00
|
|
|
|
|
2017-07-28 06:17:31 +02:00
|
|
|
|
public class BraintreeSettings
|
|
|
|
|
{
|
|
|
|
|
public bool Production { get; set; }
|
|
|
|
|
public string MerchantId { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
}
|
2017-08-11 14:57:31 +02:00
|
|
|
|
|
2019-02-22 04:43:37 +01:00
|
|
|
|
public class BitPaySettings
|
|
|
|
|
{
|
|
|
|
|
public bool Production { get; set; }
|
|
|
|
|
public string Base58Secret { get; set; }
|
2019-02-22 14:08:48 +01:00
|
|
|
|
public string NotificationUrl { get; set; }
|
2019-02-22 04:43:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-11 14:57:31 +02:00
|
|
|
|
public class InstallationSettings
|
|
|
|
|
{
|
2017-08-15 02:57:45 +02:00
|
|
|
|
public Guid Id { get; set; }
|
2017-08-11 14:57:31 +02:00
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
public string IdentityUri { get; set; }
|
|
|
|
|
}
|
2019-03-13 19:07:08 +01:00
|
|
|
|
|
|
|
|
|
public class AmazonSettings
|
|
|
|
|
{
|
|
|
|
|
public string AccessKeyId { get; set; }
|
|
|
|
|
public string AccessKeySecret { get; set; }
|
|
|
|
|
public string Region { get; set; }
|
|
|
|
|
}
|
2019-06-13 06:10:37 +02:00
|
|
|
|
|
|
|
|
|
public class ServiceBusSettings : ConnectionStringSettings
|
|
|
|
|
{
|
|
|
|
|
public string ApplicationCacheTopicName { get; set; }
|
|
|
|
|
public string ApplicationCacheSubscriptionName { get; set; }
|
|
|
|
|
}
|
2015-12-09 04:57:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|