@highstate/library 0.9.16 → 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/index.js +727 -548
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/src/apps/code-server.ts +5 -5
- package/src/apps/deployment.ts +20 -20
- package/src/apps/dns.ts +12 -12
- 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 +16 -17
- 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 +24 -24
- package/src/distributions/ubuntu.ts +8 -8
- package/src/dns.ts +10 -10
- package/src/files.ts +53 -64
- package/src/git.ts +7 -7
- package/src/k3s.ts +9 -9
- package/src/k8s.ts +118 -119
- package/src/mullvad.ts +5 -5
- package/src/network.ts +44 -44
- package/src/nixos.ts +15 -69
- package/src/obfuscators/phantun.ts +4 -4
- package/src/obfuscators/shared.ts +9 -9
- package/src/proxmox.ts +179 -59
- package/src/restic.ts +14 -14
- package/src/sops.ts +4 -4
- package/src/ssh.ts +19 -19
- package/src/talos.ts +15 -15
- package/src/timeweb.ts +13 -13
- package/src/utils.ts +3 -3
- package/src/wireguard.ts +82 -71
package/src/k8s.ts
CHANGED
@@ -1,37 +1,36 @@
|
|
1
|
-
import { defineEntity, defineUnit,
|
2
|
-
import { Literal } from "@sinclair/typebox"
|
1
|
+
import { $args, defineEntity, defineUnit, z } from "@highstate/contract"
|
3
2
|
import * as dns from "./dns"
|
4
3
|
import { l3EndpointEntity, l4EndpointEntity } from "./network"
|
5
4
|
import { serverEntity } from "./common"
|
6
5
|
import { arrayPatchModeSchema } from "./utils"
|
7
6
|
|
8
|
-
export const fallbackKubeApiAccessSchema =
|
9
|
-
serverIp:
|
10
|
-
serverPort:
|
7
|
+
export const fallbackKubeApiAccessSchema = z.object({
|
8
|
+
serverIp: z.string(),
|
9
|
+
serverPort: z.number(),
|
11
10
|
})
|
12
11
|
|
13
|
-
export const tunDevicePolicySchema =
|
14
|
-
|
15
|
-
type:
|
12
|
+
export const tunDevicePolicySchema = z.union([
|
13
|
+
z.object({
|
14
|
+
type: z.literal("host"),
|
16
15
|
}),
|
17
|
-
|
18
|
-
type:
|
19
|
-
resourceName:
|
20
|
-
resourceValue:
|
16
|
+
z.object({
|
17
|
+
type: z.literal("plugin"),
|
18
|
+
resourceName: z.string(),
|
19
|
+
resourceValue: z.string(),
|
21
20
|
}),
|
22
21
|
])
|
23
22
|
|
24
|
-
export const externalServiceTypeSchema =
|
25
|
-
export const scheduleOnMastersPolicySchema =
|
26
|
-
export const cniSchema =
|
23
|
+
export const externalServiceTypeSchema = z.enum(["NodePort", "LoadBalancer"])
|
24
|
+
export const scheduleOnMastersPolicySchema = z.enum(["always", "when-no-workers", "never"])
|
25
|
+
export const cniSchema = z.enum(["cilium", "other"])
|
27
26
|
|
28
|
-
export const clusterQuirksSchema =
|
27
|
+
export const clusterQuirksSchema = z.object({
|
29
28
|
/**
|
30
29
|
* The IP and port of the kube-apiserver available from the cluster.
|
31
30
|
*
|
32
31
|
* Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
|
33
32
|
*/
|
34
|
-
fallbackKubeApiAccess:
|
33
|
+
fallbackKubeApiAccess: fallbackKubeApiAccessSchema.optional(),
|
35
34
|
|
36
35
|
/**
|
37
36
|
* Specifies the policy for using the tun device inside containers.
|
@@ -40,14 +39,14 @@ export const clusterQuirksSchema = Type.Object({
|
|
40
39
|
*
|
41
40
|
* For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.
|
42
41
|
*/
|
43
|
-
tunDevicePolicy:
|
42
|
+
tunDevicePolicy: tunDevicePolicySchema.optional(),
|
44
43
|
|
45
44
|
/**
|
46
45
|
* The service type to use for external services.
|
47
46
|
*
|
48
47
|
* If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
|
49
48
|
*/
|
50
|
-
externalServiceType:
|
49
|
+
externalServiceType: externalServiceTypeSchema.optional(),
|
51
50
|
})
|
52
51
|
|
53
52
|
export const clusterInfoProperties = {
|
@@ -56,12 +55,12 @@ export const clusterInfoProperties = {
|
|
56
55
|
*
|
57
56
|
* Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.
|
58
57
|
*/
|
59
|
-
id:
|
58
|
+
id: z.string(),
|
60
59
|
|
61
60
|
/**
|
62
61
|
* The name of the cluster.
|
63
62
|
*/
|
64
|
-
name:
|
63
|
+
name: z.string(),
|
65
64
|
|
66
65
|
/**
|
67
66
|
* The name of the CNI plugin used by the cluster.
|
@@ -79,7 +78,7 @@ export const clusterInfoProperties = {
|
|
79
78
|
*
|
80
79
|
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
81
80
|
*/
|
82
|
-
endpoints:
|
81
|
+
endpoints: l3EndpointEntity.schema.array(),
|
83
82
|
|
84
83
|
/**
|
85
84
|
* The endpoints of the API server.
|
@@ -88,45 +87,45 @@ export const clusterInfoProperties = {
|
|
88
87
|
*
|
89
88
|
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
90
89
|
*/
|
91
|
-
apiEndpoints:
|
90
|
+
apiEndpoints: l4EndpointEntity.schema.array(),
|
92
91
|
|
93
92
|
/**
|
94
93
|
* The external IPs of the cluster nodes allowed to be used for external access.
|
95
94
|
*/
|
96
|
-
externalIps:
|
95
|
+
externalIps: z.string().array(),
|
97
96
|
|
98
97
|
/**
|
99
98
|
* The extra quirks of the cluster to improve compatibility.
|
100
99
|
*/
|
101
|
-
quirks:
|
100
|
+
quirks: clusterQuirksSchema.optional(),
|
102
101
|
|
103
102
|
/**
|
104
103
|
* The extra metadata to attach to the cluster.
|
105
104
|
*/
|
106
|
-
metadata:
|
105
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
107
106
|
} as const
|
108
107
|
|
109
|
-
export const serviceTypeSchema =
|
108
|
+
export const serviceTypeSchema = z.enum(["NodePort", "LoadBalancer", "ClusterIP"])
|
110
109
|
|
111
|
-
export const metadataSchema =
|
112
|
-
name:
|
113
|
-
namespace:
|
114
|
-
labels:
|
115
|
-
annotations:
|
110
|
+
export const metadataSchema = z.object({
|
111
|
+
name: z.string(),
|
112
|
+
namespace: z.string(),
|
113
|
+
labels: z.record(z.string(), z.string()).optional(),
|
114
|
+
annotations: z.record(z.string(), z.string()).optional(),
|
116
115
|
})
|
117
116
|
|
118
|
-
export const resourceSchema =
|
119
|
-
clusterId:
|
117
|
+
export const resourceSchema = z.object({
|
118
|
+
clusterId: z.string(),
|
120
119
|
metadata: metadataSchema,
|
121
120
|
})
|
122
121
|
|
123
122
|
export const serviceEntity = defineEntity({
|
124
123
|
type: "k8s.service",
|
125
124
|
|
126
|
-
schema:
|
127
|
-
type:
|
128
|
-
...resourceSchema.
|
129
|
-
endpoints:
|
125
|
+
schema: z.object({
|
126
|
+
type: z.literal("k8s.service"),
|
127
|
+
...resourceSchema.shape,
|
128
|
+
endpoints: l4EndpointEntity.schema.array(),
|
130
129
|
}),
|
131
130
|
|
132
131
|
meta: {
|
@@ -137,9 +136,9 @@ export const serviceEntity = defineEntity({
|
|
137
136
|
export const clusterEntity = defineEntity({
|
138
137
|
type: "k8s.cluster",
|
139
138
|
|
140
|
-
schema:
|
139
|
+
schema: z.object({
|
141
140
|
...clusterInfoProperties,
|
142
|
-
kubeconfig:
|
141
|
+
kubeconfig: z.string(),
|
143
142
|
}),
|
144
143
|
|
145
144
|
meta: {
|
@@ -147,9 +146,9 @@ export const clusterEntity = defineEntity({
|
|
147
146
|
},
|
148
147
|
})
|
149
148
|
|
150
|
-
export const internalIpsPolicySchema =
|
149
|
+
export const internalIpsPolicySchema = z.enum(["always", "public", "never"])
|
151
150
|
|
152
|
-
export const scheduleOnMastersPolicyArgs = {
|
151
|
+
export const scheduleOnMastersPolicyArgs = $args({
|
153
152
|
/**
|
154
153
|
* The policy for scheduling workloads on master nodes.
|
155
154
|
*
|
@@ -157,8 +156,8 @@ export const scheduleOnMastersPolicyArgs = {
|
|
157
156
|
* - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
|
158
157
|
* - `never`: never schedule workloads on master nodes.
|
159
158
|
*/
|
160
|
-
scheduleOnMastersPolicy:
|
161
|
-
}
|
159
|
+
scheduleOnMastersPolicy: scheduleOnMastersPolicySchema.default("when-no-workers"),
|
160
|
+
})
|
162
161
|
|
163
162
|
export const clusterInputs = {
|
164
163
|
masters: {
|
@@ -193,7 +192,7 @@ export const existingCluster = defineUnit({
|
|
193
192
|
*
|
194
193
|
* If not provided, will be automatically detected by querying the cluster nodes.
|
195
194
|
*/
|
196
|
-
externalIps:
|
195
|
+
externalIps: z.string().array().optional(),
|
197
196
|
|
198
197
|
/**
|
199
198
|
* The policy for using internal IPs of the nodes as external IPs.
|
@@ -202,12 +201,12 @@ export const existingCluster = defineUnit({
|
|
202
201
|
* - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
|
203
202
|
* - `never`: never use internal IPs as external IPs.
|
204
203
|
*/
|
205
|
-
internalIpsPolicy:
|
204
|
+
internalIpsPolicy: internalIpsPolicySchema.default("public"),
|
206
205
|
|
207
206
|
/**
|
208
207
|
* The extra quirks of the cluster to improve compatibility.
|
209
208
|
*/
|
210
|
-
quirks:
|
209
|
+
quirks: clusterQuirksSchema.optional(),
|
211
210
|
},
|
212
211
|
|
213
212
|
secrets: {
|
@@ -216,15 +215,15 @@ export const existingCluster = defineUnit({
|
|
216
215
|
*
|
217
216
|
* Will be available for all components using `cluster` output of this unit.
|
218
217
|
*/
|
219
|
-
kubeconfig:
|
218
|
+
kubeconfig: z.record(z.string(), z.unknown()),
|
220
219
|
},
|
221
220
|
|
222
221
|
outputs: clusterOutputs,
|
223
222
|
|
224
223
|
meta: {
|
225
|
-
|
224
|
+
title: "Existing Cluster",
|
226
225
|
description: "An existing Kubernetes cluster.",
|
227
|
-
|
226
|
+
icon: "devicon:kubernetes",
|
228
227
|
category: "Kubernetes",
|
229
228
|
},
|
230
229
|
|
@@ -245,7 +244,7 @@ export const clusterPatch = defineUnit({
|
|
245
244
|
*
|
246
245
|
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
247
246
|
*/
|
248
|
-
apiEndpoints:
|
247
|
+
apiEndpoints: z.string().array().default([]),
|
249
248
|
|
250
249
|
/**
|
251
250
|
* The mode to use for patching the API endpoints.
|
@@ -253,7 +252,7 @@ export const clusterPatch = defineUnit({
|
|
253
252
|
* - `prepend`: prepend the new endpoints to the existing ones (default);
|
254
253
|
* - `replace`: replace the existing endpoints with the new ones.
|
255
254
|
*/
|
256
|
-
apiEndpointsPatchMode:
|
255
|
+
apiEndpointsPatchMode: arrayPatchModeSchema.default("prepend"),
|
257
256
|
|
258
257
|
/**
|
259
258
|
* The endpoints of the cluster nodes.
|
@@ -262,7 +261,7 @@ export const clusterPatch = defineUnit({
|
|
262
261
|
*
|
263
262
|
* The same node may also be represented by multiple entries (e.g. a node with private and public IP).
|
264
263
|
*/
|
265
|
-
endpoints:
|
264
|
+
endpoints: z.string().array().default([]),
|
266
265
|
|
267
266
|
/**
|
268
267
|
* The mode to use for patching the endpoints.
|
@@ -270,7 +269,7 @@ export const clusterPatch = defineUnit({
|
|
270
269
|
* - `prepend`: prepend the new endpoints to the existing ones (default);
|
271
270
|
* - `replace`: replace the existing endpoints with the new ones.
|
272
271
|
*/
|
273
|
-
endpointsPatchMode:
|
272
|
+
endpointsPatchMode: arrayPatchModeSchema.default("prepend"),
|
274
273
|
},
|
275
274
|
|
276
275
|
inputs: {
|
@@ -290,9 +289,9 @@ export const clusterPatch = defineUnit({
|
|
290
289
|
outputs: clusterOutputs,
|
291
290
|
|
292
291
|
meta: {
|
293
|
-
|
292
|
+
title: "Cluster Patch",
|
294
293
|
description: "Patches some properties of the cluster.",
|
295
|
-
|
294
|
+
icon: "devicon:kubernetes",
|
296
295
|
secondaryIcon: "fluent:patch-20-filled",
|
297
296
|
category: "Kubernetes",
|
298
297
|
},
|
@@ -319,9 +318,9 @@ export const clusterDns = defineUnit({
|
|
319
318
|
outputs: clusterOutputs,
|
320
319
|
|
321
320
|
meta: {
|
322
|
-
|
321
|
+
title: "Cluster DNS",
|
323
322
|
description: "Creates DNS records for the cluster and updates endpoints.",
|
324
|
-
|
323
|
+
icon: "devicon:kubernetes",
|
325
324
|
secondaryIcon: "mdi:dns",
|
326
325
|
category: "Kubernetes",
|
327
326
|
},
|
@@ -335,12 +334,12 @@ export const clusterDns = defineUnit({
|
|
335
334
|
export const gatewayEntity = defineEntity({
|
336
335
|
type: "k8s.gateway",
|
337
336
|
|
338
|
-
schema:
|
339
|
-
clusterId:
|
340
|
-
gatewayClassName:
|
341
|
-
httpListenerPort:
|
342
|
-
httpsListenerPort:
|
343
|
-
endpoints:
|
337
|
+
schema: z.object({
|
338
|
+
clusterId: z.string(),
|
339
|
+
gatewayClassName: z.string(),
|
340
|
+
httpListenerPort: z.number(),
|
341
|
+
httpsListenerPort: z.number(),
|
342
|
+
endpoints: l3EndpointEntity.schema.array(),
|
344
343
|
}),
|
345
344
|
|
346
345
|
meta: {
|
@@ -351,9 +350,9 @@ export const gatewayEntity = defineEntity({
|
|
351
350
|
export const tlsIssuerEntity = defineEntity({
|
352
351
|
type: "k8s.tls-issuer",
|
353
352
|
|
354
|
-
schema:
|
355
|
-
clusterId:
|
356
|
-
clusterIssuerName:
|
353
|
+
schema: z.object({
|
354
|
+
clusterId: z.string(),
|
355
|
+
clusterIssuerName: z.string(),
|
357
356
|
}),
|
358
357
|
|
359
358
|
meta: {
|
@@ -364,11 +363,11 @@ export const tlsIssuerEntity = defineEntity({
|
|
364
363
|
export const accessPointEntity = defineEntity({
|
365
364
|
type: "k8s.access-point",
|
366
365
|
|
367
|
-
schema:
|
368
|
-
clusterId:
|
366
|
+
schema: z.object({
|
367
|
+
clusterId: z.string(),
|
369
368
|
gateway: gatewayEntity.schema,
|
370
369
|
tlsIssuer: tlsIssuerEntity.schema,
|
371
|
-
dnsProviders:
|
370
|
+
dnsProviders: dns.providerEntity.schema.array(),
|
372
371
|
}),
|
373
372
|
|
374
373
|
meta: {
|
@@ -393,9 +392,9 @@ export const accessPoint = defineUnit({
|
|
393
392
|
},
|
394
393
|
|
395
394
|
meta: {
|
396
|
-
|
395
|
+
title: "Access Point",
|
397
396
|
description: "An access point which can be used to connect to services.",
|
398
|
-
|
397
|
+
icon: "mdi:access-point",
|
399
398
|
category: "Kubernetes",
|
400
399
|
},
|
401
400
|
|
@@ -417,9 +416,9 @@ export const certManager = defineUnit({
|
|
417
416
|
},
|
418
417
|
|
419
418
|
meta: {
|
420
|
-
|
419
|
+
title: "Cert Manager",
|
421
420
|
description: "A certificate manager for managing TLS certificates.",
|
422
|
-
|
421
|
+
icon: "simple-icons:letsencrypt",
|
423
422
|
category: "Kubernetes",
|
424
423
|
},
|
425
424
|
|
@@ -438,7 +437,7 @@ export const dns01TlsIssuer = defineUnit({
|
|
438
437
|
*
|
439
438
|
* If not provided, will use all domains passed to the DNS providers.
|
440
439
|
*/
|
441
|
-
domains:
|
440
|
+
domains: z.string().array().optional(),
|
442
441
|
},
|
443
442
|
|
444
443
|
inputs: {
|
@@ -454,9 +453,9 @@ export const dns01TlsIssuer = defineUnit({
|
|
454
453
|
},
|
455
454
|
|
456
455
|
meta: {
|
457
|
-
|
456
|
+
title: "DNS01 Issuer",
|
458
457
|
description: "A TLS issuer for issuing certificate using DNS01 challenge.",
|
459
|
-
|
458
|
+
icon: "mdi:certificate",
|
460
459
|
category: "Kubernetes",
|
461
460
|
},
|
462
461
|
|
@@ -469,10 +468,10 @@ export const dns01TlsIssuer = defineUnit({
|
|
469
468
|
export const deploymentEntity = defineEntity({
|
470
469
|
type: "k8s.deployment",
|
471
470
|
|
472
|
-
schema:
|
473
|
-
type:
|
474
|
-
...resourceSchema.
|
475
|
-
service:
|
471
|
+
schema: z.object({
|
472
|
+
type: z.literal("k8s.deployment"),
|
473
|
+
...resourceSchema.shape,
|
474
|
+
service: serviceEntity.schema.optional(),
|
476
475
|
}),
|
477
476
|
|
478
477
|
meta: {
|
@@ -483,9 +482,9 @@ export const deploymentEntity = defineEntity({
|
|
483
482
|
export const statefulSetEntity = defineEntity({
|
484
483
|
type: "k8s.stateful-set",
|
485
484
|
|
486
|
-
schema:
|
487
|
-
type:
|
488
|
-
...resourceSchema.
|
485
|
+
schema: z.object({
|
486
|
+
type: z.literal("k8s.stateful-set"),
|
487
|
+
...resourceSchema.shape,
|
489
488
|
service: serviceEntity.schema,
|
490
489
|
}),
|
491
490
|
|
@@ -497,7 +496,7 @@ export const statefulSetEntity = defineEntity({
|
|
497
496
|
export const exposableWorkloadEntity = defineEntity({
|
498
497
|
type: "k8s.exposable-workload",
|
499
498
|
|
500
|
-
schema:
|
499
|
+
schema: z.union([deploymentEntity.schema, statefulSetEntity.schema]),
|
501
500
|
|
502
501
|
meta: {
|
503
502
|
color: "#4CAF50",
|
@@ -507,9 +506,9 @@ export const exposableWorkloadEntity = defineEntity({
|
|
507
506
|
export const persistentVolumeClaimEntity = defineEntity({
|
508
507
|
type: "k8s.persistent-volume-claim",
|
509
508
|
|
510
|
-
schema:
|
511
|
-
type:
|
512
|
-
...resourceSchema.
|
509
|
+
schema: z.object({
|
510
|
+
type: z.literal("k8s.persistent-volume-claim"),
|
511
|
+
...resourceSchema.shape,
|
513
512
|
}),
|
514
513
|
|
515
514
|
meta: {
|
@@ -520,8 +519,8 @@ export const persistentVolumeClaimEntity = defineEntity({
|
|
520
519
|
export const interfaceEntity = defineEntity({
|
521
520
|
type: "k8s.interface",
|
522
521
|
|
523
|
-
schema:
|
524
|
-
name:
|
522
|
+
schema: z.object({
|
523
|
+
name: z.string(),
|
525
524
|
workload: exposableWorkloadEntity.schema,
|
526
525
|
}),
|
527
526
|
|
@@ -544,9 +543,9 @@ export const gatewayApi = defineUnit({
|
|
544
543
|
},
|
545
544
|
|
546
545
|
meta: {
|
547
|
-
|
546
|
+
title: "Gateway API",
|
548
547
|
description: "Installs the Gateway API CRDs to the cluster.",
|
549
|
-
|
548
|
+
icon: "devicon:kubernetes",
|
550
549
|
secondaryIcon: "mdi:api",
|
551
550
|
secondaryIconColor: "#4CAF50",
|
552
551
|
category: "Kubernetes",
|
@@ -569,7 +568,7 @@ export const cilium = defineUnit({
|
|
569
568
|
*
|
570
569
|
* By default, is `false`.
|
571
570
|
*/
|
572
|
-
allowForbiddenFqdnResolution:
|
571
|
+
allowForbiddenFqdnResolution: z.boolean().default(false),
|
573
572
|
},
|
574
573
|
|
575
574
|
inputs: {
|
@@ -581,9 +580,9 @@ export const cilium = defineUnit({
|
|
581
580
|
},
|
582
581
|
|
583
582
|
meta: {
|
584
|
-
|
583
|
+
title: "Cilium",
|
585
584
|
description: "The Cilium CNI deployed on Kubernetes.",
|
586
|
-
|
585
|
+
icon: "simple-icons:cilium",
|
587
586
|
secondaryIcon: "devicon:kubernetes",
|
588
587
|
category: "Kubernetes",
|
589
588
|
},
|
@@ -594,45 +593,45 @@ export const cilium = defineUnit({
|
|
594
593
|
},
|
595
594
|
})
|
596
595
|
|
597
|
-
export const monitorWorkerResourceGroupSchema =
|
598
|
-
type:
|
599
|
-
namespace:
|
600
|
-
names:
|
596
|
+
export const monitorWorkerResourceGroupSchema = z.object({
|
597
|
+
type: z.enum(["deployment", "statefulset", "pod", "service"]),
|
598
|
+
namespace: z.string(),
|
599
|
+
names: z.string().array().optional(),
|
601
600
|
})
|
602
601
|
|
603
|
-
export const monitorWorkerParamsSchema =
|
602
|
+
export const monitorWorkerParamsSchema = z.object({
|
604
603
|
/**
|
605
604
|
* The ID of the secret containing the kubeconfig of the cluster.
|
606
605
|
*/
|
607
|
-
kubeconfigSecretId:
|
606
|
+
kubeconfigSecretId: z.string(),
|
608
607
|
|
609
608
|
/**
|
610
609
|
* The resources to monitor in the cluster.
|
611
610
|
*/
|
612
|
-
resourceGroups:
|
611
|
+
resourceGroups: monitorWorkerResourceGroupSchema.array(),
|
613
612
|
})
|
614
613
|
|
615
|
-
export type CNI =
|
616
|
-
export type Cluster =
|
614
|
+
export type CNI = z.infer<typeof cniSchema>
|
615
|
+
export type Cluster = z.infer<typeof clusterEntity.schema>
|
617
616
|
|
618
|
-
export type Gateway =
|
619
|
-
export type TlsIssuer =
|
620
|
-
export type AccessPoint =
|
617
|
+
export type Gateway = z.infer<typeof gatewayEntity.schema>
|
618
|
+
export type TlsIssuer = z.infer<typeof tlsIssuerEntity.schema>
|
619
|
+
export type AccessPoint = z.infer<typeof accessPointEntity.schema>
|
621
620
|
|
622
|
-
export type Metadata =
|
623
|
-
export type Resource =
|
621
|
+
export type Metadata = z.infer<typeof metadataSchema>
|
622
|
+
export type Resource = z.infer<typeof resourceSchema>
|
624
623
|
|
625
|
-
export type ServiceType =
|
626
|
-
export type Service =
|
624
|
+
export type ServiceType = z.infer<typeof serviceTypeSchema>
|
625
|
+
export type Service = z.infer<typeof serviceEntity.schema>
|
627
626
|
|
628
|
-
export type Deployment =
|
629
|
-
export type ExposableWorkload =
|
627
|
+
export type Deployment = z.infer<typeof deploymentEntity.schema>
|
628
|
+
export type ExposableWorkload = z.infer<typeof exposableWorkloadEntity.schema>
|
630
629
|
|
631
|
-
export type PersistentVolumeClaim =
|
632
|
-
export type StatefulSet =
|
630
|
+
export type PersistentVolumeClaim = z.infer<typeof persistentVolumeClaimEntity.schema>
|
631
|
+
export type StatefulSet = z.infer<typeof statefulSetEntity.schema>
|
633
632
|
|
634
|
-
export type Interface =
|
635
|
-
export type InternalIpsPolicy =
|
633
|
+
export type Interface = z.infer<typeof interfaceEntity.schema>
|
634
|
+
export type InternalIpsPolicy = z.infer<typeof internalIpsPolicySchema>
|
636
635
|
|
637
|
-
export type MonitorWorkerParams =
|
638
|
-
export type MonitorWorkerResourceGroup =
|
636
|
+
export type MonitorWorkerParams = z.infer<typeof monitorWorkerParamsSchema>
|
637
|
+
export type MonitorWorkerResourceGroup = z.infer<typeof monitorWorkerResourceGroupSchema>
|
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,12 +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
13
|
*/
|
14
|
-
includeDns:
|
14
|
+
includeDns: z.boolean().default(true),
|
15
15
|
},
|
16
16
|
|
17
17
|
inputs: {
|
@@ -36,9 +36,9 @@ export const peer = defineUnit({
|
|
36
36
|
},
|
37
37
|
|
38
38
|
meta: {
|
39
|
-
|
39
|
+
title: "Mullvad Peer",
|
40
40
|
description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
|
41
|
-
|
41
|
+
icon: "simple-icons:mullvad",
|
42
42
|
secondaryIcon: "cib:wireguard",
|
43
43
|
secondaryIconColor: "#88171a",
|
44
44
|
category: "VPN",
|