diff --git a/v2.0/LetsEncrypt/.vscode/launch.json b/v2.0/LetsEncrypt/.vscode/launch.json index 4089725..5a45820 100644 --- a/v2.0/LetsEncrypt/.vscode/launch.json +++ b/v2.0/LetsEncrypt/.vscode/launch.json @@ -8,6 +8,12 @@ "name": ".NET Core Launch (console)", "type": "coreclr", "request": "launch", + "logging": { + "engineLogging": false, + "moduleLoad": false, + "exceptions": false, + "browserStdOut": false + }, "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/LetsEncrypt.dll", diff --git a/v2.0/LetsEncrypt/App.cs b/v2.0/LetsEncrypt/App.cs index f08866d..2677be1 100644 --- a/v2.0/LetsEncrypt/App.cs +++ b/v2.0/LetsEncrypt/App.cs @@ -35,7 +35,7 @@ namespace LetsEncrypt try { - LetsEncrypt.Helpers.Environment env = _appSettings.environments.First(x => (x.name == _appSettings.active)); + LetsEncrypt.Helpers.Environment env = _appSettings.environments.Where(x => x.name == _appSettings.active).FirstOrDefault(); Console.WriteLine(string.Format("Let's Encrypt C# .Net Core Client, environment: {0}", env.name)); @@ -45,7 +45,7 @@ namespace LetsEncrypt Console.WriteLine(string.Format("Managing customer: {0} - {1} {2}", customer.id, customer.name, customer.lastname)); //loop each customer website - foreach(Site site in customer.sites) { + foreach(Site site in customer.sites.Where(s => s.active)) { Console.WriteLine(string.Format("Managing site: {0}", site.name)); try { diff --git a/v2.0/LetsEncrypt/Helpers/AppSettings.cs b/v2.0/LetsEncrypt/Helpers/AppSettings.cs index cacb951..bf2e554 100644 --- a/v2.0/LetsEncrypt/Helpers/AppSettings.cs +++ b/v2.0/LetsEncrypt/Helpers/AppSettings.cs @@ -24,7 +24,7 @@ namespace LetsEncrypt.Helpers } public class Site { - public string root { get; set; } + public bool active { get; set; } public string name { get; set; } public string [] hosts { get; set; } public string challenge { get; set; } diff --git a/v2.0/LetsEncrypt/appsettings.json b/v2.0/LetsEncrypt/appsettings.json index 8051b28..0841af9 100644 --- a/v2.0/LetsEncrypt/appsettings.json +++ b/v2.0/LetsEncrypt/appsettings.json @@ -1,7 +1,7 @@ { "AppSettings": { - "active": "ProductionV2", + "active": "StagingV2", "environments": [ { @@ -33,6 +33,7 @@ "sites": [ { + "active": true, "name": "maks-it.com", "hosts": [ "maks-it.com", @@ -42,9 +43,27 @@ "ru.maks-it.com", "www.ru.maks-it.com", "api.maks-it.com", - "www.api.maks-it.com", - "dev.maks-it.com", - "www.dev.maks-it.com" + "www.api.maks-it.com" + ], + "challenge": "http-01" + } + ] + }, + { + "id": "46337ef5-d69b-4332-b6ef-67959dfb3c2c", + "contacts": [ "maksym.sadovnychyy@gmail.com" ], + "name": "Anastasiia", + "lastname": "Pavlovskaia", + + "sites": [ + { + "active": true, + "name": "nastyarey.com", + "hosts": [ + "nastyarey.com", + "www.nastyarey.com", + "api.nastyarey.com", + "www.api.nastyarey.com" ], "challenge": "http-01" } @@ -53,11 +72,12 @@ { "id": "341ebe34-e2b3-4645-9f54-aa4fe8eb0250", "contacts": [ "maksym.sadovnychyy@gmail.com" ], - "name": "Maksym", - "lastname": "Sadovnychyy", + "name": "Antonio", + "lastname": "Di Franco", "sites": [ { + "active": true, "name": "aerusitalia.it", "hosts": [ "aerusitalia.it",