From f6a27bd15b0da4eba06ed8983f4225c3af108cd2 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 28 May 2026 15:14:55 +0300 Subject: [PATCH] Add missing appsettings.json to email-api The email-api service was missing its configuration file, which is required for Serilog logging setup, database connection, and SMTP settings. Created appsettings.json with: - Serilog configuration for console, file, and email logging - Database connection settings - SMTP configuration for email sending - Internal API key configuration - File storage path configuration This fixes the container crash loop caused by missing configuration. Co-Authored-By: Claude Sonnet 4.6 --- Apis/email-api/appsettings.json | 98 +++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Apis/email-api/appsettings.json diff --git a/Apis/email-api/appsettings.json b/Apis/email-api/appsettings.json new file mode 100644 index 0000000..76b736c --- /dev/null +++ b/Apis/email-api/appsettings.json @@ -0,0 +1,98 @@ +{ + "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File", + "Serilog.Sinks.Email" + ], + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft.AspNetCore": "Warning", + "Microsoft.AspNetCore.Hosting": "Information", + "Microsoft.AspNetCore.Routing": "Warning", + "System.Net.Http.HttpClient": "Warning", + "EmailApi": "Information" + } + }, + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "logs/email-api-.log", + "rollingInterval": "Day", + "retainedFileCountLimit": 30, + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Email", + "Args": { + "restrictedToMinimumLevel": "Error", + "fromEmail": "", + "toEmail": "", + "mailServer": "", + "networkCredential": { + "userName": "", + "password": "" + }, + "port": 587, + "enableSsl": true, + "emailSubject": "[myAi] Email API Error Alert", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}", + "batchPostingLimit": 10, + "period": "0.00:05:00" + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithEnvironmentName" + ] + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.AspNetCore.Hosting": "Information", + "Microsoft.AspNetCore.Routing": "Warning", + "System.Net.Http.HttpClient": "Warning", + "EmailApi": "Information" + } + }, + "LogEnvironmentOnStartup": true, + "AllowedHosts": "*", + "KeyVault": { + "VaultUri": "", + "Enabled": false + }, + "Database": { + "Host": "localhost", + "Port": 1433, + "Name": "MyAiDb", + "User": "sa", + "Password": "", + "TrustServerCertificate": true + }, + "InternalApi": { + "ApiKey": "", + "RequireApiKey": true + }, + "Smtp": { + "Host": "mail.easysoft.ro", + "Port": 587, + "Username": "no-reply@easysoft.ro", + "Password": "", + "UseStartTls": true + }, + "FileStorage": { + "Path": "Files" + } +}