diff --git a/src/Exceptionless.AppHost/Program.cs b/src/Exceptionless.AppHost/Program.cs index e2c4fbc251..bb9b7b0fd3 100644 --- a/src/Exceptionless.AppHost/Program.cs +++ b/src/Exceptionless.AppHost/Program.cs @@ -6,7 +6,7 @@ .WithDataVolume("exceptionless.data.v1") .WithKibana(b => b.WithLifetime(ContainerLifetime.Persistent).WithContainerName("Exceptionless-Kibana")); -var storage = builder.AddMinIo("Storage", s => s.WithCredentials("guest", "password").WithPorts(9000)) +var storage = builder.AddMinIo("S3", s => s.WithCredentials("guest", "password").WithPorts(9000)) .WithLifetime(ContainerLifetime.Persistent) .WithContainerName("Exceptionless-Storage"); @@ -26,6 +26,7 @@ builder.AddProject("Jobs", "AllJobs") .WithReference(cache) .WithReference(elastic) + .WithReference(storage) .WithEnvironment("ConnectionStrings:Email", "smtp://localhost:1025") .WaitFor(elastic) .WaitFor(cache) diff --git a/src/Exceptionless.Core/Configuration/StorageOptions.cs b/src/Exceptionless.Core/Configuration/StorageOptions.cs index 2c114e973d..6ab6bad7cd 100644 --- a/src/Exceptionless.Core/Configuration/StorageOptions.cs +++ b/src/Exceptionless.Core/Configuration/StorageOptions.cs @@ -16,18 +16,31 @@ public class StorageOptions public static StorageOptions ReadFromConfiguration(IConfiguration config, AppOptions appOptions) { - var options = new StorageOptions(); - - options.Scope = appOptions.AppScope; + var options = new StorageOptions { Scope = appOptions.AppScope }; options.ScopePrefix = !String.IsNullOrEmpty(options.Scope) ? $"{options.Scope}-" : String.Empty; string? cs = config.GetConnectionString("Storage"); - options.Data = cs.ParseConnectionString(); - options.Provider = options.Data.GetString(nameof(options.Provider)); + if (cs != null) + { + options.Data = cs.ParseConnectionString(); + options.Provider = options.Data.GetString(nameof(options.Provider)); + } + else + { + var minioConnectionString = config.GetConnectionString("S3"); + if (!String.IsNullOrEmpty(minioConnectionString)) + { + options.Provider = "s3"; + } + } string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null; if (!String.IsNullOrEmpty(providerConnectionString)) - options.Data.AddRange(providerConnectionString.ParseConnectionString()); + { + var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server"); + options.Data ??= []; + options.Data.AddRange(providerOptions); + } options.ConnectionString = options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); diff --git a/src/Exceptionless.Insulation/Bootstrapper.cs b/src/Exceptionless.Insulation/Bootstrapper.cs index dd690ec6e4..0e37d4c3ed 100644 --- a/src/Exceptionless.Insulation/Bootstrapper.cs +++ b/src/Exceptionless.Insulation/Bootstrapper.cs @@ -183,22 +183,22 @@ private static void RegisterQueue(IServiceCollection container, QueueOptions opt private static void RegisterStorage(IServiceCollection container, StorageOptions options) { - if (String.Equals(options.Provider, "aliyun")) + if (String.Equals(options.Provider, "azurestorage")) { - container.ReplaceSingleton(s => new AliyunFileStorage(new AliyunFileStorageOptions + container.ReplaceSingleton(s => new AzureFileStorage(new AzureFileStorageOptions { ConnectionString = options.ConnectionString, + ContainerName = $"{options.ScopePrefix}ex-events", Serializer = s.GetRequiredService(), TimeProvider = s.GetRequiredService(), LoggerFactory = s.GetRequiredService() })); } - else if (String.Equals(options.Provider, "azurestorage")) + else if (String.Equals(options.Provider, "aliyun")) { - container.ReplaceSingleton(s => new AzureFileStorage(new AzureFileStorageOptions + container.ReplaceSingleton(s => new AliyunFileStorage(new AliyunFileStorageOptions { ConnectionString = options.ConnectionString, - ContainerName = $"{options.ScopePrefix}ex-events", Serializer = s.GetRequiredService(), TimeProvider = s.GetRequiredService(), LoggerFactory = s.GetRequiredService() diff --git a/src/Exceptionless.Job/Properties/launchSettings.json b/src/Exceptionless.Job/Properties/launchSettings.json index 9043c97165..f6f61e578f 100644 --- a/src/Exceptionless.Job/Properties/launchSettings.json +++ b/src/Exceptionless.Job/Properties/launchSettings.json @@ -5,7 +5,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "CleanupDataJob": { @@ -14,7 +14,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "DataMigrationJob": { @@ -23,7 +23,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "MigrationJob": { @@ -32,7 +32,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "EventPostsJob": { @@ -41,7 +41,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "EventUserDescriptionsJob": { @@ -50,7 +50,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "EventNotificationsJob": { @@ -59,7 +59,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "MailMessageJob": { @@ -68,7 +68,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "WebHooksJob": { @@ -77,7 +77,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "CloseInactiveSessionsJob": { @@ -86,7 +86,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "DailySummaryJob": { @@ -95,7 +95,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "DownloadGeoIPDatabaseJob": { @@ -104,7 +104,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "WorkItemJob": { @@ -113,7 +113,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "MaintainIndexesJob": { @@ -122,7 +122,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "StackEventCountJob": { @@ -131,7 +131,7 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" }, "EventSnapshotJob": { @@ -140,8 +140,8 @@ "environmentVariables": { "EX_AppMode": "Development" }, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:5002;http://localhost:5003" } } -} \ No newline at end of file +} diff --git a/src/Exceptionless.Job/appsettings.Development.yml b/src/Exceptionless.Job/appsettings.Development.yml index 438c3a12c0..bdd125522a 100644 --- a/src/Exceptionless.Job/appsettings.Development.yml +++ b/src/Exceptionless.Job/appsettings.Development.yml @@ -5,7 +5,7 @@ ConnectionStrings: # Cache: provider=redis; # MessageBus: provider=redis; # Queue: provider=redis; - Storage: provider=folder;path=..\Exceptionless.Web\storage +# Storage: provider=folder;path=..\Exceptionless.Web\storage Email: smtp://localhost:1025 # Base url for the ui used to build links in emails and other places. diff --git a/src/Exceptionless.Web/Properties/launchSettings.json b/src/Exceptionless.Web/Properties/launchSettings.json index c4b0282bfa..a62987a549 100644 --- a/src/Exceptionless.Web/Properties/launchSettings.json +++ b/src/Exceptionless.Web/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Exceptionless": { "commandName": "Project", - "launchBrowser": true, + "launchBrowser": false, "environmentVariables": { "EX_AppMode": "Development" }, diff --git a/src/Exceptionless.Web/appsettings.Development.yml b/src/Exceptionless.Web/appsettings.Development.yml index a399826abe..2abf77f96e 100644 --- a/src/Exceptionless.Web/appsettings.Development.yml +++ b/src/Exceptionless.Web/appsettings.Development.yml @@ -5,7 +5,7 @@ ConnectionStrings: # Cache: provider=redis; # MessageBus: provider=redis; # Queue: provider=redis; - Storage: provider=folder;path=.\storage +# Storage: provider=folder;path=.\storage # LDAP: '' # Email: smtp://localhost:1025