@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.
- package/deno.json +1 -1
- package/dist_serve/bundle.js +559 -559
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.dcrouter.js +9 -3
- package/dist_ts/db/documents/classes.ip-intelligence.doc.d.ts +10 -0
- package/dist_ts/db/documents/classes.ip-intelligence.doc.js +63 -1
- package/dist_ts/dns/classes.dns-server-runtime.d.ts +1 -0
- package/dist_ts/dns/classes.dns-server-runtime.js +8 -4
- package/dist_ts/dns/manager.dns.js +23 -6
- package/dist_ts/email/classes.email-domain.manager.js +27 -15
- package/dist_ts/email/classes.mail-dns-sync.d.ts +19 -2
- package/dist_ts/email/classes.mail-dns-sync.js +158 -32
- package/dist_ts/email/index.d.ts +1 -0
- package/dist_ts/email/index.js +2 -1
- package/dist_ts/email/mail-dns-status.d.ts +5 -0
- package/dist_ts/email/mail-dns-status.js +31 -0
- package/dist_ts/monitoring/classes.metricscache.d.ts +2 -0
- package/dist_ts/monitoring/classes.metricscache.js +28 -6
- package/dist_ts/monitoring/classes.metricsmanager.d.ts +10 -0
- package/dist_ts/monitoring/classes.metricsmanager.js +99 -31
- package/dist_ts/opsserver/handlers/security.handler.js +24 -6
- package/dist_ts/opsserver/handlers/stats.handler.js +2 -3
- package/dist_ts/remoteingress/classes.hub-lifecycle.js +2 -2
- package/dist_ts/security/classes.security-policy-manager.d.ts +17 -0
- package/dist_ts/security/classes.security-policy-manager.js +171 -26
- package/dist_ts_interfaces/requests/stats.d.ts +7 -0
- package/dist_ts_migrations/index.js +395 -9
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/appstate/network.js +11 -2
- package/dist_ts_web/appstate/ui.js +1 -8
- package/package.json +3 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.dcrouter.ts +11 -2
- package/ts/db/documents/classes.ip-intelligence.doc.ts +75 -0
- package/ts/dns/classes.dns-server-runtime.ts +9 -3
- package/ts/dns/manager.dns.ts +22 -5
- package/ts/email/classes.email-domain.manager.ts +23 -16
- package/ts/email/classes.mail-dns-sync.ts +172 -38
- package/ts/email/index.ts +1 -0
- package/ts/email/mail-dns-status.ts +35 -0
- package/ts/monitoring/classes.metricscache.ts +36 -8
- package/ts/monitoring/classes.metricsmanager.ts +113 -32
- package/ts/opsserver/handlers/security.handler.ts +35 -6
- package/ts/opsserver/handlers/stats.handler.ts +1 -2
- package/ts/remoteingress/classes.hub-lifecycle.ts +3 -1
- package/ts/security/classes.security-policy-manager.ts +193 -26
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/appstate/network.ts +12 -1
- 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))]
|
|
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
|
package/ts_web/appstate/ui.ts
CHANGED
|
@@ -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
|
-
|