48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using Autofac;
|
|
|
|
namespace SetupInfrastructure
|
|
{
|
|
/// <summary>
|
|
/// SETUP APPLICATION USER NAMED sathumper
|
|
///
|
|
/// This should be handled on the Postgresql db server with a superadmin or similar.
|
|
///
|
|
/// Execute SQL CreateRole.txt
|
|
///
|
|
/// After that is executed it is time for running this main program
|
|
/// Remember to use the newly created sathumper
|
|
/// "ConnectionStrings": {
|
|
/// "DefaultConnection": "Host=192.168.1.57;Port=5432;Database=ptdb01;User Id=sathumper;Password=<secret>;"
|
|
/// </summary>
|
|
internal class Program
|
|
{
|
|
static async Task Main(string[] args)
|
|
{
|
|
string userPass;
|
|
do
|
|
{
|
|
Console.WriteLine("Input username:password");
|
|
userPass = Console.ReadLine() ?? string.Empty;
|
|
} while (!userPass.Contains(":") || userPass.Split(":").Length != 2 ||
|
|
string.IsNullOrEmpty(userPass.Split(":")[0]) ||
|
|
string.IsNullOrEmpty(userPass.Split(":")[1]));
|
|
|
|
var ctp = new Startup.ConnectionStringTemplateParameters(
|
|
user: userPass.Split(":")[0],
|
|
pwd: userPass.Split(":")[1]
|
|
);
|
|
var container = new Startup().ConfigureContainer(ctp);
|
|
|
|
|
|
// SetupIdentitySystem
|
|
// ConfigurationDatabaseSetup
|
|
// input configurations!!! TODO:Missing
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|