@highstate/library 0.9.15 → 0.9.18
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/highstate.library.msgpack +0 -0
- package/dist/highstate.manifest.json +5 -0
- package/dist/index.js +1716 -1166
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/src/abbreviations.ts +35 -0
- package/src/apps/code-server.ts +5 -5
- package/src/apps/deployment.ts +20 -20
- package/src/apps/dns.ts +12 -14
- package/src/apps/gitea.ts +2 -2
- package/src/apps/grocy.ts +2 -2
- package/src/apps/hubble.ts +2 -2
- package/src/apps/kubernetes-dashboard.ts +2 -2
- package/src/apps/mariadb.ts +10 -10
- package/src/apps/maybe.ts +5 -5
- package/src/apps/mongodb.ts +10 -10
- package/src/apps/network.ts +6 -6
- package/src/apps/postgresql.ts +10 -10
- package/src/apps/shared.ts +18 -19
- package/src/apps/syncthing.ts +6 -6
- package/src/apps/traefik.ts +4 -4
- package/src/apps/vaultwarden.ts +4 -4
- package/src/apps/zitadel.ts +2 -2
- package/src/cloudflare.ts +4 -4
- package/src/common.ts +25 -78
- package/src/distributions/index.ts +1 -0
- package/src/distributions/ubuntu.ts +32 -0
- package/src/dns.ts +10 -18
- package/src/files.ts +135 -0
- package/src/git.ts +58 -0
- package/src/index.ts +5 -0
- package/src/k3s.ts +9 -17
- package/src/k8s.ts +130 -146
- package/src/mullvad.ts +5 -9
- package/src/network.ts +69 -44
- package/src/nixos.ts +51 -86
- package/src/obfuscators/phantun.ts +4 -4
- package/src/obfuscators/shared.ts +23 -43
- package/src/proxmox.ts +301 -60
- package/src/restic.ts +17 -19
- package/src/sops.ts +7 -6
- package/src/ssh.ts +21 -19
- package/src/talos.ts +15 -27
- package/src/timeweb.ts +13 -13
- package/src/utils.ts +3 -3
- package/src/wireguard.ts +90 -127
package/src/mullvad.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineUnit,
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
2
2
|
import { networkEntity, peerEntity } from "./wireguard"
|
3
3
|
import { l4EndpointEntity } from "./network"
|
4
4
|
|
@@ -6,14 +6,12 @@ export const peer = defineUnit({
|
|
6
6
|
type: "mullvad.peer",
|
7
7
|
|
8
8
|
args: {
|
9
|
-
hostname:
|
9
|
+
hostname: z.string().optional(),
|
10
10
|
|
11
11
|
/**
|
12
12
|
* Whether to include Mullvad DNS servers in the peer configuration.
|
13
|
-
*
|
14
|
-
* @schema
|
15
13
|
*/
|
16
|
-
includeDns:
|
14
|
+
includeDns: z.boolean().default(true),
|
17
15
|
},
|
18
16
|
|
19
17
|
inputs: {
|
@@ -21,8 +19,6 @@ export const peer = defineUnit({
|
|
21
19
|
* The network to use for the WireGuard peer.
|
22
20
|
*
|
23
21
|
* If not provided, the peer will use default network configuration.
|
24
|
-
*
|
25
|
-
* @schema
|
26
22
|
*/
|
27
23
|
network: {
|
28
24
|
entity: networkEntity,
|
@@ -40,9 +36,9 @@ export const peer = defineUnit({
|
|
40
36
|
},
|
41
37
|
|
42
38
|
meta: {
|
43
|
-
|
39
|
+
title: "Mullvad Peer",
|
44
40
|
description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
|
45
|
-
|
41
|
+
icon: "simple-icons:mullvad",
|
46
42
|
secondaryIcon: "cib:wireguard",
|
47
43
|
secondaryIconColor: "#88171a",
|
48
44
|
category: "VPN",
|
package/src/network.ts
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
import { defineEntity, defineUnit,
|
1
|
+
import { defineEntity, defineUnit, z } from "@highstate/contract"
|
2
2
|
|
3
|
-
export const endpointVisibilitySchema =
|
3
|
+
export const endpointVisibilitySchema = z.enum([
|
4
4
|
"public", // Reachable from the public internet
|
5
5
|
"external", // Reachable from outside the system boundary, but not public
|
6
6
|
"internal", // Reachable only from within the system or cluster
|
7
7
|
])
|
8
8
|
|
9
|
-
export const endpointFilterSchema =
|
9
|
+
export const endpointFilterSchema = endpointVisibilitySchema.array()
|
10
10
|
|
11
11
|
export const l3EndpointEntity = defineEntity({
|
12
12
|
type: "network.l3-endpoint",
|
13
13
|
|
14
|
-
schema:
|
15
|
-
|
14
|
+
schema: z.intersection(
|
15
|
+
z.object({
|
16
16
|
visibility: endpointVisibilitySchema,
|
17
|
-
metadata:
|
17
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
18
18
|
}),
|
19
|
-
|
20
|
-
|
21
|
-
type:
|
19
|
+
z.union([
|
20
|
+
z.object({
|
21
|
+
type: z.literal("hostname"),
|
22
22
|
|
23
23
|
/**
|
24
24
|
* The hostname of the endpoint in the format of a domain name.
|
25
25
|
*/
|
26
|
-
hostname:
|
26
|
+
hostname: z.string(),
|
27
27
|
}),
|
28
|
-
|
29
|
-
type:
|
28
|
+
z.object({
|
29
|
+
type: z.literal("ipv4"),
|
30
30
|
|
31
31
|
/**
|
32
32
|
* The IPv4 address of the endpoint.
|
33
33
|
*/
|
34
|
-
address:
|
34
|
+
address: z.string(),
|
35
35
|
}),
|
36
|
-
|
37
|
-
type:
|
36
|
+
z.object({
|
37
|
+
type: z.literal("ipv6"),
|
38
38
|
|
39
39
|
/**
|
40
40
|
* The IPv6 address of the endpoint.
|
41
41
|
*/
|
42
|
-
address:
|
42
|
+
address: z.string(),
|
43
43
|
}),
|
44
44
|
]),
|
45
|
-
|
45
|
+
),
|
46
46
|
|
47
47
|
meta: {
|
48
48
|
color: "#4CAF50",
|
@@ -50,17 +50,17 @@ export const l3EndpointEntity = defineEntity({
|
|
50
50
|
},
|
51
51
|
})
|
52
52
|
|
53
|
-
export const l4ProtocolSchema =
|
53
|
+
export const l4ProtocolSchema = z.enum(["tcp", "udp"])
|
54
54
|
|
55
|
-
export const
|
56
|
-
port:
|
55
|
+
export const l4PortInfoSchema = z.object({
|
56
|
+
port: z.number(),
|
57
57
|
protocol: l4ProtocolSchema,
|
58
58
|
})
|
59
59
|
|
60
60
|
export const l4EndpointEntity = defineEntity({
|
61
61
|
type: "network.l4-endpoint",
|
62
62
|
|
63
|
-
schema:
|
63
|
+
schema: z.intersection(l3EndpointEntity.schema, l4PortInfoSchema),
|
64
64
|
|
65
65
|
meta: {
|
66
66
|
color: "#2196F3",
|
@@ -68,6 +68,33 @@ export const l4EndpointEntity = defineEntity({
|
|
68
68
|
},
|
69
69
|
})
|
70
70
|
|
71
|
+
export const l7AppInfoSchema = z.object({
|
72
|
+
/**
|
73
|
+
* The name of the application protocol used by the endpoint.
|
74
|
+
*/
|
75
|
+
appProtocol: z.string(),
|
76
|
+
|
77
|
+
/**
|
78
|
+
* The resource path of the application endpoint, including query parameters.
|
79
|
+
* Must not start with a slash (`/`).
|
80
|
+
*
|
81
|
+
* Example: `api/v1/resource?query=value`, `database?param=value`, `user/repo.git`.
|
82
|
+
*/
|
83
|
+
resource: z.string().optional(),
|
84
|
+
})
|
85
|
+
|
86
|
+
export const l7EndpointEntity = defineEntity({
|
87
|
+
type: "network.l7-endpoint",
|
88
|
+
|
89
|
+
schema: z.intersection(l4EndpointEntity.schema, l7AppInfoSchema),
|
90
|
+
|
91
|
+
meta: {
|
92
|
+
color: "#FF9800",
|
93
|
+
description:
|
94
|
+
"The L7 endpoint for some service. Extends an L4 endpoint with application protocol information.",
|
95
|
+
},
|
96
|
+
})
|
97
|
+
|
71
98
|
export const l3Endpoint = defineUnit({
|
72
99
|
type: "network.l3-endpoint",
|
73
100
|
|
@@ -77,12 +104,12 @@ export const l3Endpoint = defineUnit({
|
|
77
104
|
*
|
78
105
|
* May be a domain name or an IP address.
|
79
106
|
*/
|
80
|
-
endpoint:
|
107
|
+
endpoint: z.string(),
|
81
108
|
|
82
109
|
/**
|
83
110
|
* The visibility of the endpoint.
|
84
111
|
*/
|
85
|
-
visibility:
|
112
|
+
visibility: endpointVisibilitySchema.default("public"),
|
86
113
|
},
|
87
114
|
|
88
115
|
outputs: {
|
@@ -90,10 +117,10 @@ export const l3Endpoint = defineUnit({
|
|
90
117
|
},
|
91
118
|
|
92
119
|
meta: {
|
93
|
-
|
120
|
+
title: "L3 Endpoint",
|
94
121
|
description: "An L3 endpoint for some service. May be a domain name or an IP address.",
|
95
|
-
|
96
|
-
|
122
|
+
icon: "mdi:network-outline",
|
123
|
+
iconColor: "#4CAF50",
|
97
124
|
defaultNamePrefix: "endpoint",
|
98
125
|
category: "Network",
|
99
126
|
},
|
@@ -119,12 +146,12 @@ export const l4Endpoint = defineUnit({
|
|
119
146
|
* - `tcp://endpoint:port`
|
120
147
|
* - `udp://endpoint:port`
|
121
148
|
*/
|
122
|
-
endpoint:
|
149
|
+
endpoint: z.string(),
|
123
150
|
|
124
151
|
/**
|
125
152
|
* The visibility of the endpoint.
|
126
153
|
*/
|
127
|
-
visibility:
|
154
|
+
visibility: endpointVisibilitySchema.default("public"),
|
128
155
|
},
|
129
156
|
|
130
157
|
outputs: {
|
@@ -132,10 +159,10 @@ export const l4Endpoint = defineUnit({
|
|
132
159
|
},
|
133
160
|
|
134
161
|
meta: {
|
135
|
-
|
162
|
+
title: "L4 Endpoint",
|
136
163
|
description: "An L4 endpoint for some service. Extends an L3 endpoint with a port.",
|
137
|
-
|
138
|
-
|
164
|
+
icon: "mdi:network-outline",
|
165
|
+
iconColor: "#2196F3",
|
139
166
|
defaultNamePrefix: "endpoint",
|
140
167
|
category: "Network",
|
141
168
|
},
|
@@ -153,26 +180,24 @@ export const l4Endpoint = defineUnit({
|
|
153
180
|
* - `external`: Reachable from outside the system boundary (e.g., LAN, VPC), but not public.
|
154
181
|
* - `internal`: Reachable only from within the application or infrastructure boundary (e.g., within a cluster).
|
155
182
|
*/
|
156
|
-
export type EndpointVisibility =
|
183
|
+
export type EndpointVisibility = z.infer<typeof endpointVisibilitySchema>
|
157
184
|
|
158
185
|
/**
|
159
|
-
*
|
186
|
+
* The list of endpoint visibility levels used to filter endpoints.
|
160
187
|
*
|
161
|
-
*
|
162
|
-
* - `private`: Endpoints not publicly accessible (external + internal).
|
163
|
-
* - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).
|
164
|
-
* - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).
|
165
|
-
* - `most`: Select the most widely accessible endpoints, preferring visibility in the following order: `public` > `external` > `internal`.
|
188
|
+
* If empty, it will filter the most widely accessible endpoints, prefering visibility in the following order:
|
166
189
|
* - If any public endpoints exist, all public endpoints are selected.
|
167
190
|
* - Otherwise, if any external endpoints exist, all external endpoints are selected.
|
168
191
|
* - If neither exist, all internal endpoints are selected.
|
169
192
|
*/
|
170
|
-
export type EndpointFilter =
|
171
|
-
|
172
|
-
export type L3Endpoint =
|
173
|
-
export type L4Endpoint =
|
174
|
-
export type L4Protocol =
|
175
|
-
export type L4PortInfo =
|
193
|
+
export type EndpointFilter = z.infer<typeof endpointFilterSchema>
|
194
|
+
|
195
|
+
export type L3Endpoint = z.infer<typeof l3EndpointEntity.schema>
|
196
|
+
export type L4Endpoint = z.infer<typeof l4EndpointEntity.schema>
|
197
|
+
export type L4Protocol = z.infer<typeof l4ProtocolSchema>
|
198
|
+
export type L4PortInfo = z.infer<typeof l4PortInfoSchema>
|
199
|
+
export type L7Endpoint = z.infer<typeof l7EndpointEntity.schema>
|
200
|
+
export type L7AppInfo = z.infer<typeof l7AppInfoSchema>
|
176
201
|
|
177
202
|
/**
|
178
203
|
* The L3 or L4 endpoint for some service.
|
package/src/nixos.ts
CHANGED
@@ -1,25 +1,24 @@
|
|
1
|
-
import {
|
2
|
-
import { fileEntity,
|
3
|
-
|
4
|
-
export const inlineModuleEntity = defineEntity({
|
5
|
-
type: "nixos.inline-module",
|
6
|
-
|
7
|
-
schema: Type.Object({
|
8
|
-
code: Type.String(),
|
9
|
-
}),
|
10
|
-
|
11
|
-
meta: {
|
12
|
-
displayName: "NixOS Inline Module",
|
13
|
-
description: "The NixOS module reference.",
|
14
|
-
color: "#5277c3",
|
15
|
-
},
|
16
|
-
})
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
2
|
+
import { fileEntity, folderEntity } from "./files"
|
3
|
+
import { serverEntity } from "./common"
|
17
4
|
|
18
5
|
export const inlineModule = defineUnit({
|
19
6
|
type: "nixos.inline-module",
|
20
7
|
|
21
8
|
args: {
|
22
|
-
|
9
|
+
/**
|
10
|
+
* The name of the module file.
|
11
|
+
*
|
12
|
+
* If not provided, the name will be the name of the unit.
|
13
|
+
*/
|
14
|
+
moduleName: z.string().optional(),
|
15
|
+
|
16
|
+
/**
|
17
|
+
* The code of the NixOS module.
|
18
|
+
*
|
19
|
+
* In this code you can reference other modules and files by their names.
|
20
|
+
*/
|
21
|
+
code: z.string().meta({ language: "nix" }),
|
23
22
|
},
|
24
23
|
|
25
24
|
inputs: {
|
@@ -28,17 +27,22 @@ export const inlineModule = defineUnit({
|
|
28
27
|
required: false,
|
29
28
|
multiple: true,
|
30
29
|
},
|
30
|
+
folders: {
|
31
|
+
entity: folderEntity,
|
32
|
+
required: false,
|
33
|
+
multiple: true,
|
34
|
+
},
|
31
35
|
},
|
32
36
|
|
33
37
|
outputs: {
|
34
|
-
|
38
|
+
folder: folderEntity,
|
35
39
|
},
|
36
40
|
|
37
41
|
meta: {
|
38
|
-
|
42
|
+
title: "NixOS Inline Module",
|
39
43
|
description: "Creates a NixOS module from inline code.",
|
40
|
-
|
41
|
-
|
44
|
+
icon: "simple-icons:nixos",
|
45
|
+
iconColor: "#7ebae4",
|
42
46
|
secondaryIcon: "mdi:file-code",
|
43
47
|
category: "NixOS",
|
44
48
|
},
|
@@ -49,81 +53,47 @@ export const inlineModule = defineUnit({
|
|
49
53
|
},
|
50
54
|
})
|
51
55
|
|
52
|
-
export const flakeEntity = defineEntity({
|
53
|
-
type: "nixos.flake",
|
54
|
-
|
55
|
-
schema: Type.Object({
|
56
|
-
url: Type.String(),
|
57
|
-
}),
|
58
|
-
|
59
|
-
meta: {
|
60
|
-
displayName: "NixOS Flake",
|
61
|
-
description: "The NixOS flake reference.",
|
62
|
-
color: "#5277c3",
|
63
|
-
},
|
64
|
-
})
|
65
|
-
|
66
|
-
export const remoteFlake = defineUnit({
|
67
|
-
type: "nixos.remote-flake",
|
68
|
-
|
69
|
-
args: {
|
70
|
-
url: Type.String(),
|
71
|
-
},
|
72
|
-
|
73
|
-
outputs: {
|
74
|
-
flake: flakeEntity,
|
75
|
-
},
|
76
|
-
|
77
|
-
meta: {
|
78
|
-
displayName: "NixOS Remote Flake",
|
79
|
-
description: "References a remote NixOS flake.",
|
80
|
-
primaryIcon: "simple-icons:nixos",
|
81
|
-
primaryIconColor: "#7ebae4",
|
82
|
-
secondaryIcon: "simple-icons:git",
|
83
|
-
secondaryIconColor: "#f1502f",
|
84
|
-
category: "NixOS",
|
85
|
-
},
|
86
|
-
|
87
|
-
source: {
|
88
|
-
package: "@highstate/nixos",
|
89
|
-
path: "flake",
|
90
|
-
},
|
91
|
-
})
|
92
|
-
|
93
56
|
export const inlineFlake = defineUnit({
|
94
57
|
type: "nixos.inline-flake",
|
95
58
|
|
96
59
|
args: {
|
97
|
-
|
60
|
+
/**
|
61
|
+
* The name of the flake folder.
|
62
|
+
*
|
63
|
+
* If not provided, the name will be the name of the unit.
|
64
|
+
*/
|
65
|
+
flakeName: z.string().optional(),
|
66
|
+
|
67
|
+
/**
|
68
|
+
* The code of the `flake.nix` file.
|
69
|
+
*
|
70
|
+
* In this code you can reference other flakes, modules, files, and folders by their names.
|
71
|
+
*/
|
72
|
+
code: z.string().meta({ language: "nix" }),
|
98
73
|
},
|
99
74
|
|
100
75
|
inputs: {
|
101
|
-
|
102
|
-
entity:
|
76
|
+
files: {
|
77
|
+
entity: fileEntity,
|
103
78
|
required: false,
|
104
79
|
multiple: true,
|
105
80
|
},
|
106
|
-
|
107
|
-
entity:
|
108
|
-
required: false,
|
109
|
-
multiple: true,
|
110
|
-
},
|
111
|
-
files: {
|
112
|
-
entity: fileEntity,
|
81
|
+
folders: {
|
82
|
+
entity: folderEntity,
|
113
83
|
required: false,
|
114
84
|
multiple: true,
|
115
85
|
},
|
116
86
|
},
|
117
87
|
|
118
88
|
outputs: {
|
119
|
-
|
89
|
+
folder: folderEntity,
|
120
90
|
},
|
121
91
|
|
122
92
|
meta: {
|
123
|
-
|
93
|
+
title: "NixOS Inline Flake",
|
124
94
|
description: "Creates a NixOS flake from inline code.",
|
125
|
-
|
126
|
-
|
95
|
+
icon: "simple-icons:nixos",
|
96
|
+
iconColor: "#7ebae4",
|
127
97
|
secondaryIcon: "mdi:file-code",
|
128
98
|
category: "NixOS",
|
129
99
|
},
|
@@ -138,17 +108,12 @@ export const system = defineUnit({
|
|
138
108
|
type: "nixos.system",
|
139
109
|
|
140
110
|
args: {
|
141
|
-
system:
|
111
|
+
system: z.string().optional(),
|
142
112
|
},
|
143
113
|
|
144
114
|
inputs: {
|
145
|
-
flake: flakeEntity,
|
146
115
|
server: serverEntity,
|
147
|
-
|
148
|
-
entity: inlineModuleEntity,
|
149
|
-
required: false,
|
150
|
-
multiple: true,
|
151
|
-
},
|
116
|
+
flake: folderEntity,
|
152
117
|
},
|
153
118
|
|
154
119
|
outputs: {
|
@@ -156,10 +121,10 @@ export const system = defineUnit({
|
|
156
121
|
},
|
157
122
|
|
158
123
|
meta: {
|
159
|
-
|
124
|
+
title: "NixOS System",
|
160
125
|
description: "Creates a NixOS system on top of any server.",
|
161
|
-
|
162
|
-
|
126
|
+
icon: "simple-icons:nixos",
|
127
|
+
iconColor: "#7ebae4",
|
163
128
|
secondaryIcon: "codicon:vm",
|
164
129
|
category: "NixOS",
|
165
130
|
},
|
@@ -6,9 +6,9 @@ export const deobfuscator = defineUnit({
|
|
6
6
|
...deobfuscatorSpec,
|
7
7
|
|
8
8
|
meta: {
|
9
|
-
|
9
|
+
title: "Phantun Deobfuscator",
|
10
10
|
description: "The Phantun Deobfuscator deployed on Kubernetes.",
|
11
|
-
|
11
|
+
icon: "mdi:network-outline",
|
12
12
|
secondaryIcon: "mdi:hide",
|
13
13
|
category: "Obfuscators",
|
14
14
|
},
|
@@ -24,9 +24,9 @@ export const obfuscator = defineUnit({
|
|
24
24
|
...obfuscatorSpec,
|
25
25
|
|
26
26
|
meta: {
|
27
|
-
|
27
|
+
title: "Phantun Obfuscator",
|
28
28
|
description: "The Phantun Obfuscator deployed on Kubernetes.",
|
29
|
-
|
29
|
+
icon: "mdi:network-outline",
|
30
30
|
secondaryIcon: "mdi:hide",
|
31
31
|
category: "Obfuscators",
|
32
32
|
},
|
@@ -1,40 +1,34 @@
|
|
1
|
-
import {
|
1
|
+
import { $args, $inputs, $outputs, z } from "@highstate/contract"
|
2
2
|
import { clusterEntity } from "../k8s"
|
3
3
|
import { l4EndpointEntity } from "../network"
|
4
4
|
|
5
5
|
export const deobfuscatorSpec = {
|
6
|
-
args: {
|
6
|
+
args: $args({
|
7
7
|
/**
|
8
8
|
* The name of the namespace and deployment to deploy the deobfuscator on.
|
9
9
|
*
|
10
10
|
* By default, calculated as `deobfs-{type}-{name}`.
|
11
11
|
*/
|
12
|
-
appName:
|
12
|
+
appName: z.string().optional(),
|
13
13
|
|
14
14
|
/**
|
15
15
|
* The L4 endpoint to forward deobfuscated traffic to.
|
16
16
|
*
|
17
17
|
* Will take precedence over the `targetEndpoint` input.
|
18
|
-
*
|
19
|
-
* @schema
|
20
18
|
*/
|
21
|
-
targetEndpoints:
|
19
|
+
targetEndpoints: z.string().array().default([]),
|
22
20
|
|
23
21
|
/**
|
24
22
|
* Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
|
25
23
|
*
|
26
24
|
* By default, the service is not exposed and only accessible from within the cluster.
|
27
|
-
*
|
28
|
-
* @schema
|
29
25
|
*/
|
30
|
-
external:
|
31
|
-
},
|
26
|
+
external: z.boolean().default(false),
|
27
|
+
}),
|
32
28
|
|
33
|
-
inputs: {
|
29
|
+
inputs: $inputs({
|
34
30
|
/**
|
35
31
|
* The Kubernetes cluster to deploy the deobfuscator on.
|
36
|
-
*
|
37
|
-
* @schema
|
38
32
|
*/
|
39
33
|
k8sCluster: clusterEntity,
|
40
34
|
|
@@ -42,63 +36,53 @@ export const deobfuscatorSpec = {
|
|
42
36
|
* The L4 endpoints to forward deobfuscated traffic to.
|
43
37
|
*
|
44
38
|
* Will select the most appropriate endpoint based on the environment.
|
45
|
-
*
|
46
|
-
* @schema
|
47
39
|
*/
|
48
40
|
targetEndpoints: {
|
49
41
|
entity: l4EndpointEntity,
|
50
42
|
required: false,
|
51
43
|
multiple: true,
|
52
44
|
},
|
53
|
-
},
|
45
|
+
}),
|
54
46
|
|
55
|
-
outputs: {
|
47
|
+
outputs: $outputs({
|
56
48
|
/**
|
57
49
|
* The L4 endpoints of the deobfuscator accepting obfuscated traffic.
|
58
|
-
*
|
59
|
-
* @schema
|
60
50
|
*/
|
61
51
|
endpoints: {
|
62
52
|
entity: l4EndpointEntity,
|
63
53
|
required: false,
|
64
54
|
multiple: true,
|
65
55
|
},
|
66
|
-
},
|
67
|
-
}
|
56
|
+
}),
|
57
|
+
}
|
68
58
|
|
69
59
|
export const obfuscatorSpec = {
|
70
|
-
args: {
|
60
|
+
args: $args({
|
71
61
|
/**
|
72
62
|
* The name of the namespace and deployment to deploy the obfuscator on.
|
73
63
|
*
|
74
64
|
* By default, calculated as `obfs-{type}-{name}`.
|
75
65
|
*/
|
76
|
-
appName:
|
66
|
+
appName: z.string().optional(),
|
77
67
|
|
78
68
|
/**
|
79
69
|
* The endpoint of the deobfuscator to pass obfuscated traffic to.
|
80
70
|
*
|
81
71
|
* Will take precedence over the `endpoint` input.
|
82
|
-
*
|
83
|
-
* @schema
|
84
72
|
*/
|
85
|
-
endpoints:
|
73
|
+
endpoints: z.string().array().default([]),
|
86
74
|
|
87
75
|
/**
|
88
76
|
* Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
|
89
77
|
*
|
90
78
|
* By default, the service is not exposed and only accessible from within the cluster.
|
91
|
-
*
|
92
|
-
* @schema
|
93
79
|
*/
|
94
|
-
external:
|
95
|
-
},
|
80
|
+
external: z.boolean().default(false),
|
81
|
+
}),
|
96
82
|
|
97
|
-
inputs: {
|
83
|
+
inputs: $inputs({
|
98
84
|
/**
|
99
85
|
* The Kubernetes cluster to deploy the obfuscator on.
|
100
|
-
*
|
101
|
-
* @schema
|
102
86
|
*/
|
103
87
|
k8sCluster: clusterEntity,
|
104
88
|
|
@@ -106,28 +90,24 @@ export const obfuscatorSpec = {
|
|
106
90
|
* The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
|
107
91
|
*
|
108
92
|
* Will select the most appropriate endpoint based on the environment.
|
109
|
-
*
|
110
|
-
* @schema
|
111
93
|
*/
|
112
94
|
endpoints: {
|
113
95
|
entity: l4EndpointEntity,
|
114
96
|
required: false,
|
115
97
|
multiple: true,
|
116
98
|
},
|
117
|
-
},
|
99
|
+
}),
|
118
100
|
|
119
|
-
outputs: {
|
101
|
+
outputs: $outputs({
|
120
102
|
/**
|
121
103
|
* The L4 endpoints accepting unobfuscated traffic.
|
122
|
-
*
|
123
|
-
* @schema
|
124
104
|
*/
|
125
105
|
entryEndpoints: {
|
126
106
|
entity: l4EndpointEntity,
|
127
107
|
multiple: true,
|
128
108
|
},
|
129
|
-
},
|
130
|
-
}
|
109
|
+
}),
|
110
|
+
}
|
131
111
|
|
132
|
-
export type DeobfuscatorArgs =
|
133
|
-
export type ObfuscatorArgs =
|
112
|
+
export type DeobfuscatorArgs = z.infer<typeof deobfuscatorSpec.args>
|
113
|
+
export type ObfuscatorArgs = z.infer<typeof obfuscatorSpec.args>
|