Compare commits

...

4 Commits

Author SHA1 Message Date
bef54799b6 2.0.8 2019-01-07 00:36:51 +01:00
dbe09f320a fix(core): update 2019-01-07 00:36:51 +01:00
18045dadaf 2.0.7 2019-01-06 23:54:47 +01:00
ee300c3e12 fix(core): update 2019-01-06 23:54:46 +01:00
4 changed files with 20 additions and 9 deletions

11
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartacme", "name": "@pushrocks/smartacme",
"version": "2.0.6", "version": "2.0.8",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -137,6 +137,15 @@
"@pushrocks/smartpromise": "^2.0.5" "@pushrocks/smartpromise": "^2.0.5"
} }
}, },
"@pushrocks/smartdns": {
"version": "3.0.7",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdns/-/smartdns-3.0.7.tgz",
"integrity": "sha512-qaLuTa2CWsdEuWNA0jz8QgiZJCG5DEGkbwa2g1rUlUy40TKfiHZralkTOMrBzXGGsDv3CZDBK4U5pWlxCsTrMQ==",
"requires": {
"@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartpromise": "^2.0.5"
}
},
"@pushrocks/smartevent": { "@pushrocks/smartevent": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.3.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.3.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartacme", "name": "@pushrocks/smartacme",
"version": "2.0.6", "version": "2.0.8",
"private": false, "private": false,
"description": "acme implementation in TypeScript", "description": "acme implementation in TypeScript",
"main": "dist/index.js", "main": "dist/index.js",
@ -26,6 +26,7 @@
"homepage": "https://gitlab.com/umbrellazone/smartacme#README", "homepage": "https://gitlab.com/umbrellazone/smartacme#README",
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.2", "@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartdns": "^3.0.7",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^2.0.5",
"acme-client": "^2.2.1" "acme-client": "^2.2.1"
}, },

View File

@ -8,6 +8,7 @@ export interface ISmartAcmeStorage {}
export class SmartAcme { export class SmartAcme {
// the acme client // the acme client
private client: any; private client: any;
private smartdns = new plugins.smartdns.Smartdns();
// the account private key // the account private key
private privateKey: string; private privateKey: string;
@ -48,7 +49,7 @@ export class SmartAcme {
/* Get authorizations and select challenges */ /* Get authorizations and select challenges */
const authorizations = await this.client.getAuthorizations(order); const authorizations = await this.client.getAuthorizations(order);
const promises = authorizations.map(async authz => { for (const authz of authorizations) {
console.log(authz); console.log(authz);
const domainDnsName: string = `_acme-challenge.${authz.identifier.value}`; const domainDnsName: string = `_acme-challenge.${authz.identifier.value}`;
const dnsChallenge: string = authz.challenges.find(challengeArg => { const dnsChallenge: string = authz.challenges.find(challengeArg => {
@ -60,6 +61,8 @@ export class SmartAcme {
try { try {
/* Satisfy challenge */ /* Satisfy challenge */
await this.setChallenge(domainDnsName, keyAuthorization); await this.setChallenge(domainDnsName, keyAuthorization);
await this.smartdns.checkUntilAvailable(domainDnsName, 'TXT', keyAuthorization);
/* Verify that challenge is satisfied */ /* Verify that challenge is satisfied */
await this.client.verifyChallenge(authz, dnsChallenge); await this.client.verifyChallenge(authz, dnsChallenge);
@ -77,10 +80,7 @@ export class SmartAcme {
console.log(e); console.log(e);
} }
} }
}); }
/* Wait for challenges to complete */
await Promise.all(promises);
/* Finalize order */ /* Finalize order */
const [key, csr] = await plugins.acme.forge.createCsr({ const [key, csr] = await plugins.acme.forge.createCsr({

View File

@ -1,8 +1,9 @@
// @pushrocks scope // @pushrocks scope
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartdelay from '@pushrocks/smartdelay'; import * as smartdelay from '@pushrocks/smartdelay';
import * as smartdns from '@pushrocks/smartdns';
import * as smartpromise from '@pushrocks/smartpromise';
export { smartpromise, smartdelay }; export { smartdelay, smartdns, smartpromise };
// thirs party scope // thirs party scope
import * as acme from 'acme-client'; import * as acme from 'acme-client';