diff options
| author | Leitwolf | 2026-10-29 16:34:29 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-29 16:34:29 +0300 |
| commit | 6b4e5e403875d3648be383395f1dad50f0d6503d (patch) | |
| tree | 673620dce10f2723d8badf68b3b30de19ad8e6e0 /apps/api/Program.cs | |
| parent | 0c0bbeab246a94035b572ce47d3502de997ac58a (diff) | |
| parent | 3749e30da561652a226017d9360b84e34a8b74fc (diff) | |
| download | progmaweb-6b4e5e403875d3648be383395f1dad50f0d6503d.tar.gz | |
Merge pull request #50 from Progmasoft/feature/provision-reserved-accounts
Provision the reserved accounts on the server
Diffstat (limited to 'apps/api/Program.cs')
| -rw-r--r-- | apps/api/Program.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/api/Program.cs b/apps/api/Program.cs index 873c120..6208b30 100644 --- a/apps/api/Program.cs +++ b/apps/api/Program.cs @@ -13,8 +13,10 @@ using Progmasoft.Progmaweb.Api.ViGet; // `viget ...` runs a command of ViGet with the configuration of the service instead of the service itself; its // arguments are not configuration. +// `accounts ...` provisions a reserved account the same way. bool vigetCommand = ViGetCommand.IsCommand(args); -WebApplicationBuilder builder = WebApplication.CreateBuilder(vigetCommand ? [] : args); +bool accountCommand = args is ["accounts", ..]; +WebApplicationBuilder builder = WebApplication.CreateBuilder(vigetCommand || accountCommand ? [] : args); builder.Services.Configure<AccountSessionOptions>(builder.Configuration.GetSection(AccountSessionOptions.SectionName)); builder.Services.AddSingleton(TimeProvider.System); @@ -109,6 +111,13 @@ builder.WebHost.ConfigureKestrel(options => options.Limits.MaxRequestBodySize = WebApplication app = builder.Build(); +if (accountCommand) +{ + Environment.ExitCode = await AccountCommand.RunAsync( + app.Services, args[1..], new ConsolePasswordInput(), Console.Out, Console.Error, CancellationToken.None); + return; +} + if (vigetCommand) { Environment.ExitCode = await ViGetCommand.RunAsync( |