Simple improvements

This commit is contained in:
root 2020-06-07 20:27:16 +02:00
parent d6f1404c7e
commit 60965753f0
4 changed files with 35 additions and 9 deletions

View File

@ -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",

View File

@ -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 {

View File

@ -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; }

View File

@ -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",