@serve.zone/dcrouter 11.13.0 → 11.14.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.
Files changed (201) hide show
  1. package/dist_serve/bundle.js +2 -2
  2. package/package.json +1 -1
  3. package/readme.md +107 -3
  4. package/ts/00_commitinfo_data.ts +1 -1
  5. package/ts_web/00_commitinfo_data.ts +1 -1
  6. package/ts_web/readme.md +17 -0
  7. package/ts_web/router.ts +1 -1
  8. package/dist_ts/00_commitinfo_data.d.ts +0 -8
  9. package/dist_ts/00_commitinfo_data.js +0 -9
  10. package/dist_ts/cache/classes.cache.cleaner.d.ts +0 -47
  11. package/dist_ts/cache/classes.cache.cleaner.js +0 -130
  12. package/dist_ts/cache/classes.cached.document.d.ts +0 -76
  13. package/dist_ts/cache/classes.cached.document.js +0 -100
  14. package/dist_ts/cache/classes.cachedb.d.ts +0 -60
  15. package/dist_ts/cache/classes.cachedb.js +0 -126
  16. package/dist_ts/cache/documents/classes.cached.email.d.ts +0 -125
  17. package/dist_ts/cache/documents/classes.cached.email.js +0 -337
  18. package/dist_ts/cache/documents/classes.cached.ip.reputation.d.ts +0 -119
  19. package/dist_ts/cache/documents/classes.cached.ip.reputation.js +0 -323
  20. package/dist_ts/cache/documents/index.d.ts +0 -2
  21. package/dist_ts/cache/documents/index.js +0 -3
  22. package/dist_ts/cache/index.d.ts +0 -4
  23. package/dist_ts/cache/index.js +0 -7
  24. package/dist_ts/classes.cert-provision-scheduler.d.ts +0 -54
  25. package/dist_ts/classes.cert-provision-scheduler.js +0 -118
  26. package/dist_ts/classes.dcrouter.d.ts +0 -386
  27. package/dist_ts/classes.dcrouter.js +0 -1682
  28. package/dist_ts/classes.storage-cert-manager.d.ts +0 -18
  29. package/dist_ts/classes.storage-cert-manager.js +0 -43
  30. package/dist_ts/config/classes.api-token-manager.d.ts +0 -46
  31. package/dist_ts/config/classes.api-token-manager.js +0 -150
  32. package/dist_ts/config/classes.route-config-manager.d.ts +0 -38
  33. package/dist_ts/config/classes.route-config-manager.js +0 -256
  34. package/dist_ts/config/index.d.ts +0 -3
  35. package/dist_ts/config/index.js +0 -5
  36. package/dist_ts/config/validator.d.ts +0 -104
  37. package/dist_ts/config/validator.js +0 -152
  38. package/dist_ts/errors/base.errors.d.ts +0 -224
  39. package/dist_ts/errors/base.errors.js +0 -320
  40. package/dist_ts/errors/error-handler.d.ts +0 -98
  41. package/dist_ts/errors/error-handler.js +0 -282
  42. package/dist_ts/errors/error.codes.d.ts +0 -115
  43. package/dist_ts/errors/error.codes.js +0 -136
  44. package/dist_ts/errors/index.d.ts +0 -54
  45. package/dist_ts/errors/index.js +0 -136
  46. package/dist_ts/errors/reputation.errors.d.ts +0 -183
  47. package/dist_ts/errors/reputation.errors.js +0 -292
  48. package/dist_ts/http3/http3-route-augmentation.d.ts +0 -50
  49. package/dist_ts/http3/http3-route-augmentation.js +0 -98
  50. package/dist_ts/http3/index.d.ts +0 -1
  51. package/dist_ts/http3/index.js +0 -2
  52. package/dist_ts/index.d.ts +0 -8
  53. package/dist_ts/index.js +0 -29
  54. package/dist_ts/logger.d.ts +0 -21
  55. package/dist_ts/logger.js +0 -81
  56. package/dist_ts/monitoring/classes.metricscache.d.ts +0 -32
  57. package/dist_ts/monitoring/classes.metricscache.js +0 -63
  58. package/dist_ts/monitoring/classes.metricsmanager.d.ts +0 -184
  59. package/dist_ts/monitoring/classes.metricsmanager.js +0 -744
  60. package/dist_ts/monitoring/index.d.ts +0 -1
  61. package/dist_ts/monitoring/index.js +0 -2
  62. package/dist_ts/opsserver/classes.opsserver.d.ts +0 -38
  63. package/dist_ts/opsserver/classes.opsserver.js +0 -87
  64. package/dist_ts/opsserver/handlers/admin.handler.d.ts +0 -31
  65. package/dist_ts/opsserver/handlers/admin.handler.js +0 -180
  66. package/dist_ts/opsserver/handlers/api-token.handler.d.ts +0 -6
  67. package/dist_ts/opsserver/handlers/api-token.handler.js +0 -62
  68. package/dist_ts/opsserver/handlers/certificate.handler.d.ts +0 -32
  69. package/dist_ts/opsserver/handlers/certificate.handler.js +0 -421
  70. package/dist_ts/opsserver/handlers/config.handler.d.ts +0 -7
  71. package/dist_ts/opsserver/handlers/config.handler.js +0 -192
  72. package/dist_ts/opsserver/handlers/email-ops.handler.d.ts +0 -30
  73. package/dist_ts/opsserver/handlers/email-ops.handler.js +0 -227
  74. package/dist_ts/opsserver/handlers/index.d.ts +0 -12
  75. package/dist_ts/opsserver/handlers/index.js +0 -13
  76. package/dist_ts/opsserver/handlers/logs.handler.d.ts +0 -25
  77. package/dist_ts/opsserver/handlers/logs.handler.js +0 -256
  78. package/dist_ts/opsserver/handlers/radius.handler.d.ts +0 -6
  79. package/dist_ts/opsserver/handlers/radius.handler.js +0 -295
  80. package/dist_ts/opsserver/handlers/remoteingress.handler.d.ts +0 -6
  81. package/dist_ts/opsserver/handlers/remoteingress.handler.js +0 -156
  82. package/dist_ts/opsserver/handlers/route-management.handler.d.ts +0 -14
  83. package/dist_ts/opsserver/handlers/route-management.handler.js +0 -117
  84. package/dist_ts/opsserver/handlers/security.handler.d.ts +0 -9
  85. package/dist_ts/opsserver/handlers/security.handler.js +0 -233
  86. package/dist_ts/opsserver/handlers/stats.handler.d.ts +0 -11
  87. package/dist_ts/opsserver/handlers/stats.handler.js +0 -403
  88. package/dist_ts/opsserver/handlers/vpn.handler.d.ts +0 -6
  89. package/dist_ts/opsserver/handlers/vpn.handler.js +0 -199
  90. package/dist_ts/opsserver/helpers/guards.d.ts +0 -27
  91. package/dist_ts/opsserver/helpers/guards.js +0 -43
  92. package/dist_ts/opsserver/index.d.ts +0 -1
  93. package/dist_ts/opsserver/index.js +0 -2
  94. package/dist_ts/paths.d.ts +0 -26
  95. package/dist_ts/paths.js +0 -45
  96. package/dist_ts/plugins.d.ts +0 -81
  97. package/dist_ts/plugins.js +0 -115
  98. package/dist_ts/radius/classes.accounting.manager.d.ts +0 -231
  99. package/dist_ts/radius/classes.accounting.manager.js +0 -462
  100. package/dist_ts/radius/classes.radius.server.d.ts +0 -171
  101. package/dist_ts/radius/classes.radius.server.js +0 -386
  102. package/dist_ts/radius/classes.vlan.manager.d.ts +0 -128
  103. package/dist_ts/radius/classes.vlan.manager.js +0 -279
  104. package/dist_ts/radius/index.d.ts +0 -13
  105. package/dist_ts/radius/index.js +0 -14
  106. package/dist_ts/remoteingress/classes.remoteingress-manager.d.ts +0 -94
  107. package/dist_ts/remoteingress/classes.remoteingress-manager.js +0 -271
  108. package/dist_ts/remoteingress/classes.tunnel-manager.d.ts +0 -59
  109. package/dist_ts/remoteingress/classes.tunnel-manager.js +0 -165
  110. package/dist_ts/remoteingress/index.d.ts +0 -2
  111. package/dist_ts/remoteingress/index.js +0 -3
  112. package/dist_ts/security/classes.contentscanner.d.ts +0 -164
  113. package/dist_ts/security/classes.contentscanner.js +0 -642
  114. package/dist_ts/security/classes.ipreputationchecker.d.ts +0 -160
  115. package/dist_ts/security/classes.ipreputationchecker.js +0 -537
  116. package/dist_ts/security/classes.securitylogger.d.ts +0 -144
  117. package/dist_ts/security/classes.securitylogger.js +0 -235
  118. package/dist_ts/security/index.d.ts +0 -3
  119. package/dist_ts/security/index.js +0 -4
  120. package/dist_ts/sms/classes.smsservice.d.ts +0 -15
  121. package/dist_ts/sms/classes.smsservice.js +0 -72
  122. package/dist_ts/sms/config/sms.config.d.ts +0 -93
  123. package/dist_ts/sms/config/sms.config.js +0 -2
  124. package/dist_ts/sms/config/sms.schema.d.ts +0 -5
  125. package/dist_ts/sms/config/sms.schema.js +0 -121
  126. package/dist_ts/sms/index.d.ts +0 -1
  127. package/dist_ts/sms/index.js +0 -2
  128. package/dist_ts/storage/classes.storagemanager.d.ts +0 -83
  129. package/dist_ts/storage/classes.storagemanager.js +0 -348
  130. package/dist_ts/storage/index.d.ts +0 -1
  131. package/dist_ts/storage/index.js +0 -3
  132. package/dist_ts/vpn/classes.vpn-manager.d.ts +0 -113
  133. package/dist_ts/vpn/classes.vpn-manager.js +0 -297
  134. package/dist_ts/vpn/index.d.ts +0 -1
  135. package/dist_ts/vpn/index.js +0 -2
  136. package/dist_ts_apiclient/classes.apitoken.d.ts +0 -41
  137. package/dist_ts_apiclient/classes.apitoken.js +0 -115
  138. package/dist_ts_apiclient/classes.certificate.d.ts +0 -57
  139. package/dist_ts_apiclient/classes.certificate.js +0 -69
  140. package/dist_ts_apiclient/classes.config.d.ts +0 -7
  141. package/dist_ts_apiclient/classes.config.js +0 -11
  142. package/dist_ts_apiclient/classes.dcrouterapiclient.d.ts +0 -41
  143. package/dist_ts_apiclient/classes.dcrouterapiclient.js +0 -81
  144. package/dist_ts_apiclient/classes.email.d.ts +0 -30
  145. package/dist_ts_apiclient/classes.email.js +0 -52
  146. package/dist_ts_apiclient/classes.logs.d.ts +0 -21
  147. package/dist_ts_apiclient/classes.logs.js +0 -14
  148. package/dist_ts_apiclient/classes.radius.d.ts +0 -59
  149. package/dist_ts_apiclient/classes.radius.js +0 -95
  150. package/dist_ts_apiclient/classes.remoteingress.d.ts +0 -54
  151. package/dist_ts_apiclient/classes.remoteingress.js +0 -136
  152. package/dist_ts_apiclient/classes.route.d.ts +0 -42
  153. package/dist_ts_apiclient/classes.route.js +0 -154
  154. package/dist_ts_apiclient/classes.stats.d.ts +0 -47
  155. package/dist_ts_apiclient/classes.stats.js +0 -38
  156. package/dist_ts_apiclient/index.d.ts +0 -10
  157. package/dist_ts_apiclient/index.js +0 -14
  158. package/dist_ts_apiclient/plugins.d.ts +0 -3
  159. package/dist_ts_apiclient/plugins.js +0 -5
  160. package/dist_ts_web/00_commitinfo_data.d.ts +0 -8
  161. package/dist_ts_web/00_commitinfo_data.js +0 -9
  162. package/dist_ts_web/appstate.d.ts +0 -238
  163. package/dist_ts_web/appstate.js +0 -1174
  164. package/dist_ts_web/elements/index.d.ts +0 -13
  165. package/dist_ts_web/elements/index.js +0 -14
  166. package/dist_ts_web/elements/ops-dashboard.d.ts +0 -23
  167. package/dist_ts_web/elements/ops-dashboard.js +0 -323
  168. package/dist_ts_web/elements/ops-view-apitokens.d.ts +0 -13
  169. package/dist_ts_web/elements/ops-view-apitokens.js +0 -371
  170. package/dist_ts_web/elements/ops-view-certificates.d.ts +0 -22
  171. package/dist_ts_web/elements/ops-view-certificates.js +0 -528
  172. package/dist_ts_web/elements/ops-view-config.d.ts +0 -19
  173. package/dist_ts_web/elements/ops-view-config.js +0 -339
  174. package/dist_ts_web/elements/ops-view-emails.d.ts +0 -21
  175. package/dist_ts_web/elements/ops-view-emails.js +0 -165
  176. package/dist_ts_web/elements/ops-view-logs.d.ts +0 -13
  177. package/dist_ts_web/elements/ops-view-logs.js +0 -159
  178. package/dist_ts_web/elements/ops-view-network.d.ts +0 -71
  179. package/dist_ts_web/elements/ops-view-network.js +0 -764
  180. package/dist_ts_web/elements/ops-view-overview.d.ts +0 -22
  181. package/dist_ts_web/elements/ops-view-overview.js +0 -456
  182. package/dist_ts_web/elements/ops-view-remoteingress.d.ts +0 -20
  183. package/dist_ts_web/elements/ops-view-remoteingress.js +0 -494
  184. package/dist_ts_web/elements/ops-view-routes.d.ts +0 -12
  185. package/dist_ts_web/elements/ops-view-routes.js +0 -404
  186. package/dist_ts_web/elements/ops-view-security.d.ts +0 -21
  187. package/dist_ts_web/elements/ops-view-security.js +0 -574
  188. package/dist_ts_web/elements/ops-view-vpn.d.ts +0 -14
  189. package/dist_ts_web/elements/ops-view-vpn.js +0 -369
  190. package/dist_ts_web/elements/shared/css.d.ts +0 -1
  191. package/dist_ts_web/elements/shared/css.js +0 -10
  192. package/dist_ts_web/elements/shared/index.d.ts +0 -2
  193. package/dist_ts_web/elements/shared/index.js +0 -3
  194. package/dist_ts_web/elements/shared/ops-sectionheading.d.ts +0 -5
  195. package/dist_ts_web/elements/shared/ops-sectionheading.js +0 -82
  196. package/dist_ts_web/index.d.ts +0 -1
  197. package/dist_ts_web/index.js +0 -10
  198. package/dist_ts_web/plugins.d.ts +0 -6
  199. package/dist_ts_web/plugins.js +0 -11
  200. package/dist_ts_web/router.d.ts +0 -19
  201. package/dist_ts_web/router.js +0 -91
