smartcert/README.md

52 lines
3.0 KiB
Markdown
Raw Permalink Normal View History

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.
2016-10-22 02:23:12 +00:00
## Availabililty
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/cert)
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/cert)
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/cert)
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/cert/)
## Status for master
2016-07-21 13:02:51 +00:00
[![build status](https://gitlab.com/pushrocks/cert/badges/master/build.svg)](https://gitlab.com/pushrocks/cert/commits/master)
2016-10-22 02:23:12 +00:00
[![coverage report](https://gitlab.com/pushrocks/cert/badges/master/coverage.svg)](https://gitlab.com/pushrocks/cert/commits/master)
[![Dependency Status](https://david-dm.org/pushrocks/cert.svg)](https://david-dm.org/pushrocks/cert)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/cert/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/cert/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/cert/badges/code.svg)](https://www.bithound.io/github/pushrocks/cert)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
2016-07-21 13:02:51 +00:00
2016-06-18 12:59:46 +00:00
## 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
});
2016-07-22 00:12:49 +00:00
myCert.getDomainCert("example.com"); // returns promise
2016-06-18 13:59:03 +00:00
```
2016-07-24 18:17:23 +00:00
> **Note:** cert supports async parallel cert fetching.
However any subsequent calls will wait for the queue of the same dns zone to clear.
In other words: test1.domain1.tld and test2.domain2.tld will run in parallel, but test2.domain1.tld will wait for test1.domain1.tld !
2016-07-22 00:12:49 +00:00
2016-07-21 12:58:05 +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.
2016-07-21 12:58:05 +00:00
## using a git origin repo.
2016-06-18 14:14:57 +00:00
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
2016-07-21 12:58:05 +00:00
Just make sure your id_rsa is in place for the node user and is allowed for the origin repo.
2016-10-22 02:23:12 +00:00
[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)