@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,19 @@
|
|
|
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';
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL2RhdGEvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGNBQWMsQ0FBQyJ9
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { IRouteConfig } from '@push.rocks/smartproxy';
|
|
2
|
+
/** Edges tagged 'mail' bind SMTP ports and are eligible for outbound SMTP egress and mail DNS fronting. */
|
|
3
|
+
export declare const REMOTE_INGRESS_MAIL_TAG = "mail";
|
|
4
|
+
/** Edges tagged 'dns' forward public TCP/UDP 53 to the hub's authoritative DNS. */
|
|
5
|
+
export declare const REMOTE_INGRESS_DNS_TAG = "dns";
|
|
6
|
+
/** The edge accepts hub-initiated outbound TCP egress proxies. Absent it, egress is refused. */
|
|
7
|
+
export declare const REMOTE_INGRESS_EGRESS_TCP_CAPABILITY = "egressTcp";
|
|
8
|
+
/** The edge reports its bound egress source addresses, which the hub exposes as identity status. */
|
|
9
|
+
export declare const REMOTE_INGRESS_EGRESS_IDENTITY_CAPABILITY = "egressIdentity";
|
|
10
|
+
/**
|
|
11
|
+
* A stored remote ingress edge registration.
|
|
12
|
+
*/
|
|
13
|
+
export interface IRemoteIngress {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
secret: string;
|
|
17
|
+
listenPorts: number[];
|
|
18
|
+
/** UDP listen ports (e.g. for QUIC/HTTP3). Derived from routes with transport 'udp' or 'all'. */
|
|
19
|
+
listenPortsUdp?: number[];
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/** Whether to auto-derive ports from remoteIngress-tagged routes. Defaults to true. */
|
|
22
|
+
autoDerivePorts: boolean;
|
|
23
|
+
/** Optional per-edge performance overrides. */
|
|
24
|
+
performance?: IRemoteIngressPerformanceConfig;
|
|
25
|
+
/** Optional per-edge outbound egress policy. Omitted or disabled means no egress. */
|
|
26
|
+
egress?: IRemoteIngressEgressPolicyConfig;
|
|
27
|
+
tags?: string[];
|
|
28
|
+
/** Operator-declared public IPv4 of the edge host — used to generate mail/DNS A records. */
|
|
29
|
+
publicIp?: string;
|
|
30
|
+
/** Operator-declared public IPv6 of the edge host — used to generate AAAA records once the edge has an IPv6 PTR. */
|
|
31
|
+
publicIpV6?: string;
|
|
32
|
+
/** FQDN matching this edge's PTR record — used as per-delivery outbound EHLO identity and FCrDNS A record. */
|
|
33
|
+
mailHostname?: string;
|
|
34
|
+
createdAt: number;
|
|
35
|
+
updatedAt: number;
|
|
36
|
+
/** Effective ports (union of manual + derived) — only present in API responses. */
|
|
37
|
+
effectiveListenPorts?: number[];
|
|
38
|
+
/** Ports explicitly set by the user — only present in API responses. */
|
|
39
|
+
manualPorts?: number[];
|
|
40
|
+
/** Ports auto-derived from route configs — only present in API responses. */
|
|
41
|
+
derivedPorts?: number[];
|
|
42
|
+
/** Effective UDP ports (union of manual + derived) — only present in API responses. */
|
|
43
|
+
effectiveListenPortsUdp?: number[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Runtime status of a remote ingress edge.
|
|
47
|
+
*/
|
|
48
|
+
export interface IRemoteIngressStatus {
|
|
49
|
+
edgeId: string;
|
|
50
|
+
connected: boolean;
|
|
51
|
+
publicIp: string | null;
|
|
52
|
+
activeTunnels: number;
|
|
53
|
+
lastHeartbeat: number | null;
|
|
54
|
+
connectedAt: number | null;
|
|
55
|
+
transportMode?: 'tcpTls' | 'quic' | 'quicWithFallback';
|
|
56
|
+
fallbackUsed?: boolean;
|
|
57
|
+
capabilities?: string[];
|
|
58
|
+
egressEnabled?: boolean;
|
|
59
|
+
performance?: IRemoteIngressPerformanceEffective;
|
|
60
|
+
flowControl?: IRemoteIngressFlowControlStatus;
|
|
61
|
+
queues?: IRemoteIngressQueueStatus;
|
|
62
|
+
traffic?: IRemoteIngressTrafficStatus;
|
|
63
|
+
udp?: IRemoteIngressUdpStatus;
|
|
64
|
+
}
|
|
65
|
+
export type TRemoteIngressPerformanceProfile = 'balanced' | 'throughput' | 'highConcurrency';
|
|
66
|
+
export interface IRemoteIngressPerformanceConfig {
|
|
67
|
+
profile?: TRemoteIngressPerformanceProfile;
|
|
68
|
+
maxStreamsPerEdge?: number;
|
|
69
|
+
totalWindowBudgetBytes?: number;
|
|
70
|
+
minStreamWindowBytes?: number;
|
|
71
|
+
maxStreamWindowBytes?: number;
|
|
72
|
+
sustainedStreamWindowBytes?: number;
|
|
73
|
+
quicDatagramReceiveBufferBytes?: number;
|
|
74
|
+
streamFramePayloadBytes?: number;
|
|
75
|
+
firstDataConnectTimeoutMs?: number;
|
|
76
|
+
clientWriteTimeoutMs?: number;
|
|
77
|
+
/** Streams retained after the backend sent FIN while the client upload stays open; 0 disables backend-initiated retention. */
|
|
78
|
+
maxHalfClosedStreams?: number;
|
|
79
|
+
/** Hard deadline in milliseconds for directional half-close draining. */
|
|
80
|
+
halfCloseDrainTimeoutMs?: number;
|
|
81
|
+
serverFirstPorts?: number[];
|
|
82
|
+
}
|
|
83
|
+
export interface IRemoteIngressEgressPolicyConfig {
|
|
84
|
+
/** Enables edge-originating outbound TCP egress. Currently limited to SMTP port 25. */
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
/** Allowed destination ports. dcrouter currently accepts only [25]. */
|
|
87
|
+
allowedPorts?: number[];
|
|
88
|
+
/** Allow private destination ranges in addition to public ranges. Defaults to false. */
|
|
89
|
+
allowPrivateRanges?: boolean;
|
|
90
|
+
/** CIDRs denied after edge-side DNS resolution. */
|
|
91
|
+
deniedCidrs?: string[];
|
|
92
|
+
/** Optional host allow patterns evaluated by the edge before dialing. */
|
|
93
|
+
allowedHostPatterns?: string[];
|
|
94
|
+
/** Optional per-edge concurrent egress stream cap. */
|
|
95
|
+
maxConcurrentStreams?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface IRemoteIngressHubSettings {
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
tunnelPort: number;
|
|
100
|
+
hubDomain?: string;
|
|
101
|
+
performance?: IRemoteIngressPerformanceConfig;
|
|
102
|
+
updatedAt: number;
|
|
103
|
+
updatedBy: string;
|
|
104
|
+
}
|
|
105
|
+
export type TRemoteIngressHubSettingsUpdate = Partial<Pick<IRemoteIngressHubSettings, 'enabled' | 'tunnelPort'>> & {
|
|
106
|
+
hubDomain?: string | null;
|
|
107
|
+
performance?: IRemoteIngressPerformanceConfig | null;
|
|
108
|
+
};
|
|
109
|
+
export interface IRemoteIngressPerformanceEffective {
|
|
110
|
+
profile: TRemoteIngressPerformanceProfile;
|
|
111
|
+
maxStreamsPerEdge: number;
|
|
112
|
+
totalWindowBudgetBytes: number;
|
|
113
|
+
minStreamWindowBytes: number;
|
|
114
|
+
maxStreamWindowBytes: number;
|
|
115
|
+
sustainedStreamWindowBytes: number;
|
|
116
|
+
quicDatagramReceiveBufferBytes: number;
|
|
117
|
+
streamFramePayloadBytes: number;
|
|
118
|
+
firstDataConnectTimeoutMs: number;
|
|
119
|
+
clientWriteTimeoutMs: number;
|
|
120
|
+
serverFirstPorts: number[];
|
|
121
|
+
}
|
|
122
|
+
export interface IRemoteIngressFlowControlStatus {
|
|
123
|
+
applies: boolean;
|
|
124
|
+
currentWindowBytes: number;
|
|
125
|
+
minWindowBytes: number;
|
|
126
|
+
maxWindowBytes: number;
|
|
127
|
+
totalWindowBudgetBytes: number;
|
|
128
|
+
estimatedInFlightBytes: number;
|
|
129
|
+
stalledStreams: number;
|
|
130
|
+
}
|
|
131
|
+
export interface IRemoteIngressQueueStatus {
|
|
132
|
+
ctrlQueueDepth: number;
|
|
133
|
+
dataQueueDepth: number;
|
|
134
|
+
sustainedQueueDepth: number;
|
|
135
|
+
}
|
|
136
|
+
export interface IRemoteIngressTrafficStatus {
|
|
137
|
+
bytesIn: number;
|
|
138
|
+
bytesOut: number;
|
|
139
|
+
streamsOpenedTotal: number;
|
|
140
|
+
streamsClosedTotal: number;
|
|
141
|
+
rejectedStreams: number;
|
|
142
|
+
}
|
|
143
|
+
export interface IRemoteIngressUdpStatus {
|
|
144
|
+
activeSessions: number;
|
|
145
|
+
droppedDatagrams: number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Route-level remote ingress configuration.
|
|
149
|
+
* When attached to a route, signals that traffic for this route
|
|
150
|
+
* should be accepted from remote edge nodes.
|
|
151
|
+
*/
|
|
152
|
+
export interface IRouteRemoteIngress {
|
|
153
|
+
/** Whether this route receives traffic from edge nodes */
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
/** Optional filter: only edges whose id or tags match get this route's ports.
|
|
156
|
+
* When absent, the route applies to all edges. */
|
|
157
|
+
edgeFilter?: string[];
|
|
158
|
+
}
|
|
159
|
+
export interface IRouteIngress {
|
|
160
|
+
/** Accept traffic connected directly to the gateway hub listener. */
|
|
161
|
+
directHub: boolean;
|
|
162
|
+
/** Accept authenticated SmartVPN traffic carrying trusted VPN metadata. */
|
|
163
|
+
smartVpn: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Extended route config used within dcrouter.
|
|
167
|
+
* Adds explicit ingress path policy and dcrouter compatibility properties to
|
|
168
|
+
* SmartProxy's IRouteConfig.
|
|
169
|
+
* SmartProxy ignores unknown properties at runtime.
|
|
170
|
+
*/
|
|
171
|
+
export type IDcRouterRouteConfig = IRouteConfig & {
|
|
172
|
+
/**
|
|
173
|
+
* Explicit trusted ingress paths. New routes must opt in; direct hub
|
|
174
|
+
* listening is intentionally not a default.
|
|
175
|
+
*/
|
|
176
|
+
ingress?: IRouteIngress;
|
|
177
|
+
remoteIngress?: IRouteRemoteIngress;
|
|
178
|
+
/** Compatibility policy: only VPN clients whose TargetProfile matches this route get access.
|
|
179
|
+
* Matching is determined by domain overlap, target overlap, or direct routeRef. */
|
|
180
|
+
vpnOnly?: boolean;
|
|
181
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Edges tagged 'mail' bind SMTP ports and are eligible for outbound SMTP egress and mail DNS fronting. */
|
|
2
|
+
export const REMOTE_INGRESS_MAIL_TAG = 'mail';
|
|
3
|
+
/** Edges tagged 'dns' forward public TCP/UDP 53 to the hub's authoritative DNS. */
|
|
4
|
+
export const REMOTE_INGRESS_DNS_TAG = 'dns';
|
|
5
|
+
/*
|
|
6
|
+
* Edge capability tokens exchanged on the RemoteIngress wire. The remoteingress core
|
|
7
|
+
* emits them from its Rust implementation and its TS entry exports no constants for
|
|
8
|
+
* them (see the capability table in the @serve.zone/remoteingress readme), so the hub
|
|
9
|
+
* side owns exactly one copy here and every dcrouter capability check reads it.
|
|
10
|
+
*/
|
|
11
|
+
/** The edge accepts hub-initiated outbound TCP egress proxies. Absent it, egress is refused. */
|
|
12
|
+
export const REMOTE_INGRESS_EGRESS_TCP_CAPABILITY = 'egressTcp';
|
|
13
|
+
/** The edge reports its bound egress source addresses, which the hub exposes as identity status. */
|
|
14
|
+
export const REMOTE_INGRESS_EGRESS_IDENTITY_CAPABILITY = 'egressIdentity';
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVtb3RlaW5ncmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvZGF0YS9yZW1vdGVpbmdyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLDJHQUEyRztBQUMzRyxNQUFNLENBQUMsTUFBTSx1QkFBdUIsR0FBRyxNQUFNLENBQUM7QUFDOUMsbUZBQW1GO0FBQ25GLE1BQU0sQ0FBQyxNQUFNLHNCQUFzQixHQUFHLEtBQUssQ0FBQztBQUU1Qzs7Ozs7R0FLRztBQUNILGdHQUFnRztBQUNoRyxNQUFNLENBQUMsTUFBTSxvQ0FBb0MsR0FBRyxXQUFXLENBQUM7QUFDaEUsb0dBQW9HO0FBQ3BHLE1BQU0sQ0FBQyxNQUFNLHlDQUF5QyxHQUFHLGdCQUFnQixDQUFDIn0=
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import type { IRouteConfig } from '@push.rocks/smartproxy';
|
|
2
|
+
import type { IRouteChallengeConfig } from '@push.rocks/smartchallenge';
|
|
3
|
+
import type * as servezoneInterfaces from '@serve.zone/interfaces';
|
|
4
|
+
import type { IDcRouterRouteConfig, IRouteRemoteIngress } from './remoteingress.js';
|
|
5
|
+
type TSmartProxyRouteRateLimit = NonNullable<NonNullable<IRouteConfig['security']>['rateLimit']>;
|
|
6
|
+
export type TRouteRateLimitExceededPolicy = NonNullable<TSmartProxyRouteRateLimit['onExceeded']>;
|
|
7
|
+
export interface IRouteRateLimit extends TSmartProxyRouteRateLimit {
|
|
8
|
+
onExceeded?: TRouteRateLimitExceededPolicy;
|
|
9
|
+
}
|
|
10
|
+
type TSmartProxyRouteSecurityBase = Omit<NonNullable<IRouteConfig['security']>, 'rateLimit' | 'challenge'>;
|
|
11
|
+
export interface IRouteSecurity extends TSmartProxyRouteSecurityBase {
|
|
12
|
+
rateLimit?: IRouteRateLimit | null;
|
|
13
|
+
challenge?: IRouteChallengeConfig | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const apiTokenScopes: readonly ["*", "routes:read", "routes:write", "config:read", "stats:read", "logs:read", "config-events:read", "config-events:write", "security:read", "security:write", "emails:read", "emails:write", "certificates:read", "certificates:write", "tokens:read", "tokens:manage", "users:read", "users:manage", "source-profiles:read", "source-profiles:write", "target-profiles:read", "target-profiles:write", "targets:read", "targets:write", "dns-providers:read", "dns-providers:write", "domains:read", "domains:write", "dns-authority:read", "dns-authority:write", "dns-records:read", "dns-records:write", "acme-config:read", "acme-config:write", "email-domains:read", "email-domains:write", "smtp-accounts:read", "smtp-accounts:write", "remote-ingress:read", "remote-ingress:write", "vpn:read", "vpn:write", "radius:read", "radius:write", "gateway-clients:read", "gateway-clients:write", "workhosters:read", "workhosters:write", "testing:read", "testing:write", "testing:manage"];
|
|
16
|
+
export type TApiTokenScope = typeof apiTokenScopes[number];
|
|
17
|
+
export type TGatewayClientType = 'onebox' | 'cloudly' | 'custom';
|
|
18
|
+
export interface IApiTokenPolicy {
|
|
19
|
+
role: 'admin' | 'gatewayClient' | 'operator' | 'testingClient';
|
|
20
|
+
scopes?: TApiTokenScope[];
|
|
21
|
+
testingClient?: {
|
|
22
|
+
registrationId: string;
|
|
23
|
+
credentialGeneration: number;
|
|
24
|
+
};
|
|
25
|
+
gatewayClient?: {
|
|
26
|
+
type: TGatewayClientType;
|
|
27
|
+
id: string;
|
|
28
|
+
policyGeneration: number;
|
|
29
|
+
};
|
|
30
|
+
hostnamePatterns?: string[];
|
|
31
|
+
allowedRouteTargets?: Array<{
|
|
32
|
+
host: string;
|
|
33
|
+
ports: number[];
|
|
34
|
+
allowAnyPort?: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
capabilities?: {
|
|
37
|
+
readDomains?: boolean;
|
|
38
|
+
readDnsRecords?: boolean;
|
|
39
|
+
readRoutes?: boolean;
|
|
40
|
+
syncRoutes?: boolean;
|
|
41
|
+
syncDnsRecords?: boolean;
|
|
42
|
+
readMail?: boolean;
|
|
43
|
+
manageMail?: boolean;
|
|
44
|
+
readCertificates?: boolean;
|
|
45
|
+
requestCertificates?: boolean;
|
|
46
|
+
readWebPush?: boolean;
|
|
47
|
+
manageWebPush?: boolean;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface IGatewayCredentialLifecycle {
|
|
51
|
+
source: 'provisioned';
|
|
52
|
+
state: 'candidate' | 'active';
|
|
53
|
+
/** Strictly monotonic within one gateway client. */
|
|
54
|
+
sequence: number;
|
|
55
|
+
/** Generation this credential was issued to activate. */
|
|
56
|
+
policyGeneration: number;
|
|
57
|
+
/** Digest of the exact durable policy snapshot this credential may activate. */
|
|
58
|
+
policyDigest: string;
|
|
59
|
+
/** Set once when a provisioned candidate first becomes active. */
|
|
60
|
+
finalizedAt: number | null;
|
|
61
|
+
/** Set only after older provisioned credentials have been durably cleaned up. */
|
|
62
|
+
cleanupCompletedAt: number | null;
|
|
63
|
+
/** Stable response value retained for idempotent finalization retries. */
|
|
64
|
+
revokedCredentialCount: number | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A reusable, named source profile that can be referenced by routes.
|
|
68
|
+
* Stores the full IRouteSecurity shape from SmartProxy.
|
|
69
|
+
*
|
|
70
|
+
* SourceProfile = source-side (who can access: ipAllowList, rateLimit, auth)
|
|
71
|
+
* TargetProfile = target-side (what can be accessed: domains, IP:port targets, route refs)
|
|
72
|
+
*/
|
|
73
|
+
export interface ISourceProfile {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
/** The security configuration — mirrors SmartProxy's IRouteSecurity. */
|
|
78
|
+
security: IRouteSecurity;
|
|
79
|
+
/** IDs of profiles this one extends (resolved top-down, later overrides earlier). */
|
|
80
|
+
extendsProfiles?: string[];
|
|
81
|
+
createdAt: number;
|
|
82
|
+
updatedAt: number;
|
|
83
|
+
createdBy: string;
|
|
84
|
+
}
|
|
85
|
+
export interface IRouteSourcePolicyExceededAction {
|
|
86
|
+
type: '429';
|
|
87
|
+
errorMessage?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare const routePathClasses: readonly ["git-smart-http", "static", "normal-html", "expensive-html", "raw", "archive"];
|
|
90
|
+
export type TRoutePathClass = typeof routePathClasses[number];
|
|
91
|
+
export declare const giteaRoutePathClassLabels: Record<TRoutePathClass, string>;
|
|
92
|
+
export declare const giteaRoutePathClassPatterns: Record<TRoutePathClass, string[]>;
|
|
93
|
+
export interface IRoutePathPolicyBinding {
|
|
94
|
+
id?: string;
|
|
95
|
+
pathClass: TRoutePathClass;
|
|
96
|
+
/** Optional custom patterns. When omitted, the Gitea defaults for the class are used. */
|
|
97
|
+
pathPatterns?: string[];
|
|
98
|
+
/** Optional path-class override for the source binding's rate limit. */
|
|
99
|
+
rateLimit?: IRouteSecurity['rateLimit'];
|
|
100
|
+
/** Optional path-class override for the source binding's browser challenge. */
|
|
101
|
+
challenge?: IRouteSecurity['challenge'];
|
|
102
|
+
/** Optional path-class override for the source binding's connection limit. */
|
|
103
|
+
maxConnections?: IRouteSecurity['maxConnections'];
|
|
104
|
+
onExceeded?: IRouteSourcePolicyExceededAction;
|
|
105
|
+
}
|
|
106
|
+
export interface IRouteSourceBinding {
|
|
107
|
+
id?: string;
|
|
108
|
+
sourceProfileRef: string;
|
|
109
|
+
/** Snapshot of the profile name at resolution time, for display. */
|
|
110
|
+
sourceProfileName?: string;
|
|
111
|
+
/** Optional route-level override for the referenced profile's rate limit. */
|
|
112
|
+
rateLimit?: IRouteSecurity['rateLimit'];
|
|
113
|
+
/** Optional route-level override for the referenced profile's browser challenge. */
|
|
114
|
+
challenge?: IRouteSecurity['challenge'];
|
|
115
|
+
/** Optional route-level override for the referenced profile's connection limit. */
|
|
116
|
+
maxConnections?: IRouteSecurity['maxConnections'];
|
|
117
|
+
/** Optional exceeded message for source-policy connection/rate responses; rate-limit challenge lives on rateLimit.onExceeded. */
|
|
118
|
+
onExceeded?: IRouteSourcePolicyExceededAction;
|
|
119
|
+
/** Optional path-class variants inside this source binding. Path-specific variants win over fallback variants. */
|
|
120
|
+
pathPolicies?: IRoutePathPolicyBinding[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A reusable, named network target (host + port) that can be referenced by routes.
|
|
124
|
+
*/
|
|
125
|
+
export interface INetworkTarget {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
host: string | string[];
|
|
130
|
+
port: number;
|
|
131
|
+
createdAt: number;
|
|
132
|
+
updatedAt: number;
|
|
133
|
+
createdBy: string;
|
|
134
|
+
}
|
|
135
|
+
export declare const managedRouteKinds: readonly ["letsencrypt-http01-forward"];
|
|
136
|
+
export type TManagedRouteKind = typeof managedRouteKinds[number];
|
|
137
|
+
/**
|
|
138
|
+
* Operator input for a canonical Let's Encrypt HTTP-01 forward.
|
|
139
|
+
* Match port, path, protocol, priority, and source policy are server-managed.
|
|
140
|
+
*/
|
|
141
|
+
export interface ILetsEncryptHttp01ForwardConfig {
|
|
142
|
+
name: string;
|
|
143
|
+
domains: string[];
|
|
144
|
+
target?: {
|
|
145
|
+
host: string;
|
|
146
|
+
port: number;
|
|
147
|
+
};
|
|
148
|
+
networkTargetRef?: string;
|
|
149
|
+
remoteIngress?: IRouteRemoteIngress;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Metadata on a stored route tracking where its resolved values came from.
|
|
153
|
+
*/
|
|
154
|
+
export interface IRouteMetadata {
|
|
155
|
+
/** Ordered source profile bindings. The first matching source profile wins. */
|
|
156
|
+
sourceBindings?: IRouteSourceBinding[];
|
|
157
|
+
/** ID of the NetworkTargetDoc used to resolve this route's targets. */
|
|
158
|
+
networkTargetRef?: string;
|
|
159
|
+
/** Snapshot of the target name at resolution time, for display. */
|
|
160
|
+
networkTargetName?: string;
|
|
161
|
+
/** Timestamp of last reference resolution. */
|
|
162
|
+
lastResolvedAt?: number;
|
|
163
|
+
/** External route ownership, used by gateway client reconciliation. */
|
|
164
|
+
ownerType?: 'gatewayClient' | 'operator' | 'system';
|
|
165
|
+
gatewayClientType?: TGatewayClientType;
|
|
166
|
+
gatewayClientId?: string;
|
|
167
|
+
gatewayClientAppId?: string;
|
|
168
|
+
externalKey?: string;
|
|
169
|
+
/** Persisted DNS intent for gateway route reconciliation. */
|
|
170
|
+
gatewayDnsMode?: servezoneInterfaces.data.TGatewayRouteDnsMode;
|
|
171
|
+
/** Persisted provider proxy intent for gateway-managed DNS records. */
|
|
172
|
+
gatewayDnsProxied?: boolean;
|
|
173
|
+
/** Canonical server-managed route purpose. */
|
|
174
|
+
managedRouteKind?: TManagedRouteKind;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A route entry returned by the route management API.
|
|
178
|
+
*/
|
|
179
|
+
export interface IMergedRoute {
|
|
180
|
+
route: IDcRouterRouteConfig;
|
|
181
|
+
id: string;
|
|
182
|
+
enabled: boolean;
|
|
183
|
+
origin: 'config' | 'email' | 'dns' | 'api';
|
|
184
|
+
systemKey?: string;
|
|
185
|
+
createdAt?: number;
|
|
186
|
+
updatedAt?: number;
|
|
187
|
+
metadata?: IRouteMetadata;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A warning generated during route startup/apply.
|
|
191
|
+
*/
|
|
192
|
+
export interface IRouteWarning {
|
|
193
|
+
/**
|
|
194
|
+
* - 'disabled-route' → the route exists but is switched off.
|
|
195
|
+
* - 'unverified-domain-ownership' → the route requests an automatic
|
|
196
|
+
* certificate for a domain whose ownership dcrouter cannot prove, so ACME
|
|
197
|
+
* can never succeed for it. Surfaced rather than refused for already-stored
|
|
198
|
+
* routes; new and updated routes are refused outright.
|
|
199
|
+
*/
|
|
200
|
+
type: 'disabled-route' | 'unverified-domain-ownership';
|
|
201
|
+
routeName: string;
|
|
202
|
+
message: string;
|
|
203
|
+
}
|
|
204
|
+
export type THttpRedirectStatus = 'active' | 'covered' | 'skipped';
|
|
205
|
+
/**
|
|
206
|
+
* Derived HTTP-to-HTTPS redirect shown in the Ops UI.
|
|
207
|
+
* These entries are generated from configured HTTPS routes and are not stored as routes.
|
|
208
|
+
*/
|
|
209
|
+
export interface IHttpRedirectInfo {
|
|
210
|
+
id: string;
|
|
211
|
+
status: THttpRedirectStatus;
|
|
212
|
+
domainPattern: string;
|
|
213
|
+
pathPattern?: string;
|
|
214
|
+
fromTemplate: string;
|
|
215
|
+
toTemplate: string;
|
|
216
|
+
statusCode: number;
|
|
217
|
+
priority: number;
|
|
218
|
+
sourceRouteNames: string[];
|
|
219
|
+
sourceRouteIds: string[];
|
|
220
|
+
coveredByRouteNames: string[];
|
|
221
|
+
remoteIngress: boolean;
|
|
222
|
+
notes?: string;
|
|
223
|
+
}
|
|
224
|
+
/** Return the stored route ID behind a source-policy-compiled route variant. */
|
|
225
|
+
export declare function canonicalizeSourceRouteId(routeId: string): string;
|
|
226
|
+
/**
|
|
227
|
+
* Public info about an API token (never includes the hash).
|
|
228
|
+
*/
|
|
229
|
+
export interface IApiTokenInfo {
|
|
230
|
+
id: string;
|
|
231
|
+
name: string;
|
|
232
|
+
scopes: TApiTokenScope[];
|
|
233
|
+
policy?: IApiTokenPolicy;
|
|
234
|
+
createdAt: number;
|
|
235
|
+
expiresAt: number | null;
|
|
236
|
+
lastUsedAt: number | null;
|
|
237
|
+
enabled: boolean;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A route persisted in the database.
|
|
241
|
+
*/
|
|
242
|
+
export interface IRoute {
|
|
243
|
+
id: string;
|
|
244
|
+
route: IDcRouterRouteConfig;
|
|
245
|
+
enabled: boolean;
|
|
246
|
+
createdAt: number;
|
|
247
|
+
updatedAt: number;
|
|
248
|
+
createdBy: string;
|
|
249
|
+
origin: 'config' | 'email' | 'dns' | 'api';
|
|
250
|
+
systemKey?: string;
|
|
251
|
+
metadata?: IRouteMetadata;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A stored API token, stored in /config-api/tokens/{id}.json
|
|
255
|
+
*/
|
|
256
|
+
export interface IStoredApiToken {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
tokenHash: string;
|
|
260
|
+
scopes: TApiTokenScope[];
|
|
261
|
+
policy?: IApiTokenPolicy;
|
|
262
|
+
/** Null/absent means an ordinary manually issued token. */
|
|
263
|
+
gatewayCredentialLifecycle?: IGatewayCredentialLifecycle | null;
|
|
264
|
+
createdAt: number;
|
|
265
|
+
expiresAt: number | null;
|
|
266
|
+
lastUsedAt: number | null;
|
|
267
|
+
createdBy: string;
|
|
268
|
+
enabled: boolean;
|
|
269
|
+
}
|
|
270
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Route Management Data Types
|
|
3
|
+
// ============================================================================
|
|
4
|
+
export const apiTokenScopes = [
|
|
5
|
+
'*',
|
|
6
|
+
'routes:read',
|
|
7
|
+
'routes:write',
|
|
8
|
+
'config:read',
|
|
9
|
+
'stats:read',
|
|
10
|
+
'logs:read',
|
|
11
|
+
'config-events:read',
|
|
12
|
+
'config-events:write',
|
|
13
|
+
'security:read',
|
|
14
|
+
'security:write',
|
|
15
|
+
'emails:read',
|
|
16
|
+
'emails:write',
|
|
17
|
+
'certificates:read',
|
|
18
|
+
'certificates:write',
|
|
19
|
+
'tokens:read',
|
|
20
|
+
'tokens:manage',
|
|
21
|
+
'users:read',
|
|
22
|
+
'users:manage',
|
|
23
|
+
'source-profiles:read',
|
|
24
|
+
'source-profiles:write',
|
|
25
|
+
'target-profiles:read',
|
|
26
|
+
'target-profiles:write',
|
|
27
|
+
'targets:read',
|
|
28
|
+
'targets:write',
|
|
29
|
+
'dns-providers:read',
|
|
30
|
+
'dns-providers:write',
|
|
31
|
+
'domains:read',
|
|
32
|
+
'domains:write',
|
|
33
|
+
'dns-authority:read',
|
|
34
|
+
'dns-authority:write',
|
|
35
|
+
'dns-records:read',
|
|
36
|
+
'dns-records:write',
|
|
37
|
+
'acme-config:read',
|
|
38
|
+
'acme-config:write',
|
|
39
|
+
'email-domains:read',
|
|
40
|
+
'email-domains:write',
|
|
41
|
+
'smtp-accounts:read',
|
|
42
|
+
'smtp-accounts:write',
|
|
43
|
+
'remote-ingress:read',
|
|
44
|
+
'remote-ingress:write',
|
|
45
|
+
'vpn:read',
|
|
46
|
+
'vpn:write',
|
|
47
|
+
'radius:read',
|
|
48
|
+
'radius:write',
|
|
49
|
+
'gateway-clients:read',
|
|
50
|
+
'gateway-clients:write',
|
|
51
|
+
'workhosters:read',
|
|
52
|
+
'workhosters:write',
|
|
53
|
+
'testing:read',
|
|
54
|
+
'testing:write',
|
|
55
|
+
'testing:manage',
|
|
56
|
+
];
|
|
57
|
+
export const routePathClasses = [
|
|
58
|
+
'git-smart-http',
|
|
59
|
+
'static',
|
|
60
|
+
'normal-html',
|
|
61
|
+
'expensive-html',
|
|
62
|
+
'raw',
|
|
63
|
+
'archive',
|
|
64
|
+
];
|
|
65
|
+
export const giteaRoutePathClassLabels = {
|
|
66
|
+
'git-smart-http': 'Git Smart HTTP',
|
|
67
|
+
static: 'Static Assets',
|
|
68
|
+
'normal-html': 'Normal HTML',
|
|
69
|
+
'expensive-html': 'Expensive HTML',
|
|
70
|
+
raw: 'Raw Files',
|
|
71
|
+
archive: 'Archives',
|
|
72
|
+
};
|
|
73
|
+
export const giteaRoutePathClassPatterns = {
|
|
74
|
+
'git-smart-http': [
|
|
75
|
+
'/*/*.git/info/refs',
|
|
76
|
+
'/*/*.git/git-upload-pack',
|
|
77
|
+
'/*/*.git/git-receive-pack',
|
|
78
|
+
'/*/*.git/info/lfs',
|
|
79
|
+
'/*/*.git/info/lfs/*',
|
|
80
|
+
],
|
|
81
|
+
static: [
|
|
82
|
+
'/assets/*',
|
|
83
|
+
'/avatars/*',
|
|
84
|
+
'/repo-avatars/*',
|
|
85
|
+
'/user/avatar/*',
|
|
86
|
+
'/img/*',
|
|
87
|
+
'/css/*',
|
|
88
|
+
'/js/*',
|
|
89
|
+
'/fonts/*',
|
|
90
|
+
'/favicon.ico',
|
|
91
|
+
],
|
|
92
|
+
'normal-html': [],
|
|
93
|
+
'expensive-html': [
|
|
94
|
+
'/explore/*',
|
|
95
|
+
'/issues',
|
|
96
|
+
'/issues/*',
|
|
97
|
+
'/pulls',
|
|
98
|
+
'/pulls/*',
|
|
99
|
+
'/search',
|
|
100
|
+
'/*/*/commits/*',
|
|
101
|
+
'/*/*/graph',
|
|
102
|
+
'/*/*/activity',
|
|
103
|
+
'/*/*/stars',
|
|
104
|
+
'/*/*/forks',
|
|
105
|
+
'/*/*/watchers',
|
|
106
|
+
'/*/*/issues',
|
|
107
|
+
'/*/*/pulls',
|
|
108
|
+
'/*/*/projects',
|
|
109
|
+
'/*/*/actions',
|
|
110
|
+
'/*/*/packages',
|
|
111
|
+
],
|
|
112
|
+
raw: [
|
|
113
|
+
'/*/*/raw/*',
|
|
114
|
+
'/*/*/src/*',
|
|
115
|
+
],
|
|
116
|
+
archive: [
|
|
117
|
+
'/*/*/archive/*',
|
|
118
|
+
'/*/*/releases/download/*',
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// Route Metadata Types
|
|
123
|
+
// ============================================================================
|
|
124
|
+
export const managedRouteKinds = ['letsencrypt-http01-forward'];
|
|
125
|
+
/** Return the stored route ID behind a source-policy-compiled route variant. */
|
|
126
|
+
export function canonicalizeSourceRouteId(routeId) {
|
|
127
|
+
const sourceVariantIndex = routeId.indexOf(':source:');
|
|
128
|
+
return sourceVariantIndex === -1 ? routeId : routeId.slice(0, sourceVariantIndex);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtbWFuYWdlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvZGF0YS9yb3V0ZS1tYW5hZ2VtZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCQSwrRUFBK0U7QUFDL0UsOEJBQThCO0FBQzlCLCtFQUErRTtBQUUvRSxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUc7SUFDNUIsR0FBRztJQUNILGFBQWE7SUFDYixjQUFjO0lBQ2QsYUFBYTtJQUNiLFlBQVk7SUFDWixXQUFXO0lBQ1gsb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixlQUFlO0lBQ2YsZ0JBQWdCO0lBQ2hCLGFBQWE7SUFDYixjQUFjO0lBQ2QsbUJBQW1CO0lBQ25CLG9CQUFvQjtJQUNwQixhQUFhO0lBQ2IsZUFBZTtJQUNmLFlBQVk7SUFDWixjQUFjO0lBQ2Qsc0JBQXNCO0lBQ3RCLHVCQUF1QjtJQUN2QixzQkFBc0I7SUFDdEIsdUJBQXVCO0lBQ3ZCLGNBQWM7SUFDZCxlQUFlO0lBQ2Ysb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixjQUFjO0lBQ2QsZUFBZTtJQUNmLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsa0JBQWtCO0lBQ2xCLG1CQUFtQjtJQUNuQixrQkFBa0I7SUFDbEIsbUJBQW1CO0lBQ25CLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixxQkFBcUI7SUFDckIsc0JBQXNCO0lBQ3RCLFVBQVU7SUFDVixXQUFXO0lBQ1gsYUFBYTtJQUNiLGNBQWM7SUFDZCxzQkFBc0I7SUFDdEIsdUJBQXVCO0lBQ3ZCLGtCQUFrQjtJQUNsQixtQkFBbUI7SUFDbkIsY0FBYztJQUNkLGVBQWU7SUFDZixnQkFBZ0I7Q0FDUixDQUFDO0FBcUZYLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHO0lBQzlCLGdCQUFnQjtJQUNoQixRQUFRO0lBQ1IsYUFBYTtJQUNiLGdCQUFnQjtJQUNoQixLQUFLO0lBQ0wsU0FBUztDQUNELENBQUM7QUFJWCxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBb0M7SUFDeEUsZ0JBQWdCLEVBQUUsZ0JBQWdCO0lBQ2xDLE1BQU0sRUFBRSxlQUFlO0lBQ3ZCLGFBQWEsRUFBRSxhQUFhO0lBQzVCLGdCQUFnQixFQUFFLGdCQUFnQjtJQUNsQyxHQUFHLEVBQUUsV0FBVztJQUNoQixPQUFPLEVBQUUsVUFBVTtDQUNwQixDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sMkJBQTJCLEdBQXNDO0lBQzVFLGdCQUFnQixFQUFFO1FBQ2hCLG9CQUFvQjtRQUNwQiwwQkFBMEI7UUFDMUIsMkJBQTJCO1FBQzNCLG1CQUFtQjtRQUNuQixxQkFBcUI7S0FDdEI7SUFDRCxNQUFNLEVBQUU7UUFDTixXQUFXO1FBQ1gsWUFBWTtRQUNaLGlCQUFpQjtRQUNqQixnQkFBZ0I7UUFDaEIsUUFBUTtRQUNSLFFBQVE7UUFDUixPQUFPO1FBQ1AsVUFBVTtRQUNWLGNBQWM7S0FDZjtJQUNELGFBQWEsRUFBRSxFQUFFO0lBQ2pCLGdCQUFnQixFQUFFO1FBQ2hCLFlBQVk7UUFDWixTQUFTO1FBQ1QsV0FBVztRQUNYLFFBQVE7UUFDUixVQUFVO1FBQ1YsU0FBUztRQUNULGdCQUFnQjtRQUNoQixZQUFZO1FBQ1osZUFBZTtRQUNmLFlBQVk7UUFDWixZQUFZO1FBQ1osZUFBZTtRQUNmLGFBQWE7UUFDYixZQUFZO1FBQ1osZUFBZTtRQUNmLGNBQWM7UUFDZCxlQUFlO0tBQ2hCO0lBQ0QsR0FBRyxFQUFFO1FBQ0gsWUFBWTtRQUNaLFlBQVk7S0FDYjtJQUNELE9BQU8sRUFBRTtRQUNQLGdCQUFnQjtRQUNoQiwwQkFBMEI7S0FDM0I7Q0FDRixDQUFDO0FBbURGLCtFQUErRTtBQUMvRSx1QkFBdUI7QUFDdkIsK0VBQStFO0FBRS9FLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLENBQUMsNEJBQTRCLENBQVUsQ0FBQztBQWdHekUsZ0ZBQWdGO0FBQ2hGLE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxPQUFlO0lBQ3ZELE1BQU0sa0JBQWtCLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN2RCxPQUFPLGtCQUFrQixLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixDQUFDLENBQUM7QUFDcEYsQ0FBQyJ9
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IIpIntelligenceResult } from '@push.rocks/smartnetwork';
|
|
2
|
+
export type TSecurityBlockRuleType = 'ip' | 'cidr' | 'asn' | 'organization';
|
|
3
|
+
export type TSecurityBlockRuleMatchMode = 'exact' | 'contains';
|
|
4
|
+
export interface IIpIntelligenceRecord extends IIpIntelligenceResult {
|
|
5
|
+
ipAddress: string;
|
|
6
|
+
firstSeenAt: number;
|
|
7
|
+
lastSeenAt: number;
|
|
8
|
+
updatedAt: number;
|
|
9
|
+
seenCount: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ISecurityBlockRule {
|
|
12
|
+
id: string;
|
|
13
|
+
type: TSecurityBlockRuleType;
|
|
14
|
+
value: string;
|
|
15
|
+
matchMode?: TSecurityBlockRuleMatchMode;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
reason?: string;
|
|
18
|
+
createdAt: number;
|
|
19
|
+
updatedAt: number;
|
|
20
|
+
createdBy: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ISecurityCompiledPolicy {
|
|
23
|
+
blockedIps: string[];
|
|
24
|
+
blockedCidrs: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface ISecurityPolicyAuditEvent {
|
|
27
|
+
id: string;
|
|
28
|
+
action: string;
|
|
29
|
+
actor: string;
|
|
30
|
+
details: Record<string, unknown>;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
}
|