@cloud-cli/le 1.1.0 → 1.1.1
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 +15 -3
- package/dist/certificate-manager.d.ts +2 -1
- package/dist/certificate-manager.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,10 +11,10 @@ Requires `certbot` to be installed on server and properly configured for Let's E
|
|
|
11
11
|
cy le.add --domain example.com
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
**
|
|
14
|
+
**Update a certificate with domain example.com and all its subdomains**
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
cy le.add --domain example.com --useWildcard 1
|
|
17
|
+
cy le.add --domain example.com --useWildcard 1 --update
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
**Remove a certificate**
|
|
@@ -29,9 +29,21 @@ cy le.remove --domain example.com
|
|
|
29
29
|
cy le.exists --domain example.com
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
**List certificates
|
|
32
|
+
**List certificates by domains**
|
|
33
33
|
|
|
34
34
|
```
|
|
35
35
|
cy le.list
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
**Show certificate by domains**
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
cy le.show --domain example.com
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Show certificate domains**
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
cy le.showDomains --domain example.com
|
|
48
|
+
```
|
|
49
|
+
|
|
@@ -10,11 +10,12 @@ export interface CertificateOptions {
|
|
|
10
10
|
export interface CreateCertificateOptions extends CertificateOptions {
|
|
11
11
|
useWildcard: boolean;
|
|
12
12
|
additionalOptions?: string[];
|
|
13
|
+
update: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare class CertificateManager {
|
|
15
16
|
private readonly domainPattern;
|
|
16
17
|
certificateExists({ domain }: CertificateOptions): boolean;
|
|
17
|
-
createCertificate({ domain, useWildcard, additionalOptions }: CreateCertificateOptions): true | Promise<string>;
|
|
18
|
+
createCertificate({ domain, useWildcard, additionalOptions, update }: CreateCertificateOptions): true | Promise<string>;
|
|
18
19
|
removeCertificate({ domain }: CertificateOptions): boolean;
|
|
19
20
|
getCertificateList(): string[];
|
|
20
21
|
getCertificate({ domain }: CertificateOptions): Promise<Buffer>;
|
|
@@ -12,12 +12,12 @@ export class CertificateManager {
|
|
|
12
12
|
}
|
|
13
13
|
return existsSync(join(certificatesFolder, domain));
|
|
14
14
|
}
|
|
15
|
-
createCertificate({ domain, useWildcard, additionalOptions }) {
|
|
15
|
+
createCertificate({ domain, useWildcard, additionalOptions, update }) {
|
|
16
16
|
if (!this.isValidDomain(domain)) {
|
|
17
17
|
throw new Error('Invalid domain: ' + domain);
|
|
18
18
|
}
|
|
19
19
|
const path = join(certificatesFolder, domain);
|
|
20
|
-
if (existsSync(path)) {
|
|
20
|
+
if (existsSync(path) && !update) {
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
const domains = [domain, useWildcard ? '*.' + domain : ''].filter(Boolean);
|