@abtnode/certificate-manager 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Certificate Manager
|
|
2
|
+
|
|
3
|
+
Manage SSL certificates:
|
|
4
|
+
|
|
5
|
+
- 管理上传的证书
|
|
6
|
+
- 生成/自动更新 Let's Encrypt 证书
|
|
7
|
+
- 过期提醒
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Well-known route
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
const certificateManager = require('@abtnode/certificate-manager');
|
|
15
|
+
|
|
16
|
+
app.use(certificateManager.routes);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Core Manager
|
|
20
|
+
|
|
21
|
+
#### Initialize
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
const CertificateManager = require('@abtnode/certificate-manager/sdk/manager');
|
|
25
|
+
|
|
26
|
+
const certManager = new CertificateManager({
|
|
27
|
+
maintainerEmail: '{email of the certificate manager}',
|
|
28
|
+
dataDir: '{data directory of the certificate manager}',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
certManager.start(); // Start renewal cron jobs
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Events
|
|
35
|
+
|
|
36
|
+
1. cert.issued: Issue certificate successfully
|
|
37
|
+
1. cert.error: Issue certificate failed
|
|
38
|
+
|
|
39
|
+
#### CRUD
|
|
40
|
+
|
|
41
|
+
- `getAll()`: Get all certificates, includes in-progress status.
|
|
42
|
+
- `getAllNormal()`: Get normal state certificate, without in-progress status.
|
|
43
|
+
- `getByDomain(domain)`: Get the certificate by domain.
|
|
44
|
+
- `add(certificate)`: Add certificate to database.
|
|
45
|
+
- `issue(domain)`: Add the generate certificate task.
|
|
46
|
+
- `upsertByDomain(certificate)`: Add certificate to database, if the domain already exists, update it.
|
|
47
|
+
- `update(id, certificate)`: Update certificate by ID.
|
|
48
|
+
- `remove(id)`: Remove certificate by ID.
|
|
49
|
+
- `addWithoutValidations(certificate)`: Same as `add(certificate)`, but no data validation.
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@abtnode/certificate-manager",
|
|
3
|
+
"version": "1.6.7",
|
|
4
|
+
"description": "Manage ABT Node SSL certificates",
|
|
5
|
+
"author": "polunzh <polunzh@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"main": "lib/certificate-manager.js",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"directories": {
|
|
13
|
+
"lib": "lib",
|
|
14
|
+
"test": "__tests__"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/ArcBlock/blocklet-server.git"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "echo \"Error: run tests from root\"",
|
|
25
|
+
"lint": "eslint libs routes states index.js",
|
|
26
|
+
"lint:fix": "eslint --fix tests lib"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@abtnode/cron": "1.6.7",
|
|
33
|
+
"@abtnode/db": "1.6.7",
|
|
34
|
+
"@abtnode/logger": "1.6.7",
|
|
35
|
+
"@abtnode/queue": "1.6.7",
|
|
36
|
+
"@fidm/x509": "^1.2.1",
|
|
37
|
+
"@greenlock/manager": "^3.1.0",
|
|
38
|
+
"@nedb/core": "^1.1.0",
|
|
39
|
+
"@nedb/multi": "^1.2.2",
|
|
40
|
+
"@root/acme": "^3.1.0",
|
|
41
|
+
"@root/csr": "^0.8.1",
|
|
42
|
+
"@root/keypairs": "^0.10.1",
|
|
43
|
+
"@root/pem": "^1.0.4",
|
|
44
|
+
"acme-http-01-webroot": "^3.0.0",
|
|
45
|
+
"axios": "^0.21.0",
|
|
46
|
+
"debug": "^4.2.0",
|
|
47
|
+
"express": "^4.17.1",
|
|
48
|
+
"joi": "^17.5.0",
|
|
49
|
+
"lodash.get": "^4.4.2",
|
|
50
|
+
"moment": "^2.29.1",
|
|
51
|
+
"parse-domain": "^3.0.3",
|
|
52
|
+
"punycode": "^2.1.1",
|
|
53
|
+
"ursa-optional": "^0.10.2"
|
|
54
|
+
},
|
|
55
|
+
"gitHead": "d681c03a398e3c7d4dbc878db93b2ab778dded81"
|
|
56
|
+
}
|