From 1c2063ef826a9a71c69b8830988560391cd50146 Mon Sep 17 00:00:00 2001 From: PhilKunz Date: Fri, 22 Jul 2016 02:59:11 +0200 Subject: [PATCH] now retrying --- dist/cert.helpers.d.ts | 2 ++ dist/cert.helpers.js | 11 ++++++++++- dist/index.js | 26 ++++++++++++++++---------- test/test.js | 8 ++++---- test/test.ts | 6 +++--- ts/cert.helpers.ts | 19 +++++++++++++------ ts/index.ts | 23 ++++++++++++++--------- 7 files changed, 62 insertions(+), 33 deletions(-) diff --git a/dist/cert.helpers.d.ts b/dist/cert.helpers.d.ts index 3a4bbf5..612c343 100644 --- a/dist/cert.helpers.d.ts +++ b/dist/cert.helpers.d.ts @@ -1,3 +1,5 @@ /// +import { Cert } from "./index.ts"; import * as plugins from "./cert.plugins"; export declare let accountsKeyPresent: () => plugins.q.Promise<{}>; +export declare let scheduleRetry: (domainArg: string, certClassArg: Cert) => plugins.q.Promise<{}>; diff --git a/dist/cert.helpers.js b/dist/cert.helpers.js index 3a3afca..f08462b 100644 --- a/dist/cert.helpers.js +++ b/dist/cert.helpers.js @@ -1,6 +1,7 @@ "use strict"; const plugins = require("./cert.plugins"); let firstCall = true; +let enoughTime = false; exports.accountsKeyPresent = () => { let done = plugins.q.defer(); if (firstCall) { @@ -13,4 +14,12 @@ exports.accountsKeyPresent = () => { ; return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2VydC5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFZLE9BQU8sV0FBTSxnQkFBZ0IsQ0FBQyxDQUFBO0FBRzFDLElBQUksU0FBUyxHQUFHLElBQUksQ0FBQztBQUNWLDBCQUFrQixHQUFHO0lBQzVCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFDLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQztRQUNaLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUNmLFNBQVMsR0FBRyxLQUFLLENBQUM7SUFDdEIsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ0osVUFBVSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDbkMsQ0FBQztJQUFBLENBQUM7SUFFRixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ== \ No newline at end of file +exports.scheduleRetry = (domainArg, certClassArg) => { + let done = plugins.q.defer(); + setTimeout(() => { + certClassArg.getDomainCert(domainArg) + .then(done.resolve); + }, 5000); + return done.promise; +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2VydC5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxNQUFZLE9BQU8sV0FBTSxnQkFBZ0IsQ0FBQyxDQUFBO0FBRzFDLElBQUksU0FBUyxHQUFHLElBQUksQ0FBQztBQUNyQixJQUFJLFVBQVUsR0FBRyxLQUFLLENBQUM7QUFDWiwwQkFBa0IsR0FBRztJQUM1QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFDWixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDZixTQUFTLEdBQUcsS0FBSyxDQUFDO0lBQ3RCLENBQUM7SUFBRSxJQUFJLENBQUMsQ0FBQztRQUNMLFVBQVUsQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFDLElBQUksQ0FBQyxDQUFDO0lBQ2xDLENBQUM7SUFBQSxDQUFDO0lBQ0YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDO0FBRVMscUJBQWEsR0FBRyxDQUFDLFNBQWdCLEVBQUMsWUFBaUI7SUFDMUQsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixVQUFVLENBQUM7UUFDUCxZQUFZLENBQUMsYUFBYSxDQUFDLFNBQVMsQ0FBQzthQUNoQyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQzVCLENBQUMsRUFBQyxJQUFJLENBQUMsQ0FBQztJQUNSLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 7fffaa4..55f9a9d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -74,17 +74,23 @@ class Cert { plugins.smartfile.fs.ensureDir(paths.certDir); plugins.beautylog.info(`getting cert for ${domainNameArg}`); plugins.shelljs.exec(`bash -c "${paths.letsencryptSh} -c --no-lock -f ${paths.leShConfig} -d ${domainNameArg} -t dns-01 -k ${paths.certHook} -o ${paths.certDir}"`, { - silent: true, - async: true + silent: true }, (codeArg, stdoutArg) => { - console.log(stdoutArg); - let fetchedCertsArray = plugins.smartfile.fs.listFoldersSync(paths.certDir); - if (fetchedCertsArray.indexOf(domainNameArg) != -1) { - updateSslDirSync(this._sslDir, domainNameArg); - plugins.smartfile.fs.removeSync(plugins.path.join(paths.certDir, domainNameArg)); + if (codeArg == 0) { + console.log(stdoutArg); + let fetchedCertsArray = plugins.smartfile.fs.listFoldersSync(paths.certDir); + if (fetchedCertsArray.indexOf(domainNameArg) != -1) { + updateSslDirSync(this._sslDir, domainNameArg); + plugins.smartfile.fs.removeSync(plugins.path.join(paths.certDir, domainNameArg)); + } + this.domainsCurrentlyRequesting.removeString(domainNameArg); + done.resolve(); + } + else { + this.domainsCurrentlyRequesting.removeString(domainNameArg); + plugins.beautylog.warn(`${domainNameArg} scheduled for retry`); + helpers.scheduleRetry(domainNameArg, this).then(done.resolve); } - this.domainsCurrentlyRequesting.removeString(domainNameArg); - done.resolve(); }); } else { @@ -150,4 +156,4 @@ let updateSslDirSync = (sslDirArg, domainNameArg) => { let updateGitOrigin = (syncDirectionArg) => { }; updateGitOrigin(0 /* toOrigin */); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBWSxPQUFPLFdBQU0sZ0JBQWdCLENBQUMsQ0FBQTtBQUMxQyxNQUFZLEtBQUssV0FBTSxjQUFjLENBQUMsQ0FBQTtBQUN0QyxNQUFZLE9BQU8sV0FBTSxnQkFFekIsQ0FBQyxDQUZ3QztBQVF4QyxDQUFDO0FBRUY7SUFVSTs7T0FFRztJQUNILFlBQVksVUFBbUM7UUFQL0MsK0JBQTBCLEdBQTBCLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxTQUFTLEVBQUUsQ0FBQztRQTZDaEY7O1dBRUc7UUFDSCxxQkFBZ0IsR0FBRztZQUNmLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDO2dCQUN0QixPQUFPLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxRQUFRLENBQUMsQ0FBQztZQUM1RCxDQUFDO1FBQ0wsQ0FBQyxDQUFDO1FBRUY7O1dBRUc7UUFDSCw4QkFBeUIsR0FBRztZQUN4QixFQUFFLENBQ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Q0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ2pFLElBQUksVUFBVSxHQUFlO1lBQ3pCLFVBQVUsRUFBRSxhQUFhO1lBQ3pCLE9BQU8sRUFBRSxRQUFRO1lBQ2pCLE9BQU8sRUFBRSxRQUFRLEdBQUcsT0FBTztTQUM5QixDQUFDO1FBQ0YsT0FBTyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUM3QixJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxFQUMxQixPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsYUFBYSxFQUFFLGFBQWEsQ0FBQyxDQUM3RCxDQUFDO0lBQ04sQ0FBQztJQUFBLENBQUM7QUFDTixDQUFDLENBQUE7QUFPRCxJQUFJLGVBQWUsR0FBRyxDQUFDLGdCQUFrQztBQUV6RCxDQUFDLENBQUM7QUFFRixlQUFlLENBQUMsZ0JBQXlCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/test/test.js b/test/test.js index 9901de3..308ec63 100644 --- a/test/test.js +++ b/test/test.js @@ -32,13 +32,13 @@ describe("cert", function () { it("should get a valid certificate", function (done) { this.timeout(120000); let promiseArray = []; - promiseArray.push(testCert.getDomainCert("testing1.bleu.de")); - promiseArray.push(testCert.getDomainCert("testing2.bleu.de")); - promiseArray.push(testCert.getDomainCert("testing3.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing8.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing9.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing10.bleu.de")); q.all(promiseArray).then(() => { done(); }); }); }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDL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.ts @@ -35,9 +35,9 @@ describe("cert",function(){ it("should get a valid certificate",function(done){ this.timeout(120000); let promiseArray = []; - promiseArray.push(testCert.getDomainCert("testing1.bleu.de")); - promiseArray.push(testCert.getDomainCert("testing2.bleu.de")); - promiseArray.push(testCert.getDomainCert("testing3.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing8.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing9.bleu.de")); + promiseArray.push(testCert.getDomainCert("testing10.bleu.de")); q.all(promiseArray).then(() => { done(); }); diff --git a/ts/cert.helpers.ts b/ts/cert.helpers.ts index fd6c697..d1c728e 100644 --- a/ts/cert.helpers.ts +++ b/ts/cert.helpers.ts @@ -1,18 +1,25 @@ +import {Cert} from "./index.ts"; import * as plugins from "./cert.plugins"; import * as paths from "./cert.paths"; let firstCall = true; -let accountKeyPresent = true; +let enoughTime = false; export let accountsKeyPresent = () => { let done = plugins.q.defer(); if (firstCall) { done.resolve(); firstCall = false; - setTimeout(() => {accountKeyPresent = true},5000); - } else if(accountKeyPresent){ - done.resolve() - } else { - setTimeout(done.resolve, 5000); + }  else { + setTimeout(done.resolve,5000); }; return done.promise; +}; + +export let scheduleRetry = (domainArg:string,certClassArg:Cert) => { + let done = plugins.q.defer(); + setTimeout(() => { + certClassArg.getDomainCert(domainArg) + .then(done.resolve); + },5000); + return done.promise; }; \ No newline at end of file diff --git a/ts/index.ts b/ts/index.ts index cbead4d..02c565d 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -96,18 +96,23 @@ export class Cert { plugins.shelljs.exec( `bash -c "${paths.letsencryptSh} -c --no-lock -f ${paths.leShConfig} -d ${domainNameArg} -t dns-01 -k ${paths.certHook} -o ${paths.certDir}"`, { - silent: true, - async: true + silent: true }, (codeArg, stdoutArg) => { - console.log(stdoutArg); - let fetchedCertsArray: string[] = plugins.smartfile.fs.listFoldersSync(paths.certDir); - if (fetchedCertsArray.indexOf(domainNameArg) != -1) { - updateSslDirSync(this._sslDir, domainNameArg); - plugins.smartfile.fs.removeSync(plugins.path.join(paths.certDir, domainNameArg)); + if (codeArg == 0) { + console.log(stdoutArg); + let fetchedCertsArray: string[] = plugins.smartfile.fs.listFoldersSync(paths.certDir); + if (fetchedCertsArray.indexOf(domainNameArg) != -1) { + updateSslDirSync(this._sslDir, domainNameArg); + plugins.smartfile.fs.removeSync(plugins.path.join(paths.certDir, domainNameArg)); + } + this.domainsCurrentlyRequesting.removeString(domainNameArg); + done.resolve(); + } else { + this.domainsCurrentlyRequesting.removeString(domainNameArg); + plugins.beautylog.warn(`${domainNameArg} scheduled for retry`); + helpers.scheduleRetry(domainNameArg,this).then(done.resolve); } - this.domainsCurrentlyRequesting.removeString(domainNameArg); - done.resolve(); } ); } else {