@serve.zone/dcrouter-apiclient 32.4.0 → 32.5.0

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.
@@ -10,8 +10,15 @@ export interface IAcmeConfig {
10
10
  accountEmail: string;
11
11
  /** Whether ACME is enabled. If false, no certs are issued via ACME. */
12
12
  enabled: boolean;
13
- /** True = Let's Encrypt production, false = staging. */
13
+ /** True = Let's Encrypt production, false = staging. Ignored while `directoryUrl` is set. */
14
14
  useProduction: boolean;
15
+ /**
16
+ * ACME directory of another CA, such as a private or test CA. Absent means
17
+ * Let's Encrypt, production or staging per `useProduction`. Must be an
18
+ * `https:` URL, or an `http:` URL on `localhost`, `127.0.0.1` or `[::1]`,
19
+ * without credentials or fragment (SmartAcme's rule).
20
+ */
21
+ directoryUrl?: string;
15
22
  /** Whether to automatically renew certs before expiry. */
16
23
  autoRenew: boolean;
17
24
  /** Renew when a cert has fewer than this many days of validity left. */
@@ -22,7 +22,10 @@ export interface IReq_GetAcmeConfig extends plugins.typedrequestInterfaces.imple
22
22
  * NOTE: SmartProxy and SmartAcme receive the configuration when dcrouter builds
23
23
  * them, so an update, `renewThresholdDays` included, takes effect at the next
24
24
  * restart or SmartProxy rebuild. `renewThresholdDays` must be a positive number
25
- * of days.
25
+ * of days. `directoryUrl` selects another CA's ACME directory and `null` returns
26
+ * to Let's Encrypt; like `accountEmail` and `useProduction`, it is refused while
27
+ * certificate jobs or ACME DNS cleanup are unfinished, and issuance waits for
28
+ * the rebuild after a change.
26
29
  */
27
30
  export interface IReq_UpdateAcmeConfig extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_UpdateAcmeConfig> {
28
31
  method: 'updateAcmeConfig';
@@ -34,6 +37,7 @@ export interface IReq_UpdateAcmeConfig extends plugins.typedrequestInterfaces.im
34
37
  useProduction?: boolean;
35
38
  autoRenew?: boolean;
36
39
  renewThresholdDays?: number;
40
+ directoryUrl?: string | null;
37
41
  };
38
42
  response: {
39
43
  success: boolean;
@@ -17,6 +17,8 @@ export interface IConfigData {
17
17
  enabled: boolean;
18
18
  accountEmail: string;
19
19
  useProduction: boolean;
20
+ /** The configured ACME directory; absent means Let's Encrypt per `useProduction`. */
21
+ directoryUrl?: string;
20
22
  autoRenew: boolean;
21
23
  renewThresholdDays: number;
22
24
  } | null;
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "MAC authentication"
29
29
  ],
30
30
  "name": "@serve.zone/dcrouter-apiclient",
31
- "version": "32.4.0",
31
+ "version": "32.5.0",
32
32
  "type": "module",
33
33
  "description": "Object-oriented TypeScript client and shared TypedRequest contracts for the dcrouter OpsServer API.",
34
34
  "main": "./dist_ts_apiclient/index.js",
@@ -10,8 +10,15 @@ export interface IAcmeConfig {
10
10
  accountEmail: string;
11
11
  /** Whether ACME is enabled. If false, no certs are issued via ACME. */
12
12
  enabled: boolean;
13
- /** True = Let's Encrypt production, false = staging. */
13
+ /** True = Let's Encrypt production, false = staging. Ignored while `directoryUrl` is set. */
14
14
  useProduction: boolean;
15
+ /**
16
+ * ACME directory of another CA, such as a private or test CA. Absent means
17
+ * Let's Encrypt, production or staging per `useProduction`. Must be an
18
+ * `https:` URL, or an `http:` URL on `localhost`, `127.0.0.1` or `[::1]`,
19
+ * without credentials or fragment (SmartAcme's rule).
20
+ */
21
+ directoryUrl?: string;
15
22
  /** Whether to automatically renew certs before expiry. */
16
23
  autoRenew: boolean;
17
24
  /** Renew when a cert has fewer than this many days of validity left. */
@@ -31,7 +31,10 @@ export interface IReq_GetAcmeConfig extends plugins.typedrequestInterfaces.imple
31
31
  * NOTE: SmartProxy and SmartAcme receive the configuration when dcrouter builds
32
32
  * them, so an update, `renewThresholdDays` included, takes effect at the next
33
33
  * restart or SmartProxy rebuild. `renewThresholdDays` must be a positive number
34
- * of days.
34
+ * of days. `directoryUrl` selects another CA's ACME directory and `null` returns
35
+ * to Let's Encrypt; like `accountEmail` and `useProduction`, it is refused while
36
+ * certificate jobs or ACME DNS cleanup are unfinished, and issuance waits for
37
+ * the rebuild after a change.
35
38
  */
36
39
  export interface IReq_UpdateAcmeConfig extends plugins.typedrequestInterfaces.implementsTR<
37
40
  plugins.typedrequestInterfaces.ITypedRequest,
@@ -46,6 +49,7 @@ export interface IReq_UpdateAcmeConfig extends plugins.typedrequestInterfaces.im
46
49
  useProduction?: boolean;
47
50
  autoRenew?: boolean;
48
51
  renewThresholdDays?: number;
52
+ directoryUrl?: string | null;
49
53
  };
50
54
  response: {
51
55
  success: boolean;
@@ -18,6 +18,8 @@ export interface IConfigData {
18
18
  enabled: boolean;
19
19
  accountEmail: string;
20
20
  useProduction: boolean;
21
+ /** The configured ACME directory; absent means Let's Encrypt per `useProduction`. */
22
+ directoryUrl?: string;
21
23
  autoRenew: boolean;
22
24
  renewThresholdDays: number;
23
25
  } | null;