Ensure consistent server and storage arguments, fix storage path for setup

This commit is contained in:
Niklas Keller
2016-03-23 20:02:25 +01:00
parent 9ea97f18e1
commit c36ced9b7c
6 changed files with 42 additions and 58 deletions

View File

@@ -36,7 +36,7 @@ class Setup implements Command {
$path = "accounts/{$keyFile}.pem";
$bits = 4096;
$keyStore = new KeyStore(\Kelunik\AcmeClient\normalizePath($args->get("storage")) . "/data");
$keyStore = new KeyStore(\Kelunik\AcmeClient\normalizePath($args->get("storage")));
try {
$keyPair = (yield $keyStore->get($path));
@@ -78,26 +78,16 @@ class Setup implements Command {
}
public static function getDefinition() {
$isPhar = \Kelunik\AcmeClient\isPhar();
return [
"server" => [
"prefix" => "s",
"longPrefix" => "server",
"description" => "ACME server to use for registration and issuance of certificates.",
"required" => true,
],
"server" => \Kelunik\AcmeClient\getArgumentDescription("server"),
"storage" => \Kelunik\AcmeClient\getArgumentDescription("storage"),
"email" => [
"longPrefix" => "email",
"description" => "E-mail for important issues, will be sent to the ACME server.",
"required" => true,
],
"storage" => [
"longPrefix" => "storage",
"description" => "Storage directory for account keys and certificates.",
"required" => $isPhar,
"defaultValue" => $isPhar ? null : (__DIR__ . "/../../data")
]
];
}
}