@serve.zone/dcrouter-apiclient 32.3.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.
- package/dist_ts_apiclient/classes.apitoken.d.ts +41 -0
- package/dist_ts_apiclient/classes.apitoken.js +115 -0
- package/dist_ts_apiclient/classes.certificate.d.ts +57 -0
- package/dist_ts_apiclient/classes.certificate.js +69 -0
- package/dist_ts_apiclient/classes.config.d.ts +7 -0
- package/dist_ts_apiclient/classes.config.js +11 -0
- package/dist_ts_apiclient/classes.dcrouterapiclient.d.ts +54 -0
- package/dist_ts_apiclient/classes.dcrouterapiclient.js +97 -0
- package/dist_ts_apiclient/classes.email.d.ts +30 -0
- package/dist_ts_apiclient/classes.email.js +52 -0
- package/dist_ts_apiclient/classes.gatewayclient.d.ts +28 -0
- package/dist_ts_apiclient/classes.gatewayclient.js +52 -0
- package/dist_ts_apiclient/classes.logs.d.ts +28 -0
- package/dist_ts_apiclient/classes.logs.js +69 -0
- package/dist_ts_apiclient/classes.radius.d.ts +59 -0
- package/dist_ts_apiclient/classes.radius.js +95 -0
- package/dist_ts_apiclient/classes.remoteingress.d.ts +66 -0
- package/dist_ts_apiclient/classes.remoteingress.js +164 -0
- package/dist_ts_apiclient/classes.route.d.ts +39 -0
- package/dist_ts_apiclient/classes.route.js +125 -0
- package/dist_ts_apiclient/classes.stats.d.ts +47 -0
- package/dist_ts_apiclient/classes.stats.js +38 -0
- package/dist_ts_apiclient/classes.testing.d.ts +65 -0
- package/dist_ts_apiclient/classes.testing.js +120 -0
- package/dist_ts_apiclient/index.d.ts +12 -0
- package/dist_ts_apiclient/index.js +16 -0
- package/dist_ts_apiclient/plugins.d.ts +4 -0
- package/dist_ts_apiclient/plugins.js +6 -0
- package/dist_ts_interfaces/data/acme-config.d.ts +23 -0
- package/dist_ts_interfaces/data/acme-config.js +2 -0
- package/dist_ts_interfaces/data/auth.d.ts +8 -0
- package/dist_ts_interfaces/data/auth.js +2 -0
- package/dist_ts_interfaces/data/config-events.d.ts +34 -0
- package/dist_ts_interfaces/data/config-events.js +8 -0
- package/dist_ts_interfaces/data/dns-authority.d.ts +98 -0
- package/dist_ts_interfaces/data/dns-authority.js +26 -0
- package/dist_ts_interfaces/data/dns-provider.d.ts +136 -0
- package/dist_ts_interfaces/data/dns-provider.js +41 -0
- package/dist_ts_interfaces/data/dns-record.d.ts +48 -0
- package/dist_ts_interfaces/data/dns-record.js +2 -0
- package/dist_ts_interfaces/data/domain.d.ts +35 -0
- package/dist_ts_interfaces/data/domain.js +2 -0
- package/dist_ts_interfaces/data/email-domain.d.ts +177 -0
- package/dist_ts_interfaces/data/email-domain.js +2 -0
- package/dist_ts_interfaces/data/email-settings.d.ts +68 -0
- package/dist_ts_interfaces/data/email-settings.js +2 -0
- package/dist_ts_interfaces/data/index.d.ts +18 -0
- package/dist_ts_interfaces/data/index.js +19 -0
- package/dist_ts_interfaces/data/remoteingress.d.ts +181 -0
- package/dist_ts_interfaces/data/remoteingress.js +15 -0
- package/dist_ts_interfaces/data/route-management.d.ts +270 -0
- package/dist_ts_interfaces/data/route-management.js +130 -0
- package/dist_ts_interfaces/data/security-policy.d.ts +32 -0
- package/dist_ts_interfaces/data/security-policy.js +2 -0
- package/dist_ts_interfaces/data/smtp-account.d.ts +50 -0
- package/dist_ts_interfaces/data/smtp-account.js +9 -0
- package/dist_ts_interfaces/data/stats.d.ts +283 -0
- package/dist_ts_interfaces/data/stats.js +2 -0
- package/dist_ts_interfaces/data/target-profile.d.ts +30 -0
- package/dist_ts_interfaces/data/target-profile.js +2 -0
- package/dist_ts_interfaces/data/testing.d.ts +191 -0
- package/dist_ts_interfaces/data/testing.js +20 -0
- package/dist_ts_interfaces/data/vpn.d.ts +65 -0
- package/dist_ts_interfaces/data/vpn.js +2 -0
- package/dist_ts_interfaces/data/workhoster.d.ts +63 -0
- package/dist_ts_interfaces/data/workhoster.js +2 -0
- package/dist_ts_interfaces/index.d.ts +5 -0
- package/dist_ts_interfaces/index.js +8 -0
- package/dist_ts_interfaces/plugins.d.ts +2 -0
- package/dist_ts_interfaces/plugins.js +4 -0
- package/dist_ts_interfaces/requests/acme-config.d.ts +42 -0
- package/dist_ts_interfaces/requests/acme-config.js +2 -0
- package/dist_ts_interfaces/requests/admin.d.ts +69 -0
- package/dist_ts_interfaces/requests/admin.js +3 -0
- package/dist_ts_interfaces/requests/api-tokens.d.ts +85 -0
- package/dist_ts_interfaces/requests/api-tokens.js +2 -0
- package/dist_ts_interfaces/requests/certificate.d.ts +87 -0
- package/dist_ts_interfaces/requests/certificate.js +5 -0
- package/dist_ts_interfaces/requests/combined.stats.d.ts +29 -0
- package/dist_ts_interfaces/requests/combined.stats.js +2 -0
- package/dist_ts_interfaces/requests/config-events.d.ts +35 -0
- package/dist_ts_interfaces/requests/config-events.js +4 -0
- package/dist_ts_interfaces/requests/config.d.ts +93 -0
- package/dist_ts_interfaces/requests/config.js +3 -0
- package/dist_ts_interfaces/requests/dns-authority.d.ts +80 -0
- package/dist_ts_interfaces/requests/dns-authority.js +3 -0
- package/dist_ts_interfaces/requests/dns-providers.d.ts +117 -0
- package/dist_ts_interfaces/requests/dns-providers.js +2 -0
- package/dist_ts_interfaces/requests/dns-records.d.ts +89 -0
- package/dist_ts_interfaces/requests/dns-records.js +2 -0
- package/dist_ts_interfaces/requests/domains.d.ts +142 -0
- package/dist_ts_interfaces/requests/domains.js +2 -0
- package/dist_ts_interfaces/requests/email-domains.d.ts +154 -0
- package/dist_ts_interfaces/requests/email-domains.js +2 -0
- package/dist_ts_interfaces/requests/email-ops.d.ts +211 -0
- package/dist_ts_interfaces/requests/email-ops.js +3 -0
- package/dist_ts_interfaces/requests/email-settings.d.ts +26 -0
- package/dist_ts_interfaces/requests/email-settings.js +2 -0
- package/dist_ts_interfaces/requests/index.d.ts +29 -0
- package/dist_ts_interfaces/requests/index.js +30 -0
- package/dist_ts_interfaces/requests/logs.d.ts +43 -0
- package/dist_ts_interfaces/requests/logs.js +4 -0
- package/dist_ts_interfaces/requests/network-targets.d.ts +102 -0
- package/dist_ts_interfaces/requests/network-targets.js +2 -0
- package/dist_ts_interfaces/requests/radius.d.ts +280 -0
- package/dist_ts_interfaces/requests/radius.js +3 -0
- package/dist_ts_interfaces/requests/realtime.d.ts +38 -0
- package/dist_ts_interfaces/requests/realtime.js +12 -0
- package/dist_ts_interfaces/requests/remoteingress.d.ts +162 -0
- package/dist_ts_interfaces/requests/remoteingress.js +3 -0
- package/dist_ts_interfaces/requests/route-management.d.ts +147 -0
- package/dist_ts_interfaces/requests/route-management.js +2 -0
- package/dist_ts_interfaces/requests/security-policy.d.ts +105 -0
- package/dist_ts_interfaces/requests/security-policy.js +2 -0
- package/dist_ts_interfaces/requests/smtp-accounts.d.ts +125 -0
- package/dist_ts_interfaces/requests/smtp-accounts.js +2 -0
- package/dist_ts_interfaces/requests/source-profiles.d.ts +102 -0
- package/dist_ts_interfaces/requests/source-profiles.js +2 -0
- package/dist_ts_interfaces/requests/stats.d.ts +196 -0
- package/dist_ts_interfaces/requests/stats.js +4 -0
- package/dist_ts_interfaces/requests/target-profiles.d.ts +105 -0
- package/dist_ts_interfaces/requests/target-profiles.js +2 -0
- package/dist_ts_interfaces/requests/testing.d.ts +169 -0
- package/dist_ts_interfaces/requests/testing.js +2 -0
- package/dist_ts_interfaces/requests/users.d.ts +53 -0
- package/dist_ts_interfaces/requests/users.js +3 -0
- package/dist_ts_interfaces/requests/vpn.d.ts +188 -0
- package/dist_ts_interfaces/requests/vpn.js +3 -0
- package/dist_ts_interfaces/requests/workhoster.d.ts +79 -0
- package/dist_ts_interfaces/requests/workhoster.js +2 -0
- package/license +21 -0
- package/package.json +67 -0
- package/readme.md +218 -0
- package/ts_apiclient/classes.apitoken.ts +157 -0
- package/ts_apiclient/classes.certificate.ts +124 -0
- package/ts_apiclient/classes.config.ts +17 -0
- package/ts_apiclient/classes.dcrouterapiclient.ts +138 -0
- package/ts_apiclient/classes.email.ts +77 -0
- package/ts_apiclient/classes.gatewayclient.ts +110 -0
- package/ts_apiclient/classes.logs.ts +91 -0
- package/ts_apiclient/classes.radius.ts +180 -0
- package/ts_apiclient/classes.remoteingress.ts +217 -0
- package/ts_apiclient/classes.route.ts +166 -0
- package/ts_apiclient/classes.stats.ts +111 -0
- package/ts_apiclient/classes.testing.ts +152 -0
- package/ts_apiclient/index.ts +17 -0
- package/ts_apiclient/plugins.ts +10 -0
- package/ts_apiclient/readme.md +218 -0
- package/ts_interfaces/data/acme-config.ts +23 -0
- package/ts_interfaces/data/auth.ts +8 -0
- package/ts_interfaces/data/config-events.ts +38 -0
- package/ts_interfaces/data/dns-authority.ts +106 -0
- package/ts_interfaces/data/dns-provider.ts +174 -0
- package/ts_interfaces/data/dns-record.ts +50 -0
- package/ts_interfaces/data/domain.ts +36 -0
- package/ts_interfaces/data/email-domain.ts +206 -0
- package/ts_interfaces/data/email-settings.ts +75 -0
- package/ts_interfaces/data/index.ts +18 -0
- package/ts_interfaces/data/remoteingress.ts +204 -0
- package/ts_interfaces/data/route-management.ts +436 -0
- package/ts_interfaces/data/security-policy.ts +37 -0
- package/ts_interfaces/data/smtp-account.ts +63 -0
- package/ts_interfaces/data/stats.ts +305 -0
- package/ts_interfaces/data/target-profile.ts +31 -0
- package/ts_interfaces/data/testing.ts +184 -0
- package/ts_interfaces/data/vpn.ts +68 -0
- package/ts_interfaces/data/workhoster.ts +72 -0
- package/ts_interfaces/index.ts +9 -0
- package/ts_interfaces/plugins.ts +6 -0
- package/ts_interfaces/readme.md +194 -0
- package/ts_interfaces/requests/acme-config.ts +54 -0
- package/ts_interfaces/requests/admin.ts +96 -0
- package/ts_interfaces/requests/api-tokens.ts +109 -0
- package/ts_interfaces/requests/certificate.ts +106 -0
- package/ts_interfaces/requests/combined.stats.ts +30 -0
- package/ts_interfaces/requests/config-events.ts +45 -0
- package/ts_interfaces/requests/config.ts +94 -0
- package/ts_interfaces/requests/dns-authority.ts +104 -0
- package/ts_interfaces/requests/dns-providers.ts +154 -0
- package/ts_interfaces/requests/dns-records.ts +113 -0
- package/ts_interfaces/requests/domains.ts +178 -0
- package/ts_interfaces/requests/email-domains.ts +193 -0
- package/ts_interfaces/requests/email-ops.ts +266 -0
- package/ts_interfaces/requests/email-settings.ts +34 -0
- package/ts_interfaces/requests/index.ts +29 -0
- package/ts_interfaces/requests/logs.ts +58 -0
- package/ts_interfaces/requests/network-targets.ts +127 -0
- package/ts_interfaces/requests/radius.ts +341 -0
- package/ts_interfaces/requests/realtime.ts +59 -0
- package/ts_interfaces/requests/remoteingress.ts +202 -0
- package/ts_interfaces/requests/route-management.ts +194 -0
- package/ts_interfaces/requests/security-policy.ts +144 -0
- package/ts_interfaces/requests/smtp-accounts.ts +163 -0
- package/ts_interfaces/requests/source-profiles.ts +127 -0
- package/ts_interfaces/requests/stats.ts +207 -0
- package/ts_interfaces/requests/target-profiles.ts +130 -0
- package/ts_interfaces/requests/testing.ts +186 -0
- package/ts_interfaces/requests/users.ts +66 -0
- package/ts_interfaces/requests/vpn.ts +238 -0
- package/ts_interfaces/requests/workhoster.ts +100 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DNS authority — which zones dcrouter may answer for authoritatively.
|
|
3
|
+
*
|
|
4
|
+
* dcrouter used to derive this from exactly one place: the `dnsScopes` bootstrap
|
|
5
|
+
* option, read once at startup from the OCI container config and never
|
|
6
|
+
* reconciled against anything. That produced two independent representations of
|
|
7
|
+
* the same fact — *declared* authority in bootstrap config and *real* delegation
|
|
8
|
+
* in public DNS — with nothing comparing them. In production one zone was
|
|
9
|
+
* declared while four others were live and delegated to our nameservers, so the
|
|
10
|
+
* server answered `A` with the `aa` bit for those four while REFUSING every
|
|
11
|
+
* other qtype for the same name, which public recursives turn into SERVFAIL.
|
|
12
|
+
*
|
|
13
|
+
* The fix is not to make the declared list editable. A list an operator can
|
|
14
|
+
* simply append to is self-assertion, which is precisely the failure mode that
|
|
15
|
+
* let routes claim domains nobody verified we own. Instead a zone earns
|
|
16
|
+
* authority by *proof*: its public delegation must name our nameservers. That
|
|
17
|
+
* proof is unforgeable by an ops-API caller — you cannot point `example.com`'s
|
|
18
|
+
* NS records at our nameservers unless you actually control the domain — and it
|
|
19
|
+
* is the missing comparison between the two representations.
|
|
20
|
+
*
|
|
21
|
+
* `dnsScopes` is gone entirely. There is exactly one representation of DNS
|
|
22
|
+
* authority now, it lives in the database, and it is the one that carries its
|
|
23
|
+
* own evidence.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* How a zone entered the authority set.
|
|
27
|
+
*
|
|
28
|
+
* There is only one way in: an observed public delegation to our nameservers,
|
|
29
|
+
* persisted with the evidence that justified it. Deployment configuration is
|
|
30
|
+
* deliberately not an origin — a second origin would be a second representation
|
|
31
|
+
* of the same fact, and two representations drift.
|
|
32
|
+
*/
|
|
33
|
+
export type TDnsAuthorityZoneOrigin = 'verified';
|
|
34
|
+
/** One zone in the authority set. */
|
|
35
|
+
export interface IDnsAuthorityZone {
|
|
36
|
+
zone: string;
|
|
37
|
+
origin: TDnsAuthorityZoneOrigin;
|
|
38
|
+
/** When the delegation proof was observed. */
|
|
39
|
+
verifiedAt?: number;
|
|
40
|
+
/** Nameservers observed at verification time — the evidence for the proof. */
|
|
41
|
+
observedNameservers?: string[];
|
|
42
|
+
/** Operator who performed the verification. */
|
|
43
|
+
verifiedBy?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Whether the stored authority set could be read at all.
|
|
47
|
+
*
|
|
48
|
+
* 'unavailable' is deliberately distinct from an empty `zones` array. An empty
|
|
49
|
+
* set is a *known* fact that means "claim nothing"; an unreadable document is
|
|
50
|
+
* an *unknown*, and silently rendering an unknown as an empty set is what would
|
|
51
|
+
* turn a database blip into every zone dropping off the air.
|
|
52
|
+
*/
|
|
53
|
+
export type TDnsAuthorityState = 'loaded' | 'unavailable';
|
|
54
|
+
export interface IDnsAuthoritySettings {
|
|
55
|
+
/** The authority set. Delegation-verified zones, and nothing else. */
|
|
56
|
+
zones: IDnsAuthorityZone[];
|
|
57
|
+
/** Whether the stored set was readable when it was last loaded. */
|
|
58
|
+
state: TDnsAuthorityState;
|
|
59
|
+
/** Nameservers a delegation must name for a zone to be verifiable. */
|
|
60
|
+
expectedNameservers: string[];
|
|
61
|
+
updatedAt: number;
|
|
62
|
+
updatedBy: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Outcome of a delegation probe.
|
|
66
|
+
*
|
|
67
|
+
* 'undeterminable' is deliberately distinct from 'not-delegated': a resolver
|
|
68
|
+
* timeout is not evidence that a zone is not ours. Conflating them would let a
|
|
69
|
+
* transient network fault revoke authority, turning a blip into an outage.
|
|
70
|
+
*/
|
|
71
|
+
export type TDnsDelegationVerdict = 'delegated' | 'not-delegated' | 'undeterminable';
|
|
72
|
+
export interface IDnsDelegationProbe {
|
|
73
|
+
zone: string;
|
|
74
|
+
verdict: TDnsDelegationVerdict;
|
|
75
|
+
/** NS records observed for the zone, lowercased and trailing-dot stripped. */
|
|
76
|
+
observedNameservers: string[];
|
|
77
|
+
expectedNameservers: string[];
|
|
78
|
+
detail: string;
|
|
79
|
+
}
|
|
80
|
+
/** A disagreement between claimed authority and what is actually true. */
|
|
81
|
+
export type TDnsAuthorityDriftKind =
|
|
82
|
+
/** A dcrouter-hosted zone is delegated to us but is not in the authority set. */
|
|
83
|
+
'delegated-but-unclaimed'
|
|
84
|
+
/** A verified zone's delegation no longer names our nameservers. */
|
|
85
|
+
| 'claimed-but-not-delegated'
|
|
86
|
+
/**
|
|
87
|
+
* A verified zone with no dcrouter-hosted domain behind it. Authority without
|
|
88
|
+
* a `DomainDoc` serves no records and no generated apex NS, so the zone is
|
|
89
|
+
* claimed and empty — a lame delegation we are responsible for.
|
|
90
|
+
*/
|
|
91
|
+
| 'verified-but-unhosted';
|
|
92
|
+
export interface IDnsAuthorityDrift {
|
|
93
|
+
zone: string;
|
|
94
|
+
kind: TDnsAuthorityDriftKind;
|
|
95
|
+
observedNameservers: string[];
|
|
96
|
+
expectedNameservers: string[];
|
|
97
|
+
detail: string;
|
|
98
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DNS authority — which zones dcrouter may answer for authoritatively.
|
|
3
|
+
*
|
|
4
|
+
* dcrouter used to derive this from exactly one place: the `dnsScopes` bootstrap
|
|
5
|
+
* option, read once at startup from the OCI container config and never
|
|
6
|
+
* reconciled against anything. That produced two independent representations of
|
|
7
|
+
* the same fact — *declared* authority in bootstrap config and *real* delegation
|
|
8
|
+
* in public DNS — with nothing comparing them. In production one zone was
|
|
9
|
+
* declared while four others were live and delegated to our nameservers, so the
|
|
10
|
+
* server answered `A` with the `aa` bit for those four while REFUSING every
|
|
11
|
+
* other qtype for the same name, which public recursives turn into SERVFAIL.
|
|
12
|
+
*
|
|
13
|
+
* The fix is not to make the declared list editable. A list an operator can
|
|
14
|
+
* simply append to is self-assertion, which is precisely the failure mode that
|
|
15
|
+
* let routes claim domains nobody verified we own. Instead a zone earns
|
|
16
|
+
* authority by *proof*: its public delegation must name our nameservers. That
|
|
17
|
+
* proof is unforgeable by an ops-API caller — you cannot point `example.com`'s
|
|
18
|
+
* NS records at our nameservers unless you actually control the domain — and it
|
|
19
|
+
* is the missing comparison between the two representations.
|
|
20
|
+
*
|
|
21
|
+
* `dnsScopes` is gone entirely. There is exactly one representation of DNS
|
|
22
|
+
* authority now, it lives in the database, and it is the one that carries its
|
|
23
|
+
* own evidence.
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5zLWF1dGhvcml0eS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvZGF0YS9kbnMtYXV0aG9yaXR5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQXVCRyJ9
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable ID for the built-in DcRouter pseudo-provider. The Providers list
|
|
3
|
+
* surfaces this as the first, non-deletable row so operators see a uniform
|
|
4
|
+
* "who serves this?" answer for every domain. The ID is magic — it never
|
|
5
|
+
* exists in the DnsProviderDoc collection; handlers inject it at read time
|
|
6
|
+
* and reject any mutation that targets it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DCROUTER_BUILTIN_PROVIDER_ID = "__dcrouter__";
|
|
9
|
+
/**
|
|
10
|
+
* Supported DNS provider types.
|
|
11
|
+
*
|
|
12
|
+
* - 'cloudflare' → Cloudflare account (API token-based). Provider stays
|
|
13
|
+
* authoritative; dcrouter pushes record changes via API.
|
|
14
|
+
* - 'dcrouter' → Built-in pseudo-provider for dcrouter-hosted zones.
|
|
15
|
+
* dcrouter itself is the authoritative DNS server. No
|
|
16
|
+
* credentials, cannot be created/edited/deleted through
|
|
17
|
+
* the provider CRUD — the Providers view renders it from
|
|
18
|
+
* a handler-level synthetic row.
|
|
19
|
+
*
|
|
20
|
+
* The abstraction is designed so additional providers (Route53, Gandi,
|
|
21
|
+
* DigitalOcean, foreign dcrouters…) can be added by implementing the
|
|
22
|
+
* IDnsProvider class interface in ts/dns/providers/.
|
|
23
|
+
*/
|
|
24
|
+
export type TDnsProviderType = 'cloudflare' | 'dcrouter';
|
|
25
|
+
/**
|
|
26
|
+
* Status of the last connection test against a provider.
|
|
27
|
+
*/
|
|
28
|
+
export type TDnsProviderStatus = 'untested' | 'ok' | 'error';
|
|
29
|
+
/**
|
|
30
|
+
* Cloudflare-specific credential shape.
|
|
31
|
+
*/
|
|
32
|
+
export interface ICloudflareCredentials {
|
|
33
|
+
apiToken: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Discriminated union of all supported provider credential shapes.
|
|
37
|
+
* Persisted opaquely on `IDnsProvider.credentials`.
|
|
38
|
+
*/
|
|
39
|
+
export type TDnsProviderCredentials = ({
|
|
40
|
+
type: 'cloudflare';
|
|
41
|
+
} & ICloudflareCredentials);
|
|
42
|
+
/**
|
|
43
|
+
* A registered DNS provider account. Holds the credentials needed to
|
|
44
|
+
* call the provider's API and a snapshot of its last health check.
|
|
45
|
+
*/
|
|
46
|
+
export interface IDnsProvider {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: TDnsProviderType;
|
|
50
|
+
/** Opaque credentials object — shape depends on `type`. */
|
|
51
|
+
credentials: TDnsProviderCredentials;
|
|
52
|
+
status: TDnsProviderStatus;
|
|
53
|
+
lastTestedAt?: number;
|
|
54
|
+
lastError?: string;
|
|
55
|
+
createdAt: number;
|
|
56
|
+
updatedAt: number;
|
|
57
|
+
createdBy: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A redacted view of IDnsProvider safe to send to the UI / over the wire.
|
|
61
|
+
* Strips secret fields from `credentials` while preserving the rest.
|
|
62
|
+
*/
|
|
63
|
+
export interface IDnsProviderPublic {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
type: TDnsProviderType;
|
|
67
|
+
status: TDnsProviderStatus;
|
|
68
|
+
lastTestedAt?: number;
|
|
69
|
+
lastError?: string;
|
|
70
|
+
createdAt: number;
|
|
71
|
+
updatedAt: number;
|
|
72
|
+
createdBy: string;
|
|
73
|
+
/** Whether credentials are configured (true after creation). Never the secret itself. */
|
|
74
|
+
hasCredentials: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* True for the built-in DcRouter pseudo-provider — read-only, cannot be
|
|
77
|
+
* created / edited / deleted. Injected by the handler layer, never
|
|
78
|
+
* persisted in the DnsProviderDoc collection.
|
|
79
|
+
*/
|
|
80
|
+
builtIn?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A domain reported by a provider's API (not yet imported into dcrouter).
|
|
84
|
+
*/
|
|
85
|
+
export interface IProviderDomainListing {
|
|
86
|
+
/** FQDN of the zone (e.g. 'example.com'). */
|
|
87
|
+
name: string;
|
|
88
|
+
/** Provider's internal zone identifier (zone_id for Cloudflare). */
|
|
89
|
+
externalId: string;
|
|
90
|
+
/** Authoritative nameservers reported by the provider. */
|
|
91
|
+
nameservers: string[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Schema entry for a single credential field, used by the OpsServer UI to
|
|
95
|
+
* render a provider's credential form dynamically.
|
|
96
|
+
*/
|
|
97
|
+
export interface IDnsProviderCredentialField {
|
|
98
|
+
/** Key under which the value is stored in the credentials object. */
|
|
99
|
+
key: string;
|
|
100
|
+
/** Label shown to the user. */
|
|
101
|
+
label: string;
|
|
102
|
+
/** Optional inline help text. */
|
|
103
|
+
helpText?: string;
|
|
104
|
+
/** Whether the field must be filled. */
|
|
105
|
+
required: boolean;
|
|
106
|
+
/** True for secret fields (rendered as password input, never echoed back). */
|
|
107
|
+
secret: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Metadata describing a DNS provider type. Drives:
|
|
111
|
+
* - the OpsServer UI's provider type picker + credential form,
|
|
112
|
+
* - documentation of which credentials each provider needs,
|
|
113
|
+
* - end-to-end consistency between the type union, the discriminated
|
|
114
|
+
* credentials union, the runtime factory, and the form rendering.
|
|
115
|
+
*
|
|
116
|
+
* To add a new provider, append a new entry to `dnsProviderTypeDescriptors`
|
|
117
|
+
* below — and follow the checklist in `ts/dns/providers/factory.ts`.
|
|
118
|
+
*/
|
|
119
|
+
export interface IDnsProviderTypeDescriptor {
|
|
120
|
+
type: TDnsProviderType;
|
|
121
|
+
/** Human-readable name for the UI. */
|
|
122
|
+
displayName: string;
|
|
123
|
+
/** One-line description shown next to the type picker. */
|
|
124
|
+
description: string;
|
|
125
|
+
/** Schema for the credentials form. */
|
|
126
|
+
credentialFields: IDnsProviderCredentialField[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Single source of truth for which DNS provider types exist and what
|
|
130
|
+
* credentials each one needs. Used by both backend and frontend.
|
|
131
|
+
*/
|
|
132
|
+
export declare const dnsProviderTypeDescriptors: ReadonlyArray<IDnsProviderTypeDescriptor>;
|
|
133
|
+
/**
|
|
134
|
+
* Look up the descriptor for a given provider type.
|
|
135
|
+
*/
|
|
136
|
+
export declare function getDnsProviderTypeDescriptor(type: TDnsProviderType): IDnsProviderTypeDescriptor | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable ID for the built-in DcRouter pseudo-provider. The Providers list
|
|
3
|
+
* surfaces this as the first, non-deletable row so operators see a uniform
|
|
4
|
+
* "who serves this?" answer for every domain. The ID is magic — it never
|
|
5
|
+
* exists in the DnsProviderDoc collection; handlers inject it at read time
|
|
6
|
+
* and reject any mutation that targets it.
|
|
7
|
+
*/
|
|
8
|
+
export const DCROUTER_BUILTIN_PROVIDER_ID = '__dcrouter__';
|
|
9
|
+
/**
|
|
10
|
+
* Single source of truth for which DNS provider types exist and what
|
|
11
|
+
* credentials each one needs. Used by both backend and frontend.
|
|
12
|
+
*/
|
|
13
|
+
export const dnsProviderTypeDescriptors = [
|
|
14
|
+
{
|
|
15
|
+
type: 'dcrouter',
|
|
16
|
+
displayName: 'DcRouter (built-in)',
|
|
17
|
+
description: 'Built-in authoritative DNS. Records are served directly by dcrouter — delegate the domain\'s NS records to make this effective.',
|
|
18
|
+
credentialFields: [],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'cloudflare',
|
|
22
|
+
displayName: 'Cloudflare',
|
|
23
|
+
description: 'External DNS provider. The provider stays authoritative; dcrouter pushes record changes via its API.',
|
|
24
|
+
credentialFields: [
|
|
25
|
+
{
|
|
26
|
+
key: 'apiToken',
|
|
27
|
+
label: 'API Token',
|
|
28
|
+
helpText: 'A Cloudflare API token with Zone:Read and DNS:Edit permissions for the target zones.',
|
|
29
|
+
required: true,
|
|
30
|
+
secret: true,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Look up the descriptor for a given provider type.
|
|
37
|
+
*/
|
|
38
|
+
export function getDnsProviderTypeDescriptor(type) {
|
|
39
|
+
return dnsProviderTypeDescriptors.find((d) => d.type === type);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5zLXByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHNfaW50ZXJmYWNlcy9kYXRhL2Rucy1wcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFDSCxNQUFNLENBQUMsTUFBTSw0QkFBNEIsR0FBRyxjQUFjLENBQUM7QUFpSTNEOzs7R0FHRztBQUNILE1BQU0sQ0FBQyxNQUFNLDBCQUEwQixHQUE4QztJQUNuRjtRQUNFLElBQUksRUFBRSxVQUFVO1FBQ2hCLFdBQVcsRUFBRSxxQkFBcUI7UUFDbEMsV0FBVyxFQUNULGlJQUFpSTtRQUNuSSxnQkFBZ0IsRUFBRSxFQUFFO0tBQ3JCO0lBQ0Q7UUFDRSxJQUFJLEVBQUUsWUFBWTtRQUNsQixXQUFXLEVBQUUsWUFBWTtRQUN6QixXQUFXLEVBQ1Qsc0dBQXNHO1FBQ3hHLGdCQUFnQixFQUFFO1lBQ2hCO2dCQUNFLEdBQUcsRUFBRSxVQUFVO2dCQUNmLEtBQUssRUFBRSxXQUFXO2dCQUNsQixRQUFRLEVBQ04sc0ZBQXNGO2dCQUN4RixRQUFRLEVBQUUsSUFBSTtnQkFDZCxNQUFNLEVBQUUsSUFBSTthQUNiO1NBQ0Y7S0FDRjtDQUNGLENBQUM7QUFFRjs7R0FFRztBQUNILE1BQU0sVUFBVSw0QkFBNEIsQ0FDMUMsSUFBc0I7SUFFdEIsT0FBTywwQkFBMEIsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEtBQUssSUFBSSxDQUFDLENBQUM7QUFDakUsQ0FBQyJ9
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported DNS record types.
|
|
3
|
+
*/
|
|
4
|
+
export type TDnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA' | 'CAA';
|
|
5
|
+
/**
|
|
6
|
+
* Where a DNS record came from.
|
|
7
|
+
*
|
|
8
|
+
* - 'local' → originated in this dcrouter (created via UI / API)
|
|
9
|
+
* - 'synced' → pulled from an upstream provider (Cloudflare, foreign
|
|
10
|
+
* dcrouter, …) during a sync operation
|
|
11
|
+
*/
|
|
12
|
+
export type TDnsRecordSource = 'local' | 'synced';
|
|
13
|
+
/**
|
|
14
|
+
* A DNS record. For dcrouter-hosted (authoritative) domains, the record is
|
|
15
|
+
* registered with the embedded smartdns.DnsServer. For provider-managed
|
|
16
|
+
* domains, the record is mirrored from / pushed to the provider API and
|
|
17
|
+
* `providerRecordId` holds the provider's internal record id (for updates
|
|
18
|
+
* and deletes).
|
|
19
|
+
*/
|
|
20
|
+
export interface IDnsRecord {
|
|
21
|
+
id: string;
|
|
22
|
+
/** ID of the parent IDomain. */
|
|
23
|
+
domainId: string;
|
|
24
|
+
/** Fully qualified record name (e.g. 'www.example.com'). */
|
|
25
|
+
name: string;
|
|
26
|
+
type: TDnsRecordType;
|
|
27
|
+
/**
|
|
28
|
+
* Record value as a string. For MX records, formatted as
|
|
29
|
+
* `<priority> <exchange>` (e.g. `10 mail.example.com`).
|
|
30
|
+
*/
|
|
31
|
+
value: string;
|
|
32
|
+
/** TTL in seconds. */
|
|
33
|
+
ttl: number;
|
|
34
|
+
/** Cloudflare-specific: whether the record is proxied through Cloudflare. */
|
|
35
|
+
proxied?: boolean;
|
|
36
|
+
source: TDnsRecordSource;
|
|
37
|
+
/** Provider's internal record id (for updates/deletes). Only set for provider records. */
|
|
38
|
+
providerRecordId?: string;
|
|
39
|
+
createdAt: number;
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
createdBy: string;
|
|
42
|
+
/** Reconciler namespace. Absent means the record is operator/provider-owned. */
|
|
43
|
+
managedBy?: string;
|
|
44
|
+
/** Domain or topology owner within the reconciler namespace. */
|
|
45
|
+
managedOwnerId?: string;
|
|
46
|
+
/** Deterministic record identity. Unique only when present. */
|
|
47
|
+
managedRecordKey?: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a domain came from / how it is managed.
|
|
3
|
+
*
|
|
4
|
+
* - 'dcrouter' → dcrouter is the authoritative DNS server for this domain;
|
|
5
|
+
* records are served by the embedded smartdns.DnsServer.
|
|
6
|
+
* Operators delegate the domain's NS records to make this
|
|
7
|
+
* effective.
|
|
8
|
+
* - 'provider' → domain was imported from an external DNS provider
|
|
9
|
+
* (e.g. Cloudflare). The provider stays authoritative;
|
|
10
|
+
* dcrouter only reads/writes records via the provider API.
|
|
11
|
+
*/
|
|
12
|
+
export type TDomainSource = 'dcrouter' | 'provider';
|
|
13
|
+
/**
|
|
14
|
+
* A domain under management by dcrouter.
|
|
15
|
+
*/
|
|
16
|
+
export interface IDomain {
|
|
17
|
+
id: string;
|
|
18
|
+
/** Fully qualified domain name (e.g. 'example.com'). */
|
|
19
|
+
name: string;
|
|
20
|
+
source: TDomainSource;
|
|
21
|
+
/** ID of the DnsProvider that owns this domain — only set when source === 'provider'. */
|
|
22
|
+
providerId?: string;
|
|
23
|
+
/** True when dcrouter is the authoritative DNS server for this domain (source === 'dcrouter'). */
|
|
24
|
+
authoritative: boolean;
|
|
25
|
+
/** Authoritative nameservers (display only — populated from provider for imported domains). */
|
|
26
|
+
nameservers?: string[];
|
|
27
|
+
/** Provider's internal zone identifier — only set when source === 'provider'. */
|
|
28
|
+
externalZoneId?: string;
|
|
29
|
+
/** Last time records were synced from the provider — only set when source === 'provider'. */
|
|
30
|
+
lastSyncedAt?: number;
|
|
31
|
+
description?: string;
|
|
32
|
+
createdAt: number;
|
|
33
|
+
updatedAt: number;
|
|
34
|
+
createdBy: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DNS record validation status for a single email-related record (MX, SPF, DKIM, DMARC).
|
|
3
|
+
*/
|
|
4
|
+
export type TDnsRecordStatus = 'valid' | 'missing' | 'invalid' | 'unchecked';
|
|
5
|
+
/** Durable lifecycle of a managed sending domain. Inbound acceptance is independent of this state. */
|
|
6
|
+
export type TEmailDomainLifecycleStatus = 'pending' | 'active' | 'failed' | 'deleting';
|
|
7
|
+
export type TEmailDnsVerificationOutcome = 'valid' | 'missing' | 'propagation' | 'duplicate' | 'conflict' | 'invalid' | 'lookup-error';
|
|
8
|
+
export type TEmailDnsIntentStatus = 'pending' | 'satisfied' | 'valid' | 'conflict' | 'failed' | 'deleting';
|
|
9
|
+
export interface IEmailDomainOperationError {
|
|
10
|
+
code: string;
|
|
11
|
+
message: string;
|
|
12
|
+
recordKey?: string;
|
|
13
|
+
retryable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IEmailDkimMaterial {
|
|
16
|
+
selector: string;
|
|
17
|
+
keySize: number;
|
|
18
|
+
publicKey: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
validatedAt?: string;
|
|
21
|
+
promotedAt?: string;
|
|
22
|
+
retireAfter?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IEmailDnsRecordIntent {
|
|
25
|
+
key: string;
|
|
26
|
+
ownerType: 'domain' | 'topology';
|
|
27
|
+
ownerId: string;
|
|
28
|
+
domainId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
type: 'MX' | 'TXT' | 'A' | 'AAAA';
|
|
31
|
+
value: string;
|
|
32
|
+
ttl: number;
|
|
33
|
+
status: TEmailDnsIntentStatus;
|
|
34
|
+
verificationOutcome?: TEmailDnsVerificationOutcome;
|
|
35
|
+
satisfactionSource?: 'managed' | 'operator';
|
|
36
|
+
effectiveValue?: string;
|
|
37
|
+
providerRecordId?: string;
|
|
38
|
+
lastAttemptAt?: string;
|
|
39
|
+
validatedAt?: string;
|
|
40
|
+
error?: IEmailDomainOperationError;
|
|
41
|
+
}
|
|
42
|
+
export interface IEmailDomainEdgeIdentity {
|
|
43
|
+
edgeId: string;
|
|
44
|
+
hostname: string;
|
|
45
|
+
ipv4?: string;
|
|
46
|
+
ipv6?: string;
|
|
47
|
+
observedAt: string;
|
|
48
|
+
hubReceivedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IEmailDomainMxSlot {
|
|
51
|
+
priority: 10 | 20;
|
|
52
|
+
edgeId: string;
|
|
53
|
+
hostname: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IEmailDomainDnsRevision {
|
|
56
|
+
id: string;
|
|
57
|
+
/** Desired reconciliation generation validated by this revision. Legacy revisions may omit it. */
|
|
58
|
+
generation?: number;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
activatedAt?: string;
|
|
61
|
+
selector: string;
|
|
62
|
+
edgeIdentities: IEmailDomainEdgeIdentity[];
|
|
63
|
+
mxSlots: IEmailDomainMxSlot[];
|
|
64
|
+
recordKeys: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface IEmailDomainReconciliation {
|
|
67
|
+
lifecycleStatus: TEmailDomainLifecycleStatus;
|
|
68
|
+
desiredGeneration: number;
|
|
69
|
+
activeRevision?: IEmailDomainDnsRevision;
|
|
70
|
+
pendingRevision?: IEmailDomainDnsRevision;
|
|
71
|
+
intents: IEmailDnsRecordIntent[];
|
|
72
|
+
errors: IEmailDomainOperationError[];
|
|
73
|
+
capability?: {
|
|
74
|
+
egressIdentityProof: 'supported' | 'unsupported';
|
|
75
|
+
selectorCorrectSigning: 'supported' | 'unsupported';
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Provider-managed DomainDoc ids that may contain records owned by this
|
|
79
|
+
* email domain. undefined means legacy/unknown provenance and blocks
|
|
80
|
+
* destructive cleanup; [] proves that no provider zone is involved.
|
|
81
|
+
*/
|
|
82
|
+
providerZoneIds?: string[];
|
|
83
|
+
/** Consecutive retryable reconciliation failures used for bounded backoff. */
|
|
84
|
+
retryAttempt?: number;
|
|
85
|
+
lastAttemptAt?: string;
|
|
86
|
+
lastSuccessAt?: string;
|
|
87
|
+
retryAt?: string;
|
|
88
|
+
deletingAt?: string;
|
|
89
|
+
/** Provider record ids whose absence must be confirmed before a deletion tombstone can finalize. */
|
|
90
|
+
deletingProviderRecordIds?: string[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* An email domain managed by dcrouter.
|
|
94
|
+
*
|
|
95
|
+
* Each email domain is linked to an existing dcrouter DNS domain (dcrouter-hosted
|
|
96
|
+
* or provider-managed). The DNS management path is inherited from the linked domain
|
|
97
|
+
* — no separate DNS mode is needed.
|
|
98
|
+
*/
|
|
99
|
+
export interface IEmailDomain {
|
|
100
|
+
id: string;
|
|
101
|
+
/** Fully qualified email domain name (e.g. 'example.com' or 'mail.example.com'). */
|
|
102
|
+
domain: string;
|
|
103
|
+
/** ID of the linked dcrouter DNS domain — determines how DNS records are managed. */
|
|
104
|
+
linkedDomainId: string;
|
|
105
|
+
/** Optional subdomain prefix (e.g. 'mail' for mail.example.com). Empty/undefined = bare domain. */
|
|
106
|
+
subdomain?: string;
|
|
107
|
+
/** DKIM configuration and key state. */
|
|
108
|
+
dkim: IEmailDomainDkim;
|
|
109
|
+
/** Optional per-domain rate limits. */
|
|
110
|
+
rateLimits?: IEmailDomainRateLimits;
|
|
111
|
+
/** Optional RemoteIngress edge pinning — restricts inbound MX targets and outbound egress to matching edges. */
|
|
112
|
+
remoteIngress?: IEmailDomainRemoteIngress;
|
|
113
|
+
/** DNS record validation status — populated by validateDns(). */
|
|
114
|
+
dnsStatus: IEmailDomainDnsStatus;
|
|
115
|
+
/** Durable desired/active DNS state and reconciliation outcomes. */
|
|
116
|
+
reconciliation?: IEmailDomainReconciliation;
|
|
117
|
+
/** Active outbound DKIM material. Legacy documents may only have `dkim`. */
|
|
118
|
+
activeDkim?: IEmailDkimMaterial;
|
|
119
|
+
/** Staged DKIM material. Never used for signing before promotion. */
|
|
120
|
+
pendingDkim?: IEmailDkimMaterial;
|
|
121
|
+
/** Previously active keys retained for the configured overlap window. */
|
|
122
|
+
retiringDkim?: IEmailDkimMaterial[];
|
|
123
|
+
createdAt: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Per-mail-domain RemoteIngress pinning (mirrors IRouteRemoteIngress.edgeFilter semantics).
|
|
128
|
+
*/
|
|
129
|
+
export interface IEmailDomainRemoteIngress {
|
|
130
|
+
/** Edge ids or tags. When set, only matching edges front this domain (inbound MX target + outbound egress).
|
|
131
|
+
* Absent/empty = all mail-capable edges. */
|
|
132
|
+
edgeFilter?: string[];
|
|
133
|
+
}
|
|
134
|
+
export interface IEmailDomainDkim {
|
|
135
|
+
/** DKIM selector (default: 'default'). */
|
|
136
|
+
selector: string;
|
|
137
|
+
/** RSA key size in bits (default: 2048). */
|
|
138
|
+
keySize: number;
|
|
139
|
+
/** Base64-encoded public key — populated after key generation. */
|
|
140
|
+
publicKey?: string;
|
|
141
|
+
/** Whether automatic key rotation is enabled. */
|
|
142
|
+
rotateKeys: boolean;
|
|
143
|
+
/** Days between key rotations (default: 90). */
|
|
144
|
+
rotationIntervalDays: number;
|
|
145
|
+
/** ISO date of last key rotation. */
|
|
146
|
+
lastRotatedAt?: string;
|
|
147
|
+
/** Days an old selector remains published after promotion (default: 30). */
|
|
148
|
+
retirementOverlapDays?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface IEmailDomainRateLimits {
|
|
151
|
+
outbound?: {
|
|
152
|
+
messagesPerMinute?: number;
|
|
153
|
+
messagesPerHour?: number;
|
|
154
|
+
messagesPerDay?: number;
|
|
155
|
+
};
|
|
156
|
+
inbound?: {
|
|
157
|
+
messagesPerMinute?: number;
|
|
158
|
+
connectionsPerIp?: number;
|
|
159
|
+
recipientsPerMessage?: number;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export interface IEmailDomainDnsStatus {
|
|
163
|
+
mx: TDnsRecordStatus;
|
|
164
|
+
spf: TDnsRecordStatus;
|
|
165
|
+
dkim: TDnsRecordStatus;
|
|
166
|
+
dmarc: TDnsRecordStatus;
|
|
167
|
+
lastCheckedAt?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* A single required DNS record for an email domain — used for display / copy-paste.
|
|
171
|
+
*/
|
|
172
|
+
export interface IEmailDnsRecord {
|
|
173
|
+
type: 'MX' | 'TXT' | 'A' | 'AAAA';
|
|
174
|
+
name: string;
|
|
175
|
+
value: string;
|
|
176
|
+
status: TDnsRecordStatus;
|
|
177
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { IUnifiedEmailServerOptions } from '@push.rocks/smartmta';
|
|
2
|
+
/** Outbound SMTP egress mode. 'remoteIngress' (default): deliver via RemoteIngress edges only,
|
|
3
|
+
* no direct-from-hub fallback. 'direct' is an explicit operator opt-out. */
|
|
4
|
+
export type TEmailOutboundMode = 'direct' | 'remoteIngress';
|
|
5
|
+
/** Readiness of the RemoteIngress outbound egress path — surfaced when outboundMode is 'remoteIngress'. */
|
|
6
|
+
export interface IEmailOutboundEgressStatus {
|
|
7
|
+
ready: boolean;
|
|
8
|
+
eligibleEdgeCount: number;
|
|
9
|
+
/** Populated when not ready, e.g. 'no connected mail edge with native QUIC egress'. */
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Lifecycle state of the smartmta Rust mailer bridge. 'failed' and 'restarting' mean mail processing is degraded. */
|
|
13
|
+
export type TEmailBridgeState = 'idle' | 'starting' | 'running' | 'restarting' | 'failed' | 'stopped';
|
|
14
|
+
export interface IEmailPortConfig {
|
|
15
|
+
/** External to internal SMTP port mapping. */
|
|
16
|
+
portMapping?: Record<number, number>;
|
|
17
|
+
/** Custom route settings for specific external ports. */
|
|
18
|
+
portSettings?: Record<number, {
|
|
19
|
+
terminateTls?: boolean;
|
|
20
|
+
routeName?: string;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
/** Path to store received emails, when configured by the runtime. */
|
|
24
|
+
receivedEmailsPath?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IEmailServerSettings {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
hostname: string | null;
|
|
29
|
+
outboundMode: TEmailOutboundMode;
|
|
30
|
+
ports: number[];
|
|
31
|
+
portMapping: Record<number, number> | null;
|
|
32
|
+
receivedEmailsPath: string | null;
|
|
33
|
+
maxMessageSize: number | null;
|
|
34
|
+
domainCount: number;
|
|
35
|
+
routeCount: number;
|
|
36
|
+
authUserCount: number;
|
|
37
|
+
/** Operator-managed SMTP submission accounts (hashed credentials, DB-backed). */
|
|
38
|
+
smtpAccountCount?: number;
|
|
39
|
+
/** Present when the email server is running: whether the SMTP listener is accepting connections. */
|
|
40
|
+
smtpListenerActive?: boolean;
|
|
41
|
+
/** Present when outboundMode is 'remoteIngress': whether a mail egress edge is currently available. */
|
|
42
|
+
outboundEgress?: IEmailOutboundEgressStatus;
|
|
43
|
+
/** Present when the email server is running: current state of the Rust mailer bridge. */
|
|
44
|
+
mailerBridgeState?: TEmailBridgeState;
|
|
45
|
+
updatedAt: number;
|
|
46
|
+
updatedBy: string;
|
|
47
|
+
}
|
|
48
|
+
export interface IEmailServerSettingsSeed {
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
outboundMode?: TEmailOutboundMode;
|
|
51
|
+
emailConfig?: IUnifiedEmailServerOptions;
|
|
52
|
+
emailPortConfig?: IEmailPortConfig;
|
|
53
|
+
}
|
|
54
|
+
export type TEmailServerSettingsUpdate = {
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
hostname?: string | null;
|
|
57
|
+
outboundMode?: TEmailOutboundMode;
|
|
58
|
+
ports?: number[];
|
|
59
|
+
portMapping?: Record<number, number> | null;
|
|
60
|
+
receivedEmailsPath?: string | null;
|
|
61
|
+
maxMessageSize?: number | null;
|
|
62
|
+
/**
|
|
63
|
+
* Exact names of persisted legacy routes to remove (the internal-relay
|
|
64
|
+
* retirement lever). Fails loudly on unknown names and refuses generated
|
|
65
|
+
* managed routes ('workapp-mail-*', 'smtp-account-*').
|
|
66
|
+
*/
|
|
67
|
+
removeRouteNames?: string[];
|
|
68
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './auth.js';
|
|
2
|
+
export * from './stats.js';
|
|
3
|
+
export * from './remoteingress.js';
|
|
4
|
+
export * from './route-management.js';
|
|
5
|
+
export * from './target-profile.js';
|
|
6
|
+
export * from './vpn.js';
|
|
7
|
+
export * from './dns-provider.js';
|
|
8
|
+
export * from './domain.js';
|
|
9
|
+
export * from './dns-authority.js';
|
|
10
|
+
export * from './workhoster.js';
|
|
11
|
+
export * from './dns-record.js';
|
|
12
|
+
export * from './acme-config.js';
|
|
13
|
+
export * from './email-domain.js';
|
|
14
|
+
export * from './email-settings.js';
|
|
15
|
+
export * from './smtp-account.js';
|
|
16
|
+
export * from './security-policy.js';
|
|
17
|
+
export * from './config-events.js';
|
|
18
|
+
export * from './testing.js';
|