@serve.zone/dcrouter 17.1.4 → 17.1.6

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 (49) hide show
  1. package/deno.json +1 -1
  2. package/dist_serve/bundle.js +559 -559
  3. package/dist_ts/00_commitinfo_data.js +1 -1
  4. package/dist_ts/classes.dcrouter.js +9 -3
  5. package/dist_ts/db/documents/classes.ip-intelligence.doc.d.ts +10 -0
  6. package/dist_ts/db/documents/classes.ip-intelligence.doc.js +63 -1
  7. package/dist_ts/dns/classes.dns-server-runtime.d.ts +1 -0
  8. package/dist_ts/dns/classes.dns-server-runtime.js +8 -4
  9. package/dist_ts/dns/manager.dns.js +23 -6
  10. package/dist_ts/email/classes.email-domain.manager.js +27 -15
  11. package/dist_ts/email/classes.mail-dns-sync.d.ts +19 -2
  12. package/dist_ts/email/classes.mail-dns-sync.js +158 -32
  13. package/dist_ts/email/index.d.ts +1 -0
  14. package/dist_ts/email/index.js +2 -1
  15. package/dist_ts/email/mail-dns-status.d.ts +5 -0
  16. package/dist_ts/email/mail-dns-status.js +31 -0
  17. package/dist_ts/monitoring/classes.metricscache.d.ts +2 -0
  18. package/dist_ts/monitoring/classes.metricscache.js +28 -6
  19. package/dist_ts/monitoring/classes.metricsmanager.d.ts +10 -0
  20. package/dist_ts/monitoring/classes.metricsmanager.js +99 -31
  21. package/dist_ts/opsserver/handlers/security.handler.js +24 -6
  22. package/dist_ts/opsserver/handlers/stats.handler.js +2 -3
  23. package/dist_ts/remoteingress/classes.hub-lifecycle.js +2 -2
  24. package/dist_ts/security/classes.security-policy-manager.d.ts +17 -0
  25. package/dist_ts/security/classes.security-policy-manager.js +171 -26
  26. package/dist_ts_interfaces/requests/stats.d.ts +7 -0
  27. package/dist_ts_migrations/index.js +395 -9
  28. package/dist_ts_web/00_commitinfo_data.js +1 -1
  29. package/dist_ts_web/appstate/network.js +11 -2
  30. package/dist_ts_web/appstate/ui.js +1 -8
  31. package/package.json +3 -3
  32. package/ts/00_commitinfo_data.ts +1 -1
  33. package/ts/classes.dcrouter.ts +11 -2
  34. package/ts/db/documents/classes.ip-intelligence.doc.ts +75 -0
  35. package/ts/dns/classes.dns-server-runtime.ts +9 -3
  36. package/ts/dns/manager.dns.ts +22 -5
  37. package/ts/email/classes.email-domain.manager.ts +23 -16
  38. package/ts/email/classes.mail-dns-sync.ts +172 -38
  39. package/ts/email/index.ts +1 -0
  40. package/ts/email/mail-dns-status.ts +35 -0
  41. package/ts/monitoring/classes.metricscache.ts +36 -8
  42. package/ts/monitoring/classes.metricsmanager.ts +113 -32
  43. package/ts/opsserver/handlers/security.handler.ts +35 -6
  44. package/ts/opsserver/handlers/stats.handler.ts +1 -2
  45. package/ts/remoteingress/classes.hub-lifecycle.ts +3 -1
  46. package/ts/security/classes.security-policy-manager.ts +193 -26
  47. package/ts_web/00_commitinfo_data.ts +1 -1
  48. package/ts_web/appstate/network.ts +12 -1
  49. package/ts_web/appstate/ui.ts +0 -9
@@ -4,6 +4,9 @@ import { appState } from './shared.js';
4
4
  import { getActionContext } from './login.js';
5
5
  import { runBackgroundRefresh } from './shared.js';
6
6
 
7
+ const IP_INTELLIGENCE_REFRESH_INTERVAL_MS = 60_000;
8
+ let lastIpIntelligenceRefreshAt = 0;
9
+
7
10
  export interface INetworkState {
8
11
  connections: interfaces.data.IConnectionInfo[];
9
12
  connectionsByIP: { [ip: string]: number };
@@ -53,9 +56,17 @@ export const networkStatePart = await appState.getStatePart<INetworkState>(
53
56
  );
54
57
 
55
58
  export function refreshNetworkIpIntelligence(identity: interfaces.data.IIdentity, ipAddresses: string[]): void {
56
- const ips = [...new Set(ipAddresses.filter(Boolean))].slice(0, 100);
59
+ const ips = [...new Set(ipAddresses.map((ip) => ip.trim()).filter(Boolean))]
60
+ .sort()
61
+ .slice(0, 100);
57
62
  if (ips.length === 0) return;
58
63
 
64
+ const now = Date.now();
65
+ if (now - lastIpIntelligenceRefreshAt < IP_INTELLIGENCE_REFRESH_INTERVAL_MS) {
66
+ return;
67
+ }
68
+ lastIpIntelligenceRefreshAt = now;
69
+
59
70
  runBackgroundRefresh('networkIpIntelligence', 'IP intelligence refresh failed:', async () => {
60
71
  const intelligenceRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
61
72
  interfaces.requests.IReq_ListIpIntelligence
@@ -1,5 +1,4 @@
1
1
  import { appState } from './shared.js';
2
- import { networkStatePart, fetchNetworkStatsAction } from './network.js';
3
2
  import { certificateStatePart, fetchCertificateOverviewAction } from './certificates.js';
4
3
 
5
4
  export interface IUiState {
@@ -52,13 +51,6 @@ export const toggleAutoRefreshAction = uiStatePart.createAction(async (statePart
52
51
  export const setActiveViewAction = uiStatePart.createAction<string>(async (statePartArg, viewName): Promise<IUiState> => {
53
52
  const currentState = statePartArg.getState()!;
54
53
 
55
- // If switching to network view, ensure we fetch network data
56
- if (viewName === 'network' && currentState.activeView !== 'network') {
57
- setTimeout(() => {
58
- networkStatePart.dispatchAction(fetchNetworkStatsAction, null);
59
- }, 100);
60
- }
61
-
62
54
  // If switching to the Domains group, ensure we fetch certificate data
63
55
  // (Certificates is a subview of Domains).
64
56
  if (viewName === 'domains' && currentState.activeView !== 'domains') {
@@ -72,4 +64,3 @@ export const setActiveViewAction = uiStatePart.createAction<string>(async (state
72
64
  activeView: viewName,
73
65
  };
74
66
  });
75
-