Skip to content

Commit

Permalink
Update CLI output with the DNS validation record info
Browse files Browse the repository at this point in the history
  • Loading branch information
dvonlehman committed Jan 27, 2018
1 parent cd2508b commit 09dafdc
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 29 deletions.
77 changes: 57 additions & 20 deletions commands/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,61 @@ function domainStatus(program) {
switch (domain.status.toUpperCase()) {
case 'CERTIFICATE_PENDING':
output(chalk.dim('Domain status:'));
output(
wordwrap(4, 80)(
'Certificate is still pending. A validation email was ' +
'sent to the email on the WHOIS record for the domain as well as ' +
'admin@' +
domain.domainName +
' and webmaster@' +
domain.domainName +
". If it's been more than 5 minutes since you registered the domain with Aerobatic, see " +
'these troubleshooting tips: ' +
chalk.yellow(TROUBLESHOOTING_URL)
)
);
output.blankLine();
output(
' You can trigger the validation email to be resent by running:'
);
output(' ' + output.command('aero domain --reset'));

if (_.isObject(domain.dnsValidationRecord)) {
output(
wordwrap(4, 80)(
'In order to begin the provisioning of this domain, you first need to ' +
'validate that you are the rightful owner. This is done by creating the ' +
'following CNAME with your DNS provider:'
)
);

output.blankLine();
output(' Name: ' + chalk.bold(domain.dnsValidationRecord.name));
output(
' Value: ' + chalk.bold(domain.dnsValidationRecord.value)
);
output.blankLine();

output(
wordwrap(4, 80)(
"If you've already created the record, it can take up to an hour " +
'(occasionally longer) for the record to be recoginized. An email will ' +
'be sent to ' +
chalk.underline(domain.contactEmail) +
' once validation is complete. You can always ' +
'check on the current status of your domain by re-running this same CLI command.'
)
);

output.blankLine();
output(
wordwrap(4, 80)(
chalk.bold('IMPORTANT:') +
' do not delete this CNAME after validation. It will be re-checked every time the certificate renews itself.'
)
);
} else {
output(
wordwrap(4, 80)(
'Certificate is still pending. A validation email was ' +
'sent to the email on the WHOIS record for the domain as well as ' +
'admin@' +
domain.domainName +
' and webmaster@' +
domain.domainName +
". If it's been more than 5 minutes since you registered the domain with Aerobatic, see " +
'these troubleshooting tips: ' +
chalk.yellow(TROUBLESHOOTING_URL)
)
);
output.blankLine();
output(
' You can trigger the validation email to be resent by running:'
);
output(' ' + output.command('aero domain --reset'));
}
output.blankLine();
output(
wordwrap(4, 80)(
Expand All @@ -165,7 +202,7 @@ function domainStatus(program) {
'Your certificate has been approved and your CDN distribution ' +
'is being provisioned. An email with instructions on setting up your DNS records will ' +
'be sent to ' +
domain.contactEmail +
chalk.underline(domain.contactEmail) +
' as soon as that completes. The process take anywhere ' +
'from 30-60 minutes from the time the link in the validation email was clicked.'
)
Expand All @@ -181,7 +218,7 @@ function domainStatus(program) {
wordwrap(4, 80)(
'Your SSL certificate and CDN distribution are fully provisioned. An email with ' +
'DNS instructions should have been sent to ' +
domain.contactEmail +
chalk.underline(domain.contactEmail) +
'. Full details on configuring ' +
'DNS at: ' +
chalk.yellow(DNS_SETUP_URL)
Expand Down
6 changes: 1 addition & 5 deletions commands/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,11 @@ domain:
- name: subdomain
short: N
summary: The subdomain you want your website to be accessible at. For apex domain use the value '@'.
- name: reset
short: R
summary: Resend the validation email


examples:
- 'aero domain --name mydomain.com --subdomain www # Register domain for website with sub-domain'
- 'aero domain --name mydomain.com --subdomain @ # Register apex domain for website'
- 'aero domain # Get information about the current domain'
- 'aero domain -R # Resend the validation email'

env:
summary: Set or retrieve environment variables
Expand Down
1 change: 0 additions & 1 deletion config/production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# apiUrl: https://aerobatic.com/api
apiUrl: https://api.aerobatic.com
deployBucket: aerobatic-deploy-staging
userConfigFile: .aerorc.yml
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "aerobatic-cli",
"version": "1.0.48",
"version": "1.1.0",
"description": "Command line interface for Aerobatic static hosting platform",
"main": "bin/aero",
"bin": {
"aero": "./bin/aero.js"
},
"preferGlobal": true,
"scripts": {
"format": "prettier --write --print-width 80 --single-quote \"{lib,commands,bin,test}/**/*.js\"",
"format":
"prettier --write --print-width 80 --single-quote \"{lib,commands,bin,test}/**/*.js\"",
"lint": "eslint --ext .js \"**/*.js\"",
"check": "npm run lint && npm run test",
"test": "UNIT_TEST=1 mocha test --recursive",
"test-travis": "UNIT_TEST=1 istanbul cover mocha --report lcovonly -- --reporter spec --check-leaks test/ --recursive"
"test-travis":
"UNIT_TEST=1 istanbul cover mocha --report lcovonly -- --reporter spec --check-leaks test/ --recursive"
},
"license": "ISC",
"repository": "aerobatic/aerobatic-cli",
Expand Down

0 comments on commit 09dafdc

Please sign in to comment.