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