@@ -1,386 +0,0 @@
1
- import * as plugins from './plugins.js';
2
- import * as paths from './paths.js';
3
- import { UnifiedEmailServer, type IUnifiedEmailServerOptions, type IEmailRoute } from '@push.rocks/smartmta';
4
- import { StorageManager, type IStorageConfig } from './storage/index.js';
5
- import { CertProvisionScheduler } from './classes.cert-provision-scheduler.js';
6
- import { CacheDb, CacheCleaner } from './cache/index.js';
7
- import { OpsServer } from './opsserver/index.js';
8
- import { MetricsManager } from './monitoring/index.js';
9
- import { RadiusServer, type IRadiusServerConfig } from './radius/index.js';
10
- import { RemoteIngressManager, TunnelManager } from './remoteingress/index.js';
11
- import { VpnManager } from './vpn/index.js';
12
- import { RouteConfigManager, ApiTokenManager } from './config/index.js';
13
- import { type IHttp3Config } from './http3/index.js';
14
- export interface IDcRouterOptions {
15
- /** Base directory for all dcrouter data. Defaults to ~/.serve.zone/dcrouter */
16
- baseDir?: string;
17
- /**
18
- * Direct SmartProxy configuration - gives full control over HTTP/HTTPS and TCP/SNI traffic
19
- * This is the preferred way to configure HTTP/HTTPS and general TCP/SNI traffic
20
- */
21
- smartProxyConfig?: plugins.smartproxy.ISmartProxyOptions;
22
- /**
23
- * Email server configuration
24
- * This enables all email handling with pattern-based routing
25
- */
26
- emailConfig?: IUnifiedEmailServerOptions;
27
- /**
28
- * Custom email port configuration
29
- * Allows configuring specific ports for email handling
30
- * This overrides the default port mapping in the emailConfig
31
- */
32
- emailPortConfig?: {
33
- /** External to internal port mapping */
34
- portMapping?: Record<number, number>;
35
- /** Custom port configuration for specific ports */
36
- portSettings?: Record<number, any>;
37
- /** Path to store received emails */
38
- receivedEmailsPath?: string;
39
- };
40
- /** TLS/certificate configuration */
41
- tls?: {
42
- /** Contact email for ACME certificates */
43
- contactEmail: string;
44
- /** Domain for main certificate */
45
- domain?: string;
46
- /** Path to certificate file (if not using auto-provisioning) */
47
- certPath?: string;
48
- /** Path to key file (if not using auto-provisioning) */
49
- keyPath?: string;
50
- /** Path to CA certificate file (for custom CAs) */
51
- caPath?: string;
52
- };
53
- /**
54
- * The nameserver domains (e.g., ['ns1.example.com', 'ns2.example.com'])
55
- * These will automatically get A records pointing to publicIp or proxyIps[0]
56
- * These are what go in the NS records for ALL domains in dnsScopes
57
- */
58
- dnsNsDomains?: string[];
59
- /**
60
- * Domains this DNS server is authoritative for (e.g., ['example.com', 'mail.example.org'])
61
- * NS records will be auto-generated for these domains
62
- * Any DNS record outside these scopes will trigger a warning
63
- * Email domains with `internal-dns` mode must be included here
64
- */
65
- dnsScopes?: string[];
66
- /**
67
- * IPs of proxies that forward traffic to your server (optional)
68
- * When defined AND useIngressProxy is true, A records with server IP are replaced with proxy IPs
69
- * If not defined or empty, all A records use the real server IP
70
- * Helps hide real server IP for security/privacy
71
- */
72
- proxyIps?: string[];
73
- /**
74
- * Public IP address for nameserver A records (required if proxyIps not set)
75
- * This is the IP that will be used for the nameserver domains (dnsNsDomains)
76
- * If proxyIps is set, the first proxy IP will be used instead
77
- */
78
- publicIp?: string;
79
- /**
80
- * DNS records to register
81
- * Must be within the defined dnsScopes (or receive warning)
82
- * Only need A, CNAME, TXT, MX records (NS records auto-generated, SOA handled by smartdns)
83
- * Can use `useIngressProxy: false` to expose real server IP (defaults to true)
84
- */
85
- dnsRecords?: Array<{
86
- name: string;
87
- type: 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA';
88
- value: string;
89
- ttl?: number;
90
- useIngressProxy?: boolean;
91
- }>;
92
- /** DNS challenge configuration for ACME (optional) */
93
- dnsChallenge?: {
94
- /** Cloudflare API key for DNS challenges */
95
- cloudflareApiKey?: string;
96
- };
97
- /** Storage configuration */
98
- storage?: IStorageConfig;
99
- /**
100
- * Cache database configuration using smartdata and LocalTsmDb
101
- * Provides persistent caching for emails, IP reputation, bounces, etc.
102
- */
103
- cacheConfig?: {
104
- /** Enable cache database (default: true) */
105
- enabled?: boolean;
106
- /** Storage path for TsmDB data (default: ~/.serve.zone/dcrouter/tsmdb) */
107
- storagePath?: string;
108
- /** Database name (default: dcrouter) */
109
- dbName?: string;
110
- /** Default TTL in days for cached items (default: 30) */
111
- defaultTTLDays?: number;
112
- /** Cleanup interval in hours (default: 1) */
113
- cleanupIntervalHours?: number;
114
- /** TTL configuration per data type (in days) */
115
- ttlConfig?: {
116
- /** Email cache TTL (default: 30 days) */
117
- emails?: number;
118
- /** IP reputation cache TTL (default: 1 day) */
119
- ipReputation?: number;
120
- /** Bounce records TTL (default: 30 days) */
121
- bounces?: number;
122
- /** DKIM keys TTL (default: 90 days) */
123
- dkimKeys?: number;
124
- /** Suppression list TTL (default: 30 days, can be permanent) */
125
- suppression?: number;
126
- };
127
- };
128
- /**
129
- * RADIUS server configuration for network authentication
130
- * Enables MAC Authentication Bypass (MAB) and VLAN assignment
131
- */
132
- radiusConfig?: IRadiusServerConfig;
133
- /**
134
- * Remote Ingress configuration for edge tunnel nodes
135
- * Enables edge nodes to accept incoming connections and tunnel them to this DcRouter
136
- */
137
- /**
138
- * HTTP/3 (QUIC) configuration for HTTPS routes.
139
- * Enabled by default — qualifying HTTPS routes on port 443 are automatically
140
- * augmented with QUIC/H3 fields. Set { enabled: false } to disable globally.
141
- * Individual routes can opt out via action.options.http3 = false.
142
- */
143
- http3?: IHttp3Config;
144
- /** Port for the OpsServer web UI (default: 3000) */
145
- opsServerPort?: number;
146
- remoteIngressConfig?: {
147
- /** Enable remote ingress hub (default: false) */
148
- enabled?: boolean;
149
- /** Port for tunnel connections from edge nodes (default: 8443) */
150
- tunnelPort?: number;
151
- /** External hostname of this hub, embedded in connection tokens */
152
- hubDomain?: string;
153
- /** TLS configuration for the tunnel server */
154
- tls?: {
155
- certPath?: string;
156
- keyPath?: string;
157
- };
158
- };
159
- /**
160
- * VPN server configuration.
161
- * Enables VPN-based access control: routes with vpn.required are only
162
- * accessible from VPN clients. Supports WireGuard + native (WS/QUIC) transports.
163
- */
164
- vpnConfig?: {
165
- /** Enable VPN server (default: false) */
166
- enabled?: boolean;
167
- /** VPN subnet CIDR (default: '10.8.0.0/24') */
168
- subnet?: string;
169
- /** WireGuard UDP listen port (default: 51820) */
170
- wgListenPort?: number;
171
- /** DNS servers pushed to VPN clients */
172
- dns?: string[];
173
- /** Server endpoint hostname for client configs (e.g. 'vpn.example.com') */
174
- serverEndpoint?: string;
175
- /** Override forwarding mode. Default: auto-detect (tun if root, socket otherwise) */
176
- forwardingMode?: 'tun' | 'socket';
177
- };
178
- }
179
- /**
180
- * DcRouter can be run on ingress and egress to and from a datacenter site.
181
- */
182
- /**
183
- * Context passed to HTTP routing rules
184
- */
185
- /**
186
- * Context passed to port proxy (SmartProxy) routing rules
187
- */
188
- export interface PortProxyRuleContext {
189
- proxy: plugins.smartproxy.SmartProxy;
190
- routes: plugins.smartproxy.IRouteConfig[];
191
- }
192
- export declare class DcRouter {
193
- options: IDcRouterOptions;
194
- resolvedPaths: ReturnType<typeof paths.resolvePaths>;
195
- smartProxy?: plugins.smartproxy.SmartProxy;
196
- smartAcme?: plugins.smartacme.SmartAcme;
197
- dnsServer?: plugins.smartdns.dnsServerMod.DnsServer;
198
- emailServer?: UnifiedEmailServer;
199
- radiusServer?: RadiusServer;
200
- storageManager: StorageManager;
201
- opsServer: OpsServer;
202
- metricsManager?: MetricsManager;
203
- cacheDb?: CacheDb;
204
- cacheCleaner?: CacheCleaner;
205
- remoteIngressManager?: RemoteIngressManager;
206
- tunnelManager?: TunnelManager;
207
- vpnManager?: VpnManager;
208
- routeConfigManager?: RouteConfigManager;
209
- apiTokenManager?: ApiTokenManager;
210
- detectedPublicIp: string | null;
211
- private dnsLogWindowSecond;
212
- private dnsLogWindowCount;
213
- private dnsBatchCount;
214
- private dnsBatchTimer;
215
- certificateStatusMap: Map<string, {
216
- status: "valid" | "failed";
217
- routeNames: string[];
218
- expiryDate?: string;
219
- issuedAt?: string;
220
- source?: string;
221
- error?: string;
222
- }>;
223
- certProvisionScheduler?: CertProvisionScheduler;
224
- serviceManager: plugins.taskbuffer.ServiceManager;
225
- private serviceSubjectSubscription?;
226
- smartAcmeReady: boolean;
227
- typedrouter: plugins.typedrequest.TypedRouter<import("@api.global/typedrequest-interfaces").ITypedRequest>;
228
- private constructorRoutes;
229
- private qenv;
230
- constructor(optionsArg: IDcRouterOptions);
231
- /**
232
- * Register all dcrouter services with the ServiceManager.
233
- * Services are started in dependency order, with failure isolation for optional services.
234
- */
235
- private registerServices;
236
- start(): Promise<void>;
237
- /**
238
- * Detect OS-level resource limits and warn if they are too low for production use.
239
- * This is detection only — no attempts to raise limits.
240
- */
241
- private checkSystemLimits;
242
- /**
243
- * Log comprehensive startup summary
244
- */
245
- private logStartupSummary;
246
- /**
247
- * Set up the cache database (smartdata + LocalTsmDb)
248
- */
249
- private setupCacheDb;
250
- /**
251
- * Set up SmartProxy with direct configuration and automatic email routes
252
- */
253
- private setupSmartProxy;
254
- /**
255
- * Generate SmartProxy routes for email configuration
256
- */
257
- private generateEmailRoutes;
258
- /**
259
- * Generate SmartProxy routes for DNS configuration
260
- */
261
- private generateDnsRoutes;
262
- /**
263
- * Check if a domain matches a pattern (including wildcard support)
264
- * @param domain The domain to check
265
- * @param pattern The pattern to match against (e.g., "*.example.com")
266
- * @returns Whether the domain matches the pattern
267
- */
268
- private isDomainMatch;
269
- /**
270
- * Find ALL route names that match a given domain
271
- */
272
- findRouteNamesForDomain(domain: string): string[];
273
- /**
274
- * Get the routes derived from constructor config (smartProxy + email + DNS).
275
- * Used by RouteConfigManager as the "hardcoded" base.
276
- */
277
- getConstructorRoutes(): plugins.smartproxy.IRouteConfig[];
278
- stop(): Promise<void>;
279
- /**
280
- * Update SmartProxy configuration
281
- * @param config New SmartProxy configuration
282
- */
283
- updateSmartProxyConfig(config: plugins.smartproxy.ISmartProxyOptions): Promise<void>;
284
- /**
285
- * Set up unified email handling with pattern-based routing
286
- * This implements the consolidated emailConfig approach
287
- */
288
- private setupUnifiedEmailHandling;
289
- /**
290
- * Update the unified email configuration
291
- * @param config New email configuration
292
- */
293
- updateEmailConfig(config: IUnifiedEmailServerOptions): Promise<void>;
294
- /**
295
- * Stop all unified email components
296
- */
297
- private stopUnifiedEmailComponents;
298
- /**
299
- * Update domain rules for email routing
300
- * @param rules New domain rules to apply
301
- */
302
- updateEmailRoutes(routes: IEmailRoute[]): Promise<void>;
303
- /**
304
- * Get statistics from all components
305
- */
306
- getStats(): any;
307
- /**
308
- * Register DNS records with the DNS server
309
- * @param records Array of DNS records to register
310
- */
311
- private registerDnsRecords;
312
- /**
313
- * Parse DNS record data based on record type
314
- * @param type DNS record type
315
- * @param value DNS record value
316
- * @returns Parsed data for the DNS response
317
- */
318
- private parseDnsRecordData;
319
- /**
320
- * Set up DNS server with socket handler for DoH
321
- */
322
- private setupDnsWithSocketHandler;
323
- /**
324
- * Create DNS socket handler for DoH
325
- */
326
- private createDnsSocketHandler;
327
- /**
328
- * Validate DNS configuration
329
- */
330
- private validateDnsConfiguration;
331
- /**
332
- * Generate email DNS records for domains with internal-dns mode
333
- */
334
- private generateEmailDnsRecords;
335
- /**
336
- * Load DKIM records from JSON files
337
- * Reads all *.dkimrecord.json files from the DNS records directory
338
- */
339
- private loadDkimRecords;
340
- /**
341
- * Initialize DKIM keys for all configured email domains
342
- * This ensures DKIM records are available immediately at startup
343
- */
344
- private initializeDkimForEmailDomains;
345
- /**
346
- * Generate authoritative DNS records (NS only) for all domains in dnsScopes
347
- * SOA records are now automatically generated by smartdns with primaryNameserver setting
348
- */
349
- private generateAuthoritativeRecords;
350
- /**
351
- * Extract the base domain from a DNS record name
352
- */
353
- private extractDomain;
354
- /**
355
- * Apply proxy IP replacement logic to DNS records
356
- */
357
- private applyProxyIpReplacement;
358
- /**
359
- * Detect the server's public IP address
360
- */
361
- private detectServerPublicIp;
362
- /**
363
- * Set up Remote Ingress hub for edge tunnel connections
364
- */
365
- private setupRemoteIngress;
366
- /**
367
- * Set up VPN server for VPN-based route access control.
368
- */
369
- private setupVpnServer;
370
- /**
371
- * Inject VPN security into routes that have vpn.required === true.
372
- * Adds the VPN subnet to security.ipAllowList so only VPN clients can access them.
373
- */
374
- private injectVpnSecurity;
375
- /**
376
- * Set up RADIUS server for network authentication
377
- */
378
- private setupRadiusServer;
379
- /**
380
- * Update RADIUS configuration at runtime
381
- */
382
- updateRadiusConfig(config: IRadiusServerConfig): Promise<void>;
383
- }
384
- export type { IUnifiedEmailServerOptions };
385
- export type { IRadiusServerConfig };
386
- export default DcRouter;