certops 1.0.13 → 1.0.15
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 +8 -7
- package/dist/commands/download.js +1 -1
- package/dist/files.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ Lists all certificates in your organisation with status and expiry.
|
|
|
40
40
|
|
|
41
41
|
### `certops download [certName]`
|
|
42
42
|
|
|
43
|
-
Downloads a certificate to `/etc/certops/<domain>/` in certbot-compatible format:
|
|
43
|
+
Downloads a certificate to `/etc/certops/certs/<domain>/` in certbot-compatible format:
|
|
44
44
|
|
|
45
45
|
```
|
|
46
|
-
/etc/certops/<domain>/
|
|
46
|
+
/etc/certops/certs/<domain>/
|
|
47
47
|
├── fullchain.pem # cert + chain
|
|
48
48
|
├── cert.pem # leaf cert only
|
|
49
49
|
├── chain.pem # intermediate chain
|
|
@@ -107,11 +107,12 @@ systemctl reload nginx
|
|
|
107
107
|
hooks/
|
|
108
108
|
global.sh # runs after every download
|
|
109
109
|
example.com.sh # runs after example.com downloads
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
certs/
|
|
111
|
+
example.com/
|
|
112
|
+
fullchain.pem
|
|
113
|
+
cert.pem
|
|
114
|
+
chain.pem
|
|
115
|
+
privkey.pem
|
|
115
116
|
```
|
|
116
117
|
|
|
117
118
|
## Configuration (`/etc/certops/config.json`)
|
|
@@ -17,7 +17,7 @@ async function performDownload(cert, client) {
|
|
|
17
17
|
process.stdout.write('\n');
|
|
18
18
|
}
|
|
19
19
|
export const downloadCommand = new Command('download')
|
|
20
|
-
.description('Download a certificate to /etc/certops/<domain>/ — requires sudo')
|
|
20
|
+
.description('Download a certificate to /etc/certops/certs/<domain>/ — requires sudo')
|
|
21
21
|
.argument('[certName]', 'Certificate name or identifier, e.g. *.example.com (omit to pick interactively)')
|
|
22
22
|
.option('-i, --id <id>', 'Download by certificate ID')
|
|
23
23
|
.addHelpText('after', `
|
package/dist/files.js
CHANGED
|
@@ -4,7 +4,7 @@ import { unzipSync } from 'fflate';
|
|
|
4
4
|
import { CERTOPS_DIR } from './config.js';
|
|
5
5
|
export async function saveZip(certName, zipBuffer) {
|
|
6
6
|
const zipDirName = certName.replace(/^\*\./, 'wildcard.');
|
|
7
|
-
const dir = join(CERTOPS_DIR, zipDirName);
|
|
7
|
+
const dir = join(CERTOPS_DIR, 'certs', zipDirName);
|
|
8
8
|
let entries;
|
|
9
9
|
try {
|
|
10
10
|
entries = unzipSync(new Uint8Array(zipBuffer));
|
|
@@ -26,9 +26,9 @@ export async function saveZip(certName, zipBuffer) {
|
|
|
26
26
|
}
|
|
27
27
|
const paths = {};
|
|
28
28
|
for (const { key, zipName, mode } of filemap) {
|
|
29
|
-
const data = entries[
|
|
29
|
+
const data = entries[zipName];
|
|
30
30
|
if (!data)
|
|
31
|
-
throw new Error(`ZIP missing expected file: ${
|
|
31
|
+
throw new Error(`ZIP missing expected file: ${zipName}`);
|
|
32
32
|
const filePath = join(dir, zipName);
|
|
33
33
|
paths[key] = filePath;
|
|
34
34
|
try {
|