update sslDir handling

This commit is contained in:
LosslessBot 2016-07-13 12:09:34 +02:00
parent a7525184ef
commit d06a2cee2f
6 changed files with 20 additions and 12 deletions

View File

@ -3,4 +3,5 @@ export declare let config: string;
export declare let leShConfig: string;
export declare let letsencryptSh: string;
export declare let certDir: string;
export declare let defaultSslDir: string;
export declare let assetDir: string;

7
dist/cert.paths.js vendored
View File

@ -6,6 +6,7 @@ exports.config = plugins.path.join(__dirname, "assets/config.json");
exports.leShConfig = plugins.path.join(__dirname, "assets/leshconfig.json");
exports.letsencryptSh = plugins.path.join(__dirname, "assets/letsencrypt.sh");
//dirs
exports.certDir = plugins.path.join(__dirname, "/assets/certs");
exports.assetDir = plugins.path.join(__dirname, "/assets/");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2NlcnQucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLGdCQUFnQixDQUFDLENBQUE7QUFFMUMsUUFBUTtBQUNHLGdCQUFRLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLGNBQWMsQ0FBQyxDQUFDO0FBQ3ZELGNBQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsb0JBQW9CLENBQUMsQ0FBQztBQUMzRCxrQkFBVSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyx3QkFBd0IsQ0FBQyxDQUFDO0FBQ25FLHFCQUFhLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLHVCQUF1QixDQUFDLENBQUM7QUFFaEYsTUFBTTtBQUNLLGVBQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsZUFBZSxDQUFDLENBQUM7QUFDdkQsZ0JBQVEsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsVUFBVSxDQUFDLENBQUMifQ==
exports.certDir = plugins.path.join(__dirname, "assets/certs");
exports.defaultSslDir = plugins.path.join(__dirname, "assets/defaultSslDir");
exports.assetDir = plugins.path.join(__dirname, "assets/");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2NlcnQucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLGdCQUFnQixDQUFDLENBQUE7QUFFMUMsUUFBUTtBQUNHLGdCQUFRLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLGNBQWMsQ0FBQyxDQUFDO0FBQ3ZELGNBQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsb0JBQW9CLENBQUMsQ0FBQztBQUMzRCxrQkFBVSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyx3QkFBd0IsQ0FBQyxDQUFDO0FBQ25FLHFCQUFhLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLHVCQUF1QixDQUFDLENBQUM7QUFFaEYsTUFBTTtBQUNLLGVBQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsY0FBYyxDQUFDLENBQUM7QUFDdEQscUJBQWEsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUMsc0JBQXNCLENBQUMsQ0FBQztBQUNwRSxnQkFBUSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyxTQUFTLENBQUMsQ0FBQyJ9

6
dist/index.d.ts vendored
View File

@ -1,9 +1,9 @@
/// <reference types="q" />
import * as plugins from "./cert.plugins";
export interface CertConstructorOptions {
export interface ICertConstructorOptions {
cfEmail: string;
cfKey: string;
sslDir: string;
sslDir?: string;
gitOriginRepo?: string;
testMode?: boolean;
}
@ -15,7 +15,7 @@ export declare class Cert {
private _testMode;
certificatesPresent: Certificate[];
certificatesValid: Certificate[];
constructor(optionsArg: CertConstructorOptions);
constructor(optionsArg: ICertConstructorOptions);
sslGitOriginPull: () => void;
sslGitOriginAddCommitPush: () => void;
getDomainCert(domainNameArg: string, optionsArg?: {

5
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -7,5 +7,6 @@ export let leShConfig = plugins.path.join(__dirname,"assets/leshconfig.json");
export let letsencryptSh = plugins.path.join(__dirname,"assets/letsencrypt.sh");
//dirs
export let certDir = plugins.path.join(__dirname,"/assets/certs");
export let assetDir = plugins.path.join(__dirname,"/assets/");
export let certDir = plugins.path.join(__dirname,"assets/certs");
export let defaultSslDir = plugins.path.join(__dirname,"assets/defaultSslDir");
export let assetDir = plugins.path.join(__dirname,"assets/");

View File

@ -1,10 +1,10 @@
import * as plugins from "./cert.plugins";
import * as paths from "./cert.paths";
export interface CertConstructorOptions {
export interface ICertConstructorOptions {
cfEmail: string,
cfKey: string,
sslDir: string,
sslDir?: string,
gitOriginRepo?: string,
testMode?: boolean
};
@ -17,7 +17,7 @@ export class Cert {
private _testMode: boolean
certificatesPresent: Certificate[];
certificatesValid: Certificate[];
constructor(optionsArg:CertConstructorOptions) {
constructor(optionsArg:ICertConstructorOptions) {
this._cfEmail = optionsArg.cfEmail;
this._cfKey = optionsArg.cfKey;
this._sslDir = optionsArg.sslDir;
@ -32,6 +32,8 @@ export class Cert {
JSON.stringify(config),
plugins.path.join(__dirname, "assets/config.json")
);
// setup sslDir
if (!this._sslDir) this._sslDir = paths.defaultSslDir;
// setup Git
if (this._gitOriginRepo) {
plugins.smartgit.init(this._sslDir);