From 3a43f05ce16ada6e1bff9c1d8f032fe5e7176f64 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Tue, 8 Aug 2023 20:33:18 -0500 Subject: [PATCH] Scaffold Settings.yml if it doesn't exist --- LANCommander/Services/SettingService.cs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/LANCommander/Services/SettingService.cs b/LANCommander/Services/SettingService.cs index 548f565..c5170f6 100644 --- a/LANCommander/Services/SettingService.cs +++ b/LANCommander/Services/SettingService.cs @@ -22,7 +22,28 @@ namespace LANCommander.Services return deserializer.Deserialize(contents); } else - return new LANCommanderSettings(); + { + var settings = new LANCommanderSettings + { + Port = 1337, + Beacon = true, + DatabaseConnectionString = "Data Source=LANCommander.db;Cache=Shared", + Authentication = new LANCommanderAuthenticationSettings + { + TokenSecret = Guid.NewGuid().ToString(), + TokenLifetime = 30, + PasswordRequireNonAlphanumeric = false, + PasswordRequireLowercase = false, + PasswordRequireUppercase = false, + PasswordRequireDigit = true, + PasswordRequiredLength = 6 + } + }; + + SaveSettings(settings); + + return settings; + } } public static void SaveSettings(LANCommanderSettings settings)