From 484e75ac34ace3fd9af09c25981bf3d574247089 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 28 Jun 2016 10:34:59 +0200 Subject: [PATCH] nwo creating configfile per certificate all right --- dist/index.js | 6 +++--- package.json | 2 +- test/test.js | 4 ++-- test/test.ts | 2 +- ts/index.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist/index.js b/dist/index.js index 10819b5..3cfce55 100644 --- a/dist/index.js +++ b/dist/index.js @@ -53,8 +53,8 @@ var updateSslDirSync = function (sslDirArg, domainNameArg) { plugins.smartfile.fs.copySync(plugins.path.join(domainCertFolder, "fullchain.pem"), plugins.path.join(sslDirArg, domainNameArg, "fullchain.pem")); plugins.smartfile.fs.copySync(plugins.path.join(domainCertFolder, "privkey.pem"), plugins.path.join(sslDirArg, domainNameArg, "privkey.pem")); // create cert config - var certRegex = /.*\-([]0-9]*)\.pem/; - var certFileNameWithTime = plugins.smartfile.fs.listFilesSync(domainCertFolder, certRegex)[1]; + var certRegex = /.*\-([0-9]*)\.pem/; + var certFileNameWithTime = plugins.smartfile.fs.listFilesSync(domainCertFolder, certRegex)[0]; var certTime = parseInt(certRegex.exec(certFileNameWithTime)[1]); var certConfig = { domainName: domainNameArg, @@ -68,4 +68,4 @@ var updateSslDirSync = function (sslDirArg, domainNameArg) { var updateGitOrigin = function () { }; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxnQkFBZ0IsQ0FBQyxDQUFBO0FBQzFDLElBQVksS0FBSyxXQUFNLGNBQWMsQ0FBQyxDQUFBO0FBRXRDO0lBT0ksY0FBWSxVQUtYO1FBQ0csSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsT0FBTyxDQUFDO1FBQ25DLElBQUksQ0FBQyxNQUFNLEdBQU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AgICAgICk7XG4gICAgICAgIC8vIGNyZWF0ZSBjZXJ0IGNvbmZpZ1xuICAgICAgICBsZXQgY2VydFJlZ2V4ID0gLy4qXFwtKFtdMC05XSopXFwucGVtLztcbiAgICAgICAgbGV0IGNlcnRGaWxlTmFtZVdpdGhUaW1lID0gcGx1Z2lucy5zbWFydGZpbGUuZnMubGlzdEZpbGVzU3luYyhkb21haW5DZXJ0Rm9sZGVyLGNlcnRSZWdleClbMV07XG4gICAgICAgIGxldCBjZXJ0VGltZSA9IHBhcnNlSW50KGNlcnRSZWdleC5leGVjKGNlcnRGaWxlTmFtZVdpdGhUaW1lKVsxXSk7XG4gICAgICAgIGxldCBjZXJ0Q29uZmlnOmNlcnRDb25maWcgPSB7XG4gICAgICAgICAgICBkb21haW5OYW1lOiBkb21haW5OYW1lQXJnLFxuICAgICAgICAgICAgY3JlYXRlZDogY2VydFRpbWUsXG4gICAgICAgICAgICBleHBpcmVzOiBjZXJ0VGltZSArIDc3NzYwMDBcbiAgICAgICAgfTtcbiAgICAgICAgcGx1Z2lucy5zbWFydGZpbGUubWVtb3J5LnRvRnMoXG4gICAgICAgICAgICBKU09OLnN0cmluZ2lmeShjZXJ0Q29uZmlnKSxcbiAgICAgICAgICAgIHBsdWdpbnMucGF0aC5qb2luKHNzbERpckFyZyxkb21haW5OYW1lQXJnLFwiY29uZmlnLmpzb25cIilcbiAgICAgICAgKTtcbiAgICB9O1xufVxuXG5sZXQgdXBkYXRlR2l0T3JpZ2luID0gKCkgPT4ge1xuXG59Il19 +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxnQkFBZ0IsQ0FBQyxDQUFBO0FBQzFDLElBQVksS0FBSyxXQUFNLGNBQWMsQ0FBQyxDQUFBO0FBRXRDO0lBT0ksY0FBWSxVQUtYO1FBQ0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ICAgICAgICAgICBwbHVnaW5zLnBhdGguam9pbihzc2xEaXJBcmcsZG9tYWluTmFtZUFyZyxcInByaXZrZXkucGVtXCIpXG4gICAgICAgICk7XG4gICAgICAgIC8vIGNyZWF0ZSBjZXJ0IGNvbmZpZ1xuICAgICAgICBsZXQgY2VydFJlZ2V4ID0gLy4qXFwtKFswLTldKilcXC5wZW0vO1xuICAgICAgICBsZXQgY2VydEZpbGVOYW1lV2l0aFRpbWU6c3RyaW5nID0gcGx1Z2lucy5zbWFydGZpbGUuZnMubGlzdEZpbGVzU3luYyhkb21haW5DZXJ0Rm9sZGVyLGNlcnRSZWdleClbMF07XG4gICAgICAgIGxldCBjZXJ0VGltZSA9IHBhcnNlSW50KGNlcnRSZWdleC5leGVjKGNlcnRGaWxlTmFtZVdpdGhUaW1lKVsxXSk7XG4gICAgICAgIGxldCBjZXJ0Q29uZmlnOmNlcnRDb25maWcgPSB7XG4gICAgICAgICAgICBkb21haW5OYW1lOiBkb21haW5OYW1lQXJnLFxuICAgICAgICAgICAgY3JlYXRlZDogY2VydFRpbWUsXG4gICAgICAgICAgICBleHBpcmVzOiBjZXJ0VGltZSArIDc3NzYwMDBcbiAgICAgICAgfTtcbiAgICAgICAgcGx1Z2lucy5zbWFydGZpbGUubWVtb3J5LnRvRnMoXG4gICAgICAgICAgICBKU09OLnN0cmluZ2lmeShjZXJ0Q29uZmlnKSxcbiAgICAgICAgICAgIHBsdWdpbnMucGF0aC5qb2luKHNzbERpckFyZyxkb21haW5OYW1lQXJnLFwiY29uZmlnLmpzb25cIilcbiAgICAgICAgKTtcbiAgICB9O1xufVxuXG5sZXQgdXBkYXRlR2l0T3JpZ2luID0gKCkgPT4ge1xuXG59Il19 diff --git a/package.json b/package.json index a7bf53b..5b8de47 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "q": "^1.4.1", "shelljs": "^0.7.0", "smartcli": "^1.0.4", - "smartfile": "^4.0.7", + "smartfile": "^4.0.8", "smartgit": "0.1.0", "smartstring": "^2.0.10", "typings-global": "^1.0.3" diff --git a/test/test.js b/test/test.js index e0ab7b7..f5184cc 100644 --- a/test/test.js +++ b/test/test.js @@ -27,11 +27,11 @@ describe("cert", function () { }); it("should get a valid certificate", function (done) { this.timeout(120000); - testCert.getDomainCert("sub7.bleu.de").then(function () { + testCert.getDomainCert("sub9.bleu.de").then(function () { done(); }); }); }); }); -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUNoQixxQkFBbUIsTUFBTSxDQUFDLENBQUE7QUFDMUIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFFOUIsd0JBQTJCLGlCQUFpQixDQUFDLENBQUE7QUFDN0MsSUFBWSxJQUFJLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFHdEMsSUFBSSxRQUFRLEdBQUcsSUFBSSxXQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLE9BQU8sQ0FBQyxHQUFHLEVBQUUsR0FBRyxTQUFTLENBQUMsQ0FBQztBQUVsRSxJQUFJLFFBQWtCLENBQUM7QUFFdkIsUUFBUSxDQUFDLE1BQU0sRUFBQztJQUNaLFFBQVEsQ0FBQyxTQUFTLEVBQUM7UUFDZixFQUFFLENBQUMsZ0NBQWdDLEVBQUMsVUFBUyxJQUFJO1lBQzdDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7WUFDbkIsc0JBQVksRUFBRSxDQUFDLElBQUksQ0FBQztnQkFDaEIsSUFBSSxFQUFFLENBQUM7WUFDWCxDQUFDLENBQUMsQ0FBQTtRQUNOLENBQUMsQ0FBQyxDQUFBO0lBQ04sQ0FBQyxDQUFDLENBQUE7SUFDRixRQU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gICAgaXQoXCJzaG91bGQgZ2V0IGEgdmFsaWQgY2VydGlmaWNhdGVcIixmdW5jdGlvbihkb25lKXtcbiAgICAgICAgICAgIHRoaXMudGltZW91dCgxMjAwMDApO1xuICAgICAgICAgICAgdGVzdENlcnQuZ2V0RG9tYWluQ2VydChcInN1YjkuYmxldS5kZVwiKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlcbiAgICB9KVxufSk7Il19 diff --git a/test/test.ts b/test/test.ts index 91ba5f3..efb81fe 100644 --- a/test/test.ts +++ b/test/test.ts @@ -31,7 +31,7 @@ describe("cert",function(){ }) it("should get a valid certificate",function(done){ this.timeout(120000); - testCert.getDomainCert("sub7.bleu.de").then(() => { + testCert.getDomainCert("sub9.bleu.de").then(() => { done(); }); }) diff --git a/ts/index.ts b/ts/index.ts index 20f49e1..878b39b 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -75,8 +75,8 @@ let updateSslDirSync = (sslDirArg:string,domainNameArg:string) => { plugins.path.join(sslDirArg,domainNameArg,"privkey.pem") ); // create cert config - let certRegex = /.*\-([]0-9]*)\.pem/; - let certFileNameWithTime = plugins.smartfile.fs.listFilesSync(domainCertFolder,certRegex)[1]; + let certRegex = /.*\-([0-9]*)\.pem/; + let certFileNameWithTime:string = plugins.smartfile.fs.listFilesSync(domainCertFolder,certRegex)[0]; let certTime = parseInt(certRegex.exec(certFileNameWithTime)[1]); let certConfig:certConfig = { domainName: domainNameArg,