Skip to content

Commit

Permalink
Improve guides in the user interface 🏛
Browse files Browse the repository at this point in the history
Adapt to the evolution of language, names, and the organization of features.
  • Loading branch information
Viir committed May 12, 2020
1 parent 012e148 commit 67868b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace Kalmit.PersistentProcess.WebHost
{
public class Program
{
static public string AppVersionId => "2020-05-11";
static public string AppVersionId => "2020-05-12";
}
}
20 changes: 11 additions & 9 deletions implement/elm-fullstack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ CommandOption verboseLogOptionFromCommand(CommandLineApplication command) =>

app.Command("run-server", runServerCmd =>
{
runServerCmd.Description = "Run a web server supporting administration of an Elm-fullstack app via HTTP. Deployments and migrations of an app usually go through this HTTP server.";
runServerCmd.Description = "Run a web server supporting administration of an Elm-fullstack process via HTTP. This HTTP interface supports deployments, migrations, etc.";

var adminInterfaceHttpPortDefault = 4000;

var processStoreDirectoryPathOption = runServerCmd.Option("--process-store-directory-path", "Directory in the file system to contain the process store.", CommandOptionType.SingleValue).IsRequired(allowEmptyStrings: false);
var deletePreviousBackendStateOption = runServerCmd.Option("--delete-previous-backend-state", "Delete the previous state of the backend process. If you don't use this option, the server restores the last state backend on startup.", CommandOptionType.NoValue);
var deletePreviousProcessOption = runServerCmd.Option("--delete-previous-process", "Delete the previous backend process found in the given store. If you don't use this option, the server restores the process from the persistent store on startup.", CommandOptionType.NoValue);
var adminInterfaceHttpPortOption = runServerCmd.Option("--admin-interface-http-port", "Port for the admin interface HTTP web host. The default is " + adminInterfaceHttpPortDefault.ToString() + ".", CommandOptionType.SingleValue);
var adminRootPasswordOption = runServerCmd.Option("--admin-root-password", "Password to access the admin interface with the username 'root'.", CommandOptionType.SingleValue);
var publicAppUrlsOption = runServerCmd.Option("--public-urls", "URLs to serve the public app from. The default is '" + string.Join(",", Kalmit.PersistentProcess.WebHost.StartupAdminInterface.PublicWebHostUrlsDefault) + "'.", CommandOptionType.SingleValue);
var replicateProcessFromOption = runServerCmd.Option("--replicate-process-from", "Source to replicate a process from. Can be a URL to a another host admin interface or a path to an archive containing files representing the process state. This option also erases any previously-stored history like '--delete-previous-backend-state'.", CommandOptionType.SingleValue);
var replicateProcessFromOption = runServerCmd.Option("--replicate-process-from", "Source to replicate a process from. Can be a URL to a another host admin interface or a path to an archive containing files representing the process state. This option also erases any previously-stored history like '--delete-previous-process'.", CommandOptionType.SingleValue);
var replicateProcessAdminPasswordOption = runServerCmd.Option("--replicate-process-admin-password", "Used together with '--replicate-process-from' if the source requires a password to authenticate.", CommandOptionType.SingleValue);
var deployAppConfigOption = runServerCmd.Option("--deploy-app-config", "Perform a deployment on startup, analogous to deploying with the `deploy-app-config` command. Can be combined with '--replicate-process-from'.", CommandOptionType.NoValue);

Expand All @@ -94,7 +94,7 @@ CommandOption verboseLogOptionFromCommand(CommandLineApplication command) =>
var replicateProcessAdminPassword =
replicateProcessAdminPasswordOption.Value() ?? UserSecrets.LoadPasswordForSite(replicateProcessSource);

if (deletePreviousBackendStateOption.HasValue() || replicateProcessFromOption.HasValue())
if (deletePreviousProcessOption.HasValue() || replicateProcessFromOption.HasValue())
{
Console.WriteLine("Deleting the previous process state from '" + processStoreDirectoryPath + "'...");

Expand Down Expand Up @@ -153,7 +153,7 @@ CommandOption verboseLogOptionFromCommand(CommandLineApplication command) =>
deployAppConfig(
site: "http://localhost:" + adminInterfaceHttpPort,
sitePassword: adminRootPasswordOption.Value(),
initElmAppState: deletePreviousBackendStateOption.HasValue() && !replicateProcessFromOption.HasValue());
initElmAppState: deletePreviousProcessOption.HasValue() && !replicateProcessFromOption.HasValue());
}

Microsoft.AspNetCore.Hosting.WebHostExtensions.WaitForShutdown(webHost);
Expand Down Expand Up @@ -226,6 +226,8 @@ CommandOption verboseLogOptionFromCommand(CommandLineApplication command) =>

app.Command("truncate-process-history", truncateProcessHistoryCmd =>
{
truncateProcessHistoryCmd.Description = "Remove parts of the process history from the persistent store, which are not needed to restore the process.";

var siteAndPasswordFromCmd = siteAndSitePasswordOptionsOnCommand(truncateProcessHistoryCmd);

truncateProcessHistoryCmd.OnExecute(() =>
Expand All @@ -245,17 +247,17 @@ CommandOption verboseLogOptionFromCommand(CommandLineApplication command) =>

app.Command("user-secrets", userSecretsCmd =>
{
userSecretsCmd.Description = "Manage user secrets to use with 'deploy' or replication.";
userSecretsCmd.Description = "Manage passwords for accessing the admin interfaces of servers.";

userSecretsCmd.Command("store", userSecretsCmd =>
{
var siteArgument = userSecretsCmd.Argument("site", "Site where to use this secret as password.", multipleValues: false).IsRequired(allowEmptyStrings: false);
var passwordArgument = userSecretsCmd.Argument("password", "Password to use for authentication.", multipleValues: false).IsRequired(allowEmptyStrings: false);

userSecretsCmd.OnExecute(() =>
{
UserSecrets.StorePasswordForSite(siteArgument.Value, passwordArgument.Value);
});
{
UserSecrets.StorePasswordForSite(siteArgument.Value, passwordArgument.Value);
});
});
});

Expand Down
4 changes: 2 additions & 2 deletions implement/elm-fullstack/elm-fullstack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>elm_fullstack</RootNamespace>
<AssemblyName>elm-fullstack</AssemblyName>
<AssemblyVersion>2020.0511.0.0</AssemblyVersion>
<FileVersion>2020.0511.0.0</FileVersion>
<AssemblyVersion>2020.0512.0.0</AssemblyVersion>
<FileVersion>2020.0512.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 67868b7

Please sign in to comment.