nwo creating configfile per certificate all right

This commit is contained in:
Philipp Kunz 2016-06-28 10:34:59 +02:00
parent ad792f32dd
commit 484e75ac34
5 changed files with 9 additions and 9 deletions

6
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -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"

View File

@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUNoQixxQkFBbUIsTUFBTSxDQUFDLENBQUE7QUFDMUIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFFOUIsd0JBQTJCLGlCQUFpQixDQUFDLENBQUE7QUFDN0MsSUFBWSxJQUFJLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFHdEMsSUFBSSxRQUFRLEdBQUcsSUFBSSxXQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLE9BQU8sQ0FBQyxHQUFHLEVBQUUsR0FBRyxTQUFTLENBQUMsQ0FBQztBQUVsRSxJQUFJLFFBQWtCLENBQUM7QUFFdkIsUUFBUSxDQUFDLE1BQU0sRUFBQztJQUNaLFFBQVEsQ0FBQyxTQUFTLEVBQUM7UUFDZixFQUFFLENBQUMsZ0NBQWdDLEVBQUMsVUFBUyxJQUFJO1lBQzdDLElBQUksQ0FBQyxPQUFPLENBQUMsS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AgICAgICBzc2xEaXI6IHBhdGguam9pbihwcm9jZXNzLmN3ZCgpLFwidGVzdC9hc3NldHNcIilcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGVzdENlcnQuc2hvdWxkLmJlLmluc3RhbmNlb2YoY2VydC5DZXJ0KTtcbiAgICAgICAgfSlcbiAgICAgICAgaXQoXCJzaG91bGQgZ2V0IGEgdmFsaWQgY2VydGlmaWNhdGVcIixmdW5jdGlvbihkb25lKXtcbiAgICAgICAgICAgIHRoaXMudGltZW91dCgxMjAwMDApO1xuICAgICAgICAgICAgdGVzdENlcnQuZ2V0RG9tYWluQ2VydChcInN1YjkuYmxldS5kZVwiKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlcbiAgICB9KVxufSk7Il19

View File

@ -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();
});
})

View File

@ -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,