implement Git Repo Sync

This commit is contained in:
Philipp Kunz 2016-07-04 04:56:49 +02:00
parent d06c7059bb
commit ee844fd348
15 changed files with 79 additions and 31 deletions

1
dist/cert.hook.d.ts vendored
View File

@ -1 +0,0 @@
import "typings-global";

3
dist/cert.hook.js vendored Normal file → Executable file
View File

@ -1,6 +1,5 @@
#!/usr/bin/env node
"use strict";
require("typings-global");
var plugins = require("./cert.plugins");
var paths = require("./cert.paths");
var smartcli = new plugins.smartcli.Smartcli();
@ -63,4 +62,4 @@ smartcli.addCommand({
cleanChallenge(argv._[1]);
});
smartcli.startParse();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5ob29rLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2VydC5ob29rLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGdCQUFnQixDQUFDLENBQUE7QUFDMUMsSUFBWSxLQUFLLFdBQU0sY0FBYyxDQUFDLENBQUE7QUFFdEMsSUFBSSxRQUFRLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBRS9DLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDN0QsSUFBSSxNQUFNLEdBQUcsSUFBSSxPQUFPLENBQUMsTUFBTSxDQUFDLGFBQWEsRUFBRSxDQUFDO0FBQ2hELE1BQU0sQ0FBQyxJQUFJLENBQUM7SUFDUixLQUFLLEVBQUUsTUFBTSxDQUFDLE9BQU87SUFDckIsR0FBRyxFQUFFLE1BQU0sQ0FBQyxLQUFLO0NBQ3BCLENBQUMsQ0FBQztBQUVILElBQUksWUFBWSxHQUFHL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LENBQUM7UUFDTCxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDYixDQUFDLENBQUE7SUFDRCxlQUFlLEVBQUUsQ0FBQztJQUNsQixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUE7QUFFRCxJQUFJLFVBQVUsR0FBRyxVQUFDLGFBQXFCO0lBQ25DLE1BQU0sQ0FBQyxrQkFBa0IsR0FBRyxhQUFhLENBQUM7QUFDOUMsQ0FBQyxDQUFBO0FBRUQsUUFBUSxDQUFDLFVBQVUsQ0FBQztJQUNoQixXQUFXLEVBQUUsa0JBQWtCO0NBQ2xDLENBQUMsQ0FBQyxJQUFJLENBQUMsVUFBQyxJQUFJO0lBQ1QsWUFBWSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3ZDLENBQUMsQ0FBQyxDQUFDO0FBRUgsUUFBUSxDQUFDLFVBQVUsQ0FBQztJQUNoQixXQUFXLEVBQUUsaUJBQWlCO0NBQ2pDLENBQUMsQ0FBQyxJQUFJLENBQUMsVUFBQyxJQUFJO0lBQ1QsY0FBYyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5QixDQUFDLENBQUMsQ0FBQztBQUVILFFBQVEsQ0FBQyxVQUFVLEVBQUUsQ0FBQyJ9

View File

@ -1,4 +1,3 @@
import "typings-global";
export declare let certHook: string;
export declare let config: string;
export declare let letsencryptSh: string;

3
dist/cert.paths.js vendored
View File

@ -1,8 +1,7 @@
"use strict";
require("typings-global");
var plugins = require("./cert.plugins");
exports.certHook = plugins.path.join(__dirname, "cert.hook.js");
exports.config = plugins.path.join(__dirname, "assets/config.json");
exports.letsencryptSh = plugins.path.join(__dirname, "assets/letsencrypt.sh");
exports.certDir = plugins.path.join(__dir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kFBb0IsQ0FBQyxDQUFDO0FBQzNELHFCQUFhLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLHVCQUF1QixDQUFDLENBQUM7QUFDckUsZUFBTyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyxlQUFlLENBQUMsQ0FBQyJ9

View File

@ -4,7 +4,7 @@ export import cflare = require("cflare");
export declare let fs: any;
export import path = require("path");
export import q = require("q");
export import shelljs = require("shelljs");
export declare let shelljs: any;
export import smartcli = require("smartcli");
export import smartfile = require("smartfile");
export import smartgit = require("smartgit");

View File

@ -10,4 +10,4 @@ exports.smartcli = require("smartcli");
exports.smartfile = require("smartfile");
exports.smartgit = require("smartgit");
exports.smartstring = require("smartstring");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2VydC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDVixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGNBQU0sV0FBVyxRQUFRLENBQUMsQ0FBQztBQUM5QixVQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0FBQ3RCLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixTQUFDLFdBQVcsR0FBRyxDQUFDLENBQUM7QUFDakIsZUFBTyxXQUFXLFNBQVMsQ0FBQyxDQUFDO0FBQzdCLGdCQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDL0IsaUJBQVMsV0FBVyxXQUFXLENBQUMsQ0FBQztBQUNqQyxnQkFBUSxXQUFXLFVBQVUsQ0FBQyxDQUFDO0FBQy9CLG1CQUFXLFdBQVcsYUFBYSxDQUFDLENBQUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2VydC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDVixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGNBQU0sV0FBVyxRQUFRLENBQUMsQ0FBQztBQUM5QixVQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0FBQ3RCLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixTQUFDLFdBQVcsR0FBRyxDQUFDLENBQUM7QUFDcEIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMxQixnQkFBUSxXQUFXLFVBQVUsQ0FBQyxDQUFDO0FBQy9CLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsZ0JBQVEsV0FBVyxVQUFVLENBQUMsQ0FBQztBQUMvQixtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDIn0=

4
dist/index.d.ts vendored
View File

@ -6,13 +6,15 @@ export declare class Cert {
private _sslDir;
certificatesPresent: Certificate[];
certificatesValid: Certificate[];
gitOriginRepo: any;
private _gitOriginRepo;
constructor(optionsArg: {
cfEmail: string;
cfKey: string;
sslDir: string;
gitOriginRepo?: string;
});
sslGitOriginPull: () => void;
sslGitOriginAddCommitPush: () => void;
getDomainCert(domainNameArg: string, optionsArg?: {
force: boolean;
}): plugins.q.Promise<{}>;

28
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -25,19 +25,19 @@
},
"homepage": "https://gitlab.com/pushrocks/cert#readme",
"dependencies": {
"@types/minimatch": "^2.0.22-alpha",
"@types/q": "0.0.21-alpha",
"@types/shelljs": "^0.3.21-alpha",
"beautylog": "^5.0.12",
"@types/minimatch": "^2.0.26-alpha",
"@types/q": "0.0.25-alpha",
"@types/shelljs": "^0.3.25-alpha",
"beautylog": "^5.0.13",
"cflare": "0.0.9",
"fs-extra": "^0.30.0",
"q": "^1.4.1",
"shelljs": "^0.7.0",
"smartcli": "^1.0.4",
"smartfile": "^4.0.10",
"smartgit": "0.1.0",
"smartgit": "0.1.7",
"smartstring": "^2.0.10",
"typings-global": "^1.0.5"
"typings-global": "^1.0.6"
},
"devDependencies": {
"npmts-g": "^5.2.6",

View File

@ -18,19 +18,21 @@ describe("cert", function () {
});
describe("Cert", function () {
it("should create a new Cert object from class", function () {
this.timeout(20000);
testCert = new cert.Cert({
cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY,
sslDir: path.join(process.cwd(), "test/assets")
sslDir: path.join(process.cwd(), "test/assets"),
gitOriginRepo: "git@gitlab.com:philkunz/sandbox-sslorigin.git"
});
testCert.should.be.instanceof(cert.Cert);
});
it("should get a valid certificate", function (done) {
this.timeout(120000);
testCert.getDomainCert("sub10.bleu.de").then(function () {
testCert.getDomainCert("sub11.bleu.de").then(function () {
done();
});
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUNoQixxQkFBbUIsTUFBTSxDQUFDLENBQUE7QUFDMUIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFFOUIsd0JBQTJCLGlCQUFpQixDQUFDLENBQUE7QUFDN0MsSUFBWSxJQUFJLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFHdEMsSUFBSSxR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0FBQyxDQUFBO0lBQ04sQ0FBQyxDQUFDLENBQUE7SUFDRixRQUFRLENBQUMsTUFBTSxFQUFDO1FBQ1osRUFBRSxDQUFDLDRDQUE0QyxFQUFDO1lBQzVDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDcEIsUUFBUSxHQUFHLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQztnQkFDckIsT0FBTyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUTtnQkFDN0IsS0FBSyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTTtnQkFDekIsTUFBTSxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFDLGFBQWEsQ0FBQztnQkFDOUMsYUFBYSxFQUFDLCtDQUErQzthQUNoRSxDQUFDLENBQUM7WUFDSCxRQUFRLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzdDLENBQUMsQ0FBQyxDQUFBO1FBQ0YsRUFBRSxDQUFDLGdDQUFnQyxFQUFDLFVBQVMsSUFBSTtZQUM3QyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBQ3JCLFFBQVEsQ0FBQyxhQUFhLENBQUMsZUFBZSxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUN6QyxJQUFJLEVBQUUsQ0FBQztZQUNYLENBQUMsQ0FBQyxDQUFDO1FBQ1AsQ0FBQyxDQUFDLENBQUE7SUFDTixDQUFDLENBQUMsQ0FBQTtBQUNOLENBQUMsQ0FBQyxDQUFDIn0=

View File

@ -22,16 +22,18 @@ describe("cert",function(){
})
describe("Cert",function(){
it("should create a new Cert object from class",function(){
this.timeout(20000);
testCert = new cert.Cert({
cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY,
sslDir: path.join(process.cwd(),"test/assets")
sslDir: path.join(process.cwd(),"test/assets"),
gitOriginRepo:"git@gitlab.com:philkunz/sandbox-sslorigin.git"
});
testCert.should.be.instanceof(cert.Cert);
})
it("should get a valid certificate",function(done){
this.timeout(120000);
testCert.getDomainCert("sub10.bleu.de").then(() => {
testCert.getDomainCert("sub11.bleu.de").then(() => {
done();
});
})

View File

@ -1,7 +1,6 @@
#!/usr/bin/env node
// the shebang line above makes sure this script will get interpreted by node
import "typings-global";
import * as plugins from "./cert.plugins";
import * as paths from "./cert.paths";

View File

@ -1,4 +1,3 @@
import "typings-global";
import * as plugins from "./cert.plugins";
export let certHook = plugins.path.join(__dirname,"cert.hook.js");

View File

@ -4,7 +4,7 @@ export import cflare = require("cflare");
export let fs = require("fs-extra");
export import path = require("path");
export import q = require("q");
export import shelljs = require("shelljs");
export let shelljs = require("shelljs");
export import smartcli = require("smartcli");
export import smartfile = require("smartfile");
export import smartgit = require("smartgit");

View File

@ -7,7 +7,7 @@ export class Cert {
private _sslDir: string;
certificatesPresent:Certificate[];
certificatesValid:Certificate[];
gitOriginRepo;
private _gitOriginRepo;
constructor(optionsArg: {
cfEmail: string,
cfKey: string,
@ -17,15 +17,33 @@ export class Cert {
this._cfEmail = optionsArg.cfEmail;
this._cfKey = optionsArg.cfKey;
this._sslDir = optionsArg.sslDir;
this.gitOriginRepo = optionsArg.gitOriginRepo;
this._gitOriginRepo = optionsArg.gitOriginRepo;
let config = {
cfEmail: this._cfEmail,
cfKey: this._cfKey
}
plugins.smartfile.memory.toFsSync(JSON.stringify(config),plugins.path.join(__dirname, "assets/config.json"));
if(this._gitOriginRepo){
plugins.smartgit.init(this._sslDir);
plugins.smartgit.remote.add(this._sslDir,"origin",this._gitOriginRepo);
this.sslGitOriginPull();
}
};
sslGitOriginPull = () => {
if(this._gitOriginRepo){
plugins.smartgit.pull(this._sslDir,"origin","master");
}
};
sslGitOriginAddCommitPush = () => {
if(this._gitOriginRepo){
plugins.smartgit.add.addAll(this._sslDir);
plugins.smartgit.commit(this._sslDir,"added new SSL certificates and deleted obsolete ones.");
plugins.smartgit.push(this._sslDir,"origin","master");
}
};
getDomainCert(domainNameArg: string,optionsArg?:{force:boolean}) {
let done = plugins.q.defer();
this.sslGitOriginPull();
if (!checkDomainsStillValid(domainNameArg) || optionsArg.force) {
plugins.shelljs.exec("chmod 700 " + paths.letsencryptSh);
plugins.shelljs.exec("chmod 700 " + paths.certHook);
@ -34,11 +52,12 @@ export class Cert {
if(fetchedCertsArray.indexOf(domainNameArg) != -1){
updateSslDirSync(this._sslDir,domainNameArg);
}
this.sslGitOriginAddCommitPush();
done.resolve();
} else {
plugins.beautylog.info("certificate for " + domainNameArg + " is still valid! Not fetching new one!");
done.resolve();
}
};
return done.promise;
};
}
@ -90,6 +109,13 @@ let updateSslDirSync = (sslDirArg:string,domainNameArg:string) => {
};
}
let updateGitOrigin = () => {
const enum gitSyncDirection {
toOrigin,
fromOrigin
}
let updateGitOrigin = (syncDirectionArg:gitSyncDirection) => {
};
updateGitOrigin(gitSyncDirection.toOrigin);