Skip to content

Commit

Permalink
chore: bump up version to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed May 24, 2021
1 parent 446f9c1 commit ff27341
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "acme-wizard-for-console",
"version": "0.0.1",
"version": "0.0.2",
"description": "A Let's Encrypt ACME Wizard for Stella IT Console",
"main": "dist/",
"repository": "https://github.com/Stella-IT/acme-wizard-for-console",
Expand Down
67 changes: 35 additions & 32 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,44 +166,47 @@ let tokens: TokenStore | undefined = undefined;
email,
}),
);

tosAgree = await (prompts.confirm({
type: 'confirm',
name: 'tos',
message: `Do you agree to Let's Encrypt Terms of Service? (${chalk.cyanBright(
chalk.underline('https://letsencrypt.org/repository/'),
)})`,
}) as unknown as Promise<boolean>);

if (!tosAgree) {
Log.error(
"Setup can not continue. Consenting to Let's Encrypt ToS is required to issue valid certificate.",
);
return;
}

email = await (prompts.text({
type: 'text',
name: 'email',
message: 'Enter the email:',
validate: (input) => {
return /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/g.test(
input,
)
? true
: 'Not a valid email';
},
initial: email,
}) as unknown as Promise<string>);
} else {
Log.error("Setup can not continue. Account Key generation is required to request Let's Encrypt Server.");
return;
}
} else {
accountKey = choice.accountKey;
email = choice.email;
}
}

if (!accountKey) {
Log.error("Setup can not continue. Account Key generation is required to request Let's Encrypt Server.");
return;
}

tosAgree = await (prompts.confirm({
type: 'confirm',
name: 'tos',
message: `Do you agree to Let's Encrypt Terms of Service? (${chalk.cyanBright(
chalk.underline('https://letsencrypt.org/repository/'),
)})`,
}) as unknown as Promise<boolean>);

if (!tosAgree) {
Log.error("Setup can not continue. Consenting to Let's Encrypt ToS is required to issue valid certificate.");
return;
tosAgree = true;
Log.info("Skipping ToS since it was previously used in Let's Encrypt");
}
}

email = await (prompts.text({
type: 'text',
name: 'email',
message: 'Enter the email:',
validate: (input) => {
return /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/g.test(
input,
)
? true
: 'Not a valid email';
},
initial: email,
}) as unknown as Promise<string>);
} else {
Log.info("This domain was previously registered on Let's Encrypt. Skipping ToS Agreement");
tosAgree = true;
Expand Down

0 comments on commit ff27341

Please sign in to comment.