Scaffold Settings.yml if it doesn't exist

dhcp-server
Pat Hartl 2023-08-08 20:33:18 -05:00
parent fcd48342b5
commit 3a43f05ce1
1 changed files with 22 additions and 1 deletions

View File

@ -22,7 +22,28 @@ namespace LANCommander.Services
return deserializer.Deserialize<LANCommanderSettings>(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)