diff --git a/Helper/ConfigHelper.cs b/Helper/ConfigHelper.cs index e84cbf6..fa99a77 100644 --- a/Helper/ConfigHelper.cs +++ b/Helper/ConfigHelper.cs @@ -12,6 +12,7 @@ namespace CarCareTracker.Helper UserConfig GetUserConfig(ClaimsPrincipal user); bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData); bool AuthenticateRootUser(string username, string password); + string GetMOTD(); string GetLogoUrl(); string GetServerLanguage(); bool GetServerEnableShopSupplies(); @@ -32,6 +33,15 @@ namespace CarCareTracker.Helper _userConfig = userConfig; _cache = memoryCache; } + public string GetMOTD() + { + var motd = _config["LUBELOGGER_MOTD"]; + if (string.IsNullOrWhiteSpace(motd)) + { + motd = ""; + } + return motd; + } public OpenIDConfig GetOpenIDConfig() { OpenIDConfig openIdConfig = _config.GetSection("OpenIDConfig").Get() ?? new OpenIDConfig(); @@ -55,7 +65,7 @@ namespace CarCareTracker.Helper { var allowedFileExtensions = _config["LUBELOGGER_ALLOWED_FILE_EXTENSIONS"]; if (string.IsNullOrWhiteSpace(allowedFileExtensions)){ - return ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx"; + return StaticHelper.DefaultAllowedFileExtensions; } return allowedFileExtensions; } diff --git a/Helper/StaticHelper.cs b/Helper/StaticHelper.cs index e54cbd8..e99720d 100644 --- a/Helper/StaticHelper.cs +++ b/Helper/StaticHelper.cs @@ -8,10 +8,12 @@ namespace CarCareTracker.Helper /// public static class StaticHelper { + public static string VersionNumber = "1.2.5"; public static string DbName = "data/cartracker.db"; public static string UserConfigPath = "config/userConfig.json"; public static string GenericErrorMessage = "An error occurred, please try again later"; public static string ReminderEmailTemplate = "defaults/reminderemailtemplate.txt"; + public static string DefaultAllowedFileExtensions = ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx"; public static string GetTitleCaseReminderUrgency(ReminderUrgency input) { @@ -225,5 +227,22 @@ namespace CarCareTracker.Helper { return new DateTimeOffset(date).ToUnixTimeMilliseconds(); } + public static void InitMessage(IConfiguration config) + { + Console.WriteLine($"LubeLogger {VersionNumber}"); + Console.WriteLine("Website: https://lubelogger.com"); + Console.WriteLine("Documentation: https://docs.lubelogger.com"); + Console.WriteLine("GitHub: https://github.com/hargata/lubelog"); + var mailConfig = config.GetSection("MailConfig").Get(); + if (mailConfig != null && !string.IsNullOrWhiteSpace(mailConfig.EmailServer)) + { + Console.WriteLine($"SMTP Configured for {mailConfig.EmailServer}"); + } else + { + Console.WriteLine("SMTP Not Configured"); + } + var motd = config["LUBELOGGER_MOTD"] ?? "Not Configured"; + Console.WriteLine($"Message Of The Day: {motd}"); + } } } diff --git a/Program.cs b/Program.cs index 169a9a8..a1d39ca 100644 --- a/Program.cs +++ b/Program.cs @@ -10,6 +10,9 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; var builder = WebApplication.CreateBuilder(args); +//Print Messages +StaticHelper.InitMessage(builder.Configuration); + // Add services to the container. builder.Services.AddControllersWithViews(); diff --git a/Views/Home/_Settings.cshtml b/Views/Home/_Settings.cshtml index b84844a..ec44e1c 100644 --- a/Views/Home/_Settings.cshtml +++ b/Views/Home/_Settings.cshtml @@ -212,7 +212,7 @@
- Version 1.2.5 + @($"{translator.Translate(userLanguage, "Version")} {StaticHelper.VersionNumber}")

Proudly developed in the rural town of Price, Utah by Hargata Softworks. @@ -259,28 +259,28 @@