2016-04-10 13:56:13 +00:00
|
|
|
# Cert
|
2016-06-18 12:59:46 +00:00
|
|
|
Easily obain SSL certificates from LetsEncrypt. Supports DNS-01 challenge. TypeScript ready.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
import {Cert} from "cert";
|
|
|
|
|
2016-06-18 13:42:09 +00:00
|
|
|
let myCert = new Cert({
|
2016-06-18 14:03:46 +00:00
|
|
|
cfEmail: "some@cloudflare.email",
|
|
|
|
cfKey: "someCloudflareApiKey",
|
|
|
|
sslDir: "someOutputPath", // NOTE: if you already have certificates, make sure you put them in here, so cert only requires the missing ones
|
2016-06-18 14:14:57 +00:00
|
|
|
gitOriginRepo: "git@githhub.com/someuser/somereopo" // good for persistence in highly volatile environments like docker
|
2016-06-18 12:59:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
myCert.getDomainCert("example.com");
|
2016-06-18 13:59:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### sslDir
|
2016-06-18 14:14:57 +00:00
|
|
|
to use the certificates it is important to understand what the structure of the ssl directory looks like.
|
|
|
|
|
|
|
|
### using a git origin repo.
|
|
|
|
Often times you want to keep track of certificates in order to keep them
|
|
|
|
even if the point of initial certificate request is gone. Imagine you have a dockerenvironement
|
|
|
|
and you keep starting new container versions for the same domain. YOu ideally want to use a proxy
|
|
|
|
that handles SSL managemet for you. But even the proxy needs to be updated from time to time.
|
|
|
|
|
|
|
|
So you need some kind of persistence between versions. This is why you can sync up all certificates to a git repo over ssh
|
|
|
|
Just make sure your id_rsa is in place for the node user and is allowed for the origin repo.
|