Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
e67677d57d | |||
d5b5e8d612 | |||
bbee7923e4 | |||
04be5f88eb | |||
3c626908f1 | |||
821b2f95b0 |
14
README.md
14
README.md
@ -1,16 +1,22 @@
|
|||||||
# Cert
|
# Cert
|
||||||
Easily obain SSL certificates from LetsEncrypt. Supports DNS-01 challenge. TypeScript ready.
|
Easily obain SSL certificates from LetsEncrypt. Supports DNS-01 challenge. TypeScript ready.
|
||||||
|
|
||||||
|
> Note: this package is in pre-alpha stage and will be ready soon.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import {Cert} from "cert";
|
import {Cert} from "cert";
|
||||||
|
|
||||||
myCert = new Cert({
|
let myCert = new Cert({
|
||||||
cfEmail = "some@cloudflare.email",
|
cfEmail: "some@cloudflare.email",
|
||||||
cfKey = "someCloudflareApiKey",
|
cfKey: "someCloudflareApiKey",
|
||||||
outputPath = "someOutputPath" // NOTE: if you already have certificates, make sure you put them in here, so cert only requires the missing ones
|
sslDir: "someOutputPath", // NOTE: if you already have certificates, make sure you put them in here, so cert only requires the missing ones
|
||||||
|
gitOriginRepo: "git@githhub.com/someuser/somereopo" // good for pesistence in highly volatile environments like docker
|
||||||
});
|
});
|
||||||
|
|
||||||
myCert.getDomainCert("example.com");
|
myCert.getDomainCert("example.com");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### sslDir
|
||||||
|
to use the certificates it is important to understand what the structure of the ssl directory looks like.
|
0
dist/hook.d.ts → dist/cert.hook.d.ts
vendored
0
dist/hook.d.ts → dist/cert.hook.d.ts
vendored
3
dist/cert.hook.js
vendored
Normal file
3
dist/cert.hook.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJjZXJ0Lmhvb2suanMiLCJzb3VyY2VzQ29udGVudCI6W119
|
2
dist/cert.paths.d.ts
vendored
Normal file
2
dist/cert.paths.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export import path = require("path");
|
5
dist/cert.paths.js
vendored
Normal file
5
dist/cert.paths.js
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
exports.path = require("path");
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNlcnQucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNWLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQyIsImZpbGUiOiJjZXJ0LnBhdGhzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmV4cG9ydCBpbXBvcnQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuXG4iXX0=
|
0
ts/hook.ts → dist/cert.plugins.d.ts
vendored
0
ts/hook.ts → dist/cert.plugins.d.ts
vendored
2
dist/hook.js → dist/cert.plugins.js
vendored
2
dist/hook.js → dist/cert.plugins.js
vendored
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJob29rLmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ==
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJjZXJ0LnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6W119
|
18
dist/index.d.ts
vendored
18
dist/index.d.ts
vendored
@ -0,0 +1,18 @@
|
|||||||
|
export declare class Cert {
|
||||||
|
cfEmail: string;
|
||||||
|
cfKey: string;
|
||||||
|
sslDir: string;
|
||||||
|
certificatesPresent: any;
|
||||||
|
certificatesValid: any;
|
||||||
|
gitOriginRepo: any;
|
||||||
|
constructor(optionsArg: {
|
||||||
|
cfEmail: string;
|
||||||
|
cfKey: string;
|
||||||
|
sslDir: string;
|
||||||
|
gitOriginRepo: string;
|
||||||
|
});
|
||||||
|
getDomainCert(): void;
|
||||||
|
}
|
||||||
|
export declare class Certificate {
|
||||||
|
constructor();
|
||||||
|
}
|
||||||
|
24
dist/index.js
vendored
24
dist/index.js
vendored
@ -1,3 +1,23 @@
|
|||||||
|
"use strict";
|
||||||
|
var Cert = (function () {
|
||||||
|
function Cert(optionsArg) {
|
||||||
|
this.cfEmail = optionsArg.cfEmail;
|
||||||
|
this.cfKey = optionsArg.cfKey;
|
||||||
|
this.sslDir = optionsArg.sslDir;
|
||||||
|
this.gitOriginRepo = optionsArg.gitOriginRepo;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
Cert.prototype.getDomainCert = function () { };
|
||||||
|
;
|
||||||
|
return Cert;
|
||||||
|
}());
|
||||||
|
exports.Cert = Cert;
|
||||||
|
var Certificate = (function () {
|
||||||
|
function Certificate() {
|
||||||
|
}
|
||||||
|
;
|
||||||
|
return Certificate;
|
||||||
|
}());
|
||||||
|
exports.Certificate = Certificate;
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQTtJQU9JLGNBQVksVUFLWDtRQUNHLElBQUksQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQztRQUNsQ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uICAgICAgICB0aGlzLmdpdE9yaWdpblJlcG8gPSBvcHRpb25zQXJnLmdpdE9yaWdpblJlcG87XG4gICAgfTtcbiAgICBnZXREb21haW5DZXJ0KCl7fTtcbn1cblxuZXhwb3J0IGNsYXNzIENlcnRpZmljYXRlIHtcbiAgICBjb25zdHJ1Y3Rvcigpe1xuXG4gICAgfTtcbn0iXX0=
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0=
|
|
||||||
|
11
dist/install.js
vendored
11
dist/install.js
vendored
@ -1,3 +1,10 @@
|
|||||||
|
"use strict";
|
||||||
|
var beautylog = require("beautylog");
|
||||||
|
var path = require("path");
|
||||||
|
var smartfile = require("smartfile");
|
||||||
|
beautylog.info("installing letsencrypt.sh locally...");
|
||||||
|
smartfile.remote.toFs("https://raw.githubusercontent.com/lukas2511/letsencrypt.sh/master/letsencrypt.sh", path.join(__dirname, "assets/", "le.sh")).then(function () {
|
||||||
|
beautylog.success("Done!");
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksU0FBUyxXQUFNLFdBQVcsQ0FBQyxDQUFBO0FBQ3ZDLElBQVksSUFBSSxXQUFNLE1BQU0sQ0FBQyxDQUFBO0FBQzdCLElBQVksU0FBUyxXQUFNLFdBQVcsQ0FBQyxDQUFBO0FBQ3ZDLFNBQVMsQ0FBQyxJQUFJLENBQUMsc0NBQXNDLENBQUMsQ0FBQztBQUN2RCxTQUFTLENBQUMsTUFBTSxDQUFDLElBQUksQ0FDakIsa0ZBQWtGLEVBQ2xGLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLFNBQVMsRUFBQyxPQUFPLENBQUMsQ0FDekMsQ0FBQyxJQUFJLENBQUM7SUFDSCxTQUFTLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQy9CLENBQUMsQ0FBQyxDQUFDIiwiZmlsZSI6Imluc3RhbGwuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBiZWF1dHlsb2cgZnJvbSBcImJlYXV0eWxvZ1wiO1xuaW1wb3J0ICogYXMgcGF0aCBmcm9tIFwicGF0aFwiO1xuaW1wb3J0ICogYXMgc21hcnRmaWxlIGZyb20gXCJzbWFydGZpbGVcIjtcbmJlYXV0eWxvZy5pbmZvKFwiaW5zdGFsbGluZyBsZXRzZW5jcnlwdC5zaCBsb2NhbGx5Li4uXCIpO1xuc21hcnRmaWxlLnJlbW90ZS50b0ZzKFxuICAgIFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2x1a2FzMjUxMS9sZXRzZW5jcnlwdC5zaC9tYXN0ZXIvbGV0c2VuY3J5cHQuc2hcIixcbiAgICBwYXRoLmpvaW4oX19kaXJuYW1lLFwiYXNzZXRzL1wiLFwibGUuc2hcIilcbikudGhlbigoKSA9PiB7XG4gICAgYmVhdXR5bG9nLnN1Y2Nlc3MoXCJEb25lIVwiKTtcbn0pOyJdfQ==
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbnN0YWxsLmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ==
|
|
||||||
|
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cert",
|
"name": "cert",
|
||||||
"version": "0.0.4",
|
"version": "0.0.6",
|
||||||
"description": "Easily obain SSL certificates from LetsEncrypt. Supports DNS-01 challenge. TypeScript ready.",
|
"description": "Easily obain SSL certificates from LetsEncrypt. Supports DNS-01 challenge. TypeScript ready.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/pushrocks/cert.git"
|
"url": "git+https://gitlab.com/pushrocks/cert.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"coreos",
|
"coreos",
|
||||||
@ -19,11 +19,17 @@
|
|||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pushrocks/cert/issues"
|
"url": "https://gitlab.com/pushrocks/cert/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/cert#readme",
|
"homepage": "https://gitlab.com/pushrocks/cert#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"letsencrypt": "^1.4.4"
|
"beautylog": "^5.0.12",
|
||||||
|
"cflare": "0.0.2",
|
||||||
|
"letsencrypt": "^1.4.4",
|
||||||
|
"smartcli": "^1.0.2",
|
||||||
|
"smartfile": "^3.0.10",
|
||||||
|
"smartgit": "0.0.10",
|
||||||
|
"typings-global": "^1.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts-g": "^5.2.6"
|
"npmts-g": "^5.2.6"
|
||||||
|
2
ts/cert.hook.ts
Normal file
2
ts/cert.hook.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import * as smartcli from "smartcli";
|
||||||
|
import * as cflare from "cflare";
|
3
ts/cert.paths.ts
Normal file
3
ts/cert.paths.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export import path = require("path");
|
||||||
|
|
0
ts/cert.plugins.ts
Normal file
0
ts/cert.plugins.ts
Normal file
28
ts/index.ts
28
ts/index.ts
@ -0,0 +1,28 @@
|
|||||||
|
import * as paths from "./cert.paths";
|
||||||
|
|
||||||
|
export class Cert {
|
||||||
|
cfEmail:string;
|
||||||
|
cfKey:string;
|
||||||
|
sslDir:string;
|
||||||
|
certificatesPresent;
|
||||||
|
certificatesValid;
|
||||||
|
gitOriginRepo;
|
||||||
|
constructor(optionsArg:{
|
||||||
|
cfEmail:string,
|
||||||
|
cfKey:string,
|
||||||
|
sslDir:string,
|
||||||
|
gitOriginRepo:string
|
||||||
|
}){
|
||||||
|
this.cfEmail = optionsArg.cfEmail;
|
||||||
|
this.cfKey = optionsArg.cfKey;
|
||||||
|
this.sslDir = optionsArg.sslDir;
|
||||||
|
this.gitOriginRepo = optionsArg.gitOriginRepo;
|
||||||
|
};
|
||||||
|
getDomainCert(){};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Certificate {
|
||||||
|
constructor(){
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import * as beautylog from "beautylog";
|
||||||
|
import * as path from "path";
|
||||||
|
import * as smartfile from "smartfile";
|
||||||
|
beautylog.info("installing letsencrypt.sh locally...");
|
||||||
|
smartfile.remote.toFs(
|
||||||
|
"https://raw.githubusercontent.com/lukas2511/letsencrypt.sh/master/letsencrypt.sh",
|
||||||
|
path.join(__dirname,"assets/","le.sh")
|
||||||
|
).then(() => {
|
||||||
|
beautylog.success("Done!");
|
||||||
|
});
|
Reference in New Issue
Block a user