mirror of
https://github.com/bitwarden/server.git
synced 2024-11-23 12:25:16 +01:00
events has its own connection string
This commit is contained in:
parent
9a4e0e8b08
commit
8a318f35b7
@ -26,6 +26,9 @@
|
|||||||
"storage": {
|
"storage": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"connectionString": "SECRET"
|
||||||
|
},
|
||||||
"attachment": {
|
"attachment": {
|
||||||
"connectionString": "SECRET",
|
"connectionString": "SECRET",
|
||||||
"baseUrl": "http://localhost:4000/attachments/"
|
"baseUrl": "http://localhost:4000/attachments/"
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
"storage": {
|
"storage": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"connectionString": "SECRET"
|
||||||
|
},
|
||||||
"documentDb": {
|
"documentDb": {
|
||||||
"uri": "SECRET",
|
"uri": "SECRET",
|
||||||
"key": "SECRET"
|
"key": "SECRET"
|
||||||
|
@ -17,6 +17,7 @@ namespace Bit.Core
|
|||||||
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
||||||
public virtual MailSettings Mail { get; set; } = new MailSettings();
|
public virtual MailSettings Mail { get; set; } = new MailSettings();
|
||||||
public virtual StorageSettings Storage { get; set; } = new StorageSettings();
|
public virtual StorageSettings Storage { get; set; } = new StorageSettings();
|
||||||
|
public virtual StorageSettings Events { get; set; } = new StorageSettings();
|
||||||
public virtual AttachmentSettings Attachment { get; set; } = new AttachmentSettings();
|
public virtual AttachmentSettings Attachment { get; set; } = new AttachmentSettings();
|
||||||
public virtual IdentityServerSettings IdentityServer { get; set; } = new IdentityServerSettings();
|
public virtual IdentityServerSettings IdentityServer { get; set; } = new IdentityServerSettings();
|
||||||
public virtual DataProtectionSettings DataProtection { get; set; } = new DataProtectionSettings();
|
public virtual DataProtectionSettings DataProtection { get; set; } = new DataProtectionSettings();
|
||||||
|
@ -15,7 +15,7 @@ namespace Bit.Core.Repositories.TableStorage
|
|||||||
private readonly CloudTable _table;
|
private readonly CloudTable _table;
|
||||||
|
|
||||||
public EventRepository(GlobalSettings globalSettings)
|
public EventRepository(GlobalSettings globalSettings)
|
||||||
: this(globalSettings.Storage.ConnectionString)
|
: this(globalSettings.Events.ConnectionString)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public EventRepository(string storageConnectionString)
|
public EventRepository(string storageConnectionString)
|
||||||
|
@ -22,7 +22,7 @@ namespace Bit.Core.Services
|
|||||||
IEventRepository eventRepository,
|
IEventRepository eventRepository,
|
||||||
GlobalSettings globalSettings)
|
GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);
|
var storageAccount = CloudStorageAccount.Parse(globalSettings.Events.ConnectionString);
|
||||||
var queueClient = storageAccount.CreateCloudQueueClient();
|
var queueClient = storageAccount.CreateCloudQueueClient();
|
||||||
|
|
||||||
_queue = queueClient.GetQueueReference("event");
|
_queue = queueClient.GetQueueReference("event");
|
||||||
|
@ -112,7 +112,7 @@ namespace Bit.Core.Utilities
|
|||||||
services.AddSingleton<IBlockIpService, NoopBlockIpService>();
|
services.AddSingleton<IBlockIpService, NoopBlockIpService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Storage.ConnectionString))
|
if(!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Events.ConnectionString))
|
||||||
{
|
{
|
||||||
services.AddSingleton<IEventWriteService, AzureQueueEventWriteService>();
|
services.AddSingleton<IEventWriteService, AzureQueueEventWriteService>();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace Bit.Events
|
|||||||
|
|
||||||
// Services
|
// Services
|
||||||
services.AddScoped<IEventService, EventService>();
|
services.AddScoped<IEventService, EventService>();
|
||||||
if(!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Storage.ConnectionString))
|
if(!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Events.ConnectionString))
|
||||||
{
|
{
|
||||||
services.AddSingleton<IEventWriteService, AzureQueueEventWriteService>();
|
services.AddSingleton<IEventWriteService, AzureQueueEventWriteService>();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
"storage": {
|
"storage": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"connectionString": "SECRET"
|
||||||
|
},
|
||||||
"documentDb": {
|
"documentDb": {
|
||||||
"uri": "SECRET",
|
"uri": "SECRET",
|
||||||
"key": "SECRET"
|
"key": "SECRET"
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
"storage": {
|
"storage": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"connectionString": "SECRET"
|
||||||
|
},
|
||||||
"documentDb": {
|
"documentDb": {
|
||||||
"uri": "SECRET",
|
"uri": "SECRET",
|
||||||
"key": "SECRET"
|
"key": "SECRET"
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
"storage": {
|
"storage": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"connectionString": "SECRET"
|
||||||
|
},
|
||||||
"documentDb": {
|
"documentDb": {
|
||||||
"uri": "SECRET",
|
"uri": "SECRET",
|
||||||
"key": "SECRET"
|
"key": "SECRET"
|
||||||
|
Loading…
Reference in New Issue
Block a user