@highstate/library 0.7.1 → 0.7.3

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/index.mjs DELETED
@@ -1,1725 +0,0 @@
1
- import { Type, defineEntity, defineUnit, text, defineComponent } from '@highstate/contract';
2
- import IPCIDR from 'ip-cidr';
3
-
4
- const keyTypeSchema = Type.Union([
5
- //
6
- Type.Literal("rsa"),
7
- Type.Literal("ed25519")
8
- ]);
9
- const keyPairEntity = defineEntity({
10
- type: "ssh.key-pair",
11
- schema: Type.Object({
12
- type: keyTypeSchema,
13
- privateKey: Type.String(),
14
- publicKey: Type.String()
15
- }),
16
- meta: {
17
- color: "#2b5797"
18
- }
19
- });
20
- const credentialsSchema = Type.Object({
21
- endpoint: Type.Optional(Type.String()),
22
- user: Type.Optional(Type.String()),
23
- port: Type.Optional(Type.Number()),
24
- password: Type.Optional(Type.String()),
25
- privateKey: Type.Optional(Type.String())
26
- });
27
- const keyPair = defineUnit({
28
- type: "ssh.key-pair",
29
- secrets: {
30
- privateKey: Type.Optional(Type.String())
31
- },
32
- outputs: {
33
- keyPair: keyPairEntity
34
- },
35
- meta: {
36
- displayName: "SSH Key Pair",
37
- description: "Holds the ED25519 SSH key pair and generates the private key if not provided.",
38
- category: "ssh",
39
- primaryIcon: "charm:key",
40
- primaryIconColor: "#ffffff",
41
- secondaryIcon: "mdi:lock",
42
- secondaryIconColor: "#ffffff"
43
- },
44
- source: {
45
- type: "npm",
46
- package: "@highstate/common",
47
- path: "ssh/key-pair"
48
- }
49
- });
50
-
51
- var ssh = /*#__PURE__*/Object.freeze({
52
- __proto__: null,
53
- credentialsSchema: credentialsSchema,
54
- keyPair: keyPair,
55
- keyPairEntity: keyPairEntity,
56
- keyTypeSchema: keyTypeSchema
57
- });
58
-
59
- const serverEntity = defineEntity({
60
- type: "common.server",
61
- schema: Type.Object({
62
- endpoint: Type.String(),
63
- hostname: Type.String(),
64
- sshCredentials: Type.Optional(credentialsSchema)
65
- }),
66
- meta: {
67
- color: "#009688"
68
- }
69
- });
70
- const interfaceEntity = defineEntity({
71
- type: "common.interface",
72
- schema: Type.Object({
73
- interface: Type.String()
74
- }),
75
- meta: {
76
- color: "#2196F3",
77
- description: "The interface in a network space of the kernel which can accept or transmit packets."
78
- }
79
- });
80
- const endpointEntity = defineEntity({
81
- type: "common.endpoint",
82
- schema: Type.Object({
83
- endpoint: Type.String()
84
- }),
85
- meta: {
86
- color: "#FFC107",
87
- description: "The L3-L4 endpoint for some network service."
88
- }
89
- });
90
- const dnsProviderEntity = defineEntity({
91
- type: "common.dns-provider",
92
- schema: Type.Object({
93
- name: Type.String(),
94
- type: Type.String(),
95
- data: Type.Record(Type.String(), Type.Unknown()),
96
- domain: Type.String()
97
- }),
98
- meta: {
99
- color: "#FF5722"
100
- }
101
- });
102
- const existingServer = defineUnit({
103
- type: "common.existing-server",
104
- args: {
105
- endpoint: Type.String(),
106
- sshUser: Type.Optional(Type.String({ default: "root" })),
107
- sshPort: Type.Optional(Type.Number({ default: 22 }))
108
- },
109
- secrets: {
110
- sshPassword: Type.Optional(Type.String()),
111
- sshPrivateKey: Type.Optional(Type.String())
112
- },
113
- inputs: {
114
- sshKeyPair: {
115
- entity: keyPairEntity,
116
- required: false
117
- }
118
- },
119
- outputs: {
120
- server: serverEntity
121
- },
122
- meta: {
123
- displayName: "Existing Server",
124
- description: "An existing server that can be used in the configuration.",
125
- primaryIcon: "mdi:server",
126
- defaultNamePrefix: "server"
127
- },
128
- source: {
129
- type: "npm",
130
- package: "@highstate/common",
131
- path: "existing-server"
132
- }
133
- });
134
-
135
- var common = /*#__PURE__*/Object.freeze({
136
- __proto__: null,
137
- dnsProviderEntity: dnsProviderEntity,
138
- endpointEntity: endpointEntity,
139
- existingServer: existingServer,
140
- interfaceEntity: interfaceEntity,
141
- serverEntity: serverEntity
142
- });
143
-
144
- const clusterEntity$2 = defineEntity({
145
- type: "proxmox.cluster",
146
- schema: Type.Object({
147
- endpoint: Type.String(),
148
- insecure: Type.Optional(Type.Boolean()),
149
- username: Type.Optional(Type.String()),
150
- defaultNodeName: Type.String(),
151
- defaultDatastoreId: Type.String(),
152
- password: Type.Optional(Type.String()),
153
- apiToken: Type.Optional(Type.String())
154
- }),
155
- meta: {
156
- color: "#e56901"
157
- }
158
- });
159
- const imageEntity = defineEntity({
160
- type: "proxmox.image",
161
- schema: Type.Object({
162
- id: Type.String()
163
- }),
164
- meta: {
165
- color: "#e56901"
166
- }
167
- });
168
- const connection$1 = defineUnit({
169
- type: "proxmox.connection",
170
- args: {
171
- endpoint: Type.String(),
172
- insecure: Type.Optional(Type.Boolean()),
173
- username: Type.Optional(Type.String()),
174
- defaultNodeName: Type.Optional(Type.String()),
175
- defaultDatastoreId: Type.Optional(Type.String())
176
- },
177
- secrets: {
178
- password: Type.Optional(Type.String()),
179
- apiToken: Type.Optional(Type.String())
180
- },
181
- outputs: {
182
- proxmoxCluster: clusterEntity$2
183
- },
184
- meta: {
185
- displayName: "Proxmox Connection",
186
- description: "The connection to an existing Proxmox cluster.",
187
- category: "Proxmox",
188
- primaryIcon: "simple-icons:proxmox",
189
- primaryIconColor: "#e56901",
190
- secondaryIcon: "codicon:vm"
191
- },
192
- source: {
193
- type: "npm",
194
- package: "@highstate/proxmox",
195
- path: "connection"
196
- }
197
- });
198
- const image = defineUnit({
199
- type: "proxmox.image",
200
- args: {
201
- url: Type.String(),
202
- nodeName: Type.Optional(Type.String()),
203
- sha256: Type.Optional(Type.String()),
204
- datastoreId: Type.Optional(Type.String())
205
- },
206
- inputs: {
207
- proxmoxCluster: clusterEntity$2
208
- },
209
- outputs: {
210
- image: imageEntity
211
- },
212
- meta: {
213
- displayName: "Proxmox Image",
214
- description: "The image to upload to a Proxmox cluster.",
215
- category: "Proxmox",
216
- primaryIcon: "simple-icons:proxmox",
217
- primaryIconColor: "#e56901",
218
- secondaryIcon: "mage:compact-disk-fill"
219
- },
220
- source: {
221
- type: "npm",
222
- package: "@highstate/proxmox",
223
- path: "image"
224
- }
225
- });
226
- const existingImage = defineUnit({
227
- type: "proxmox.existing-image",
228
- args: {
229
- id: Type.String()
230
- },
231
- outputs: {
232
- image: imageEntity
233
- },
234
- meta: {
235
- displayName: "Proxmox Existing Image",
236
- description: "The existing image on a Proxmox cluster.",
237
- category: "Proxmox",
238
- primaryIcon: "simple-icons:proxmox",
239
- primaryIconColor: "#e56901",
240
- secondaryIcon: "mage:compact-disk-fill"
241
- },
242
- source: {
243
- type: "npm",
244
- package: "@highstate/proxmox",
245
- path: "existing-image"
246
- }
247
- });
248
- const virtualMachine = defineUnit({
249
- type: "proxmox.virtual-machine",
250
- args: {
251
- nodeName: Type.Optional(Type.String()),
252
- cpuType: Type.Optional(Type.String({ default: "host" })),
253
- cores: Type.Optional(Type.Number({ default: 1 })),
254
- sockets: Type.Optional(Type.Number({ default: 1 })),
255
- memory: Type.Optional(Type.Number({ default: 512 })),
256
- ipv4: Type.Optional(Type.String()),
257
- ipv4Gateway: Type.Optional(Type.String()),
258
- dns: Type.Optional(Type.Array(Type.String())),
259
- datastoreId: Type.Optional(Type.String()),
260
- diskSize: Type.Optional(Type.Number({ default: 8 })),
261
- bridge: Type.Optional(Type.String({ default: "vmbr0" })),
262
- sshPort: Type.Optional(Type.Number({ default: 22 })),
263
- sshUser: Type.Optional(Type.String({ default: "root" })),
264
- waitForAgent: Type.Optional(Type.Boolean({ default: true }))
265
- },
266
- inputs: {
267
- proxmoxCluster: clusterEntity$2,
268
- image: imageEntity,
269
- sshKeyPair: {
270
- entity: keyPairEntity,
271
- required: false
272
- }
273
- },
274
- secrets: {
275
- sshPassword: Type.Optional(Type.String())
276
- },
277
- outputs: {
278
- server: serverEntity
279
- },
280
- meta: {
281
- displayName: "Proxmox Virtual Machine",
282
- description: "The virtual machine on a Proxmox cluster.",
283
- category: "Proxmox",
284
- primaryIcon: "simple-icons:proxmox",
285
- primaryIconColor: "#e56901",
286
- secondaryIcon: "codicon:vm"
287
- },
288
- source: {
289
- type: "npm",
290
- package: "@highstate/proxmox",
291
- path: "virtual-machine"
292
- }
293
- });
294
-
295
- var proxmox = /*#__PURE__*/Object.freeze({
296
- __proto__: null,
297
- clusterEntity: clusterEntity$2,
298
- connection: connection$1,
299
- existingImage: existingImage,
300
- image: image,
301
- imageEntity: imageEntity,
302
- virtualMachine: virtualMachine
303
- });
304
-
305
- const clusterInfoSchema = Type.Object({
306
- id: Type.String(),
307
- name: Type.String(),
308
- cni: Type.Optional(Type.String())
309
- });
310
- const serviceTypeSchema = Type.Union([
311
- Type.Literal("NodePort"),
312
- Type.Literal("LoadBalancer"),
313
- Type.Literal("ClusterIP")
314
- ]);
315
- const metadataSchema = Type.Object({
316
- namespace: Type.Optional(Type.String()),
317
- name: Type.String(),
318
- labels: Type.Optional(Type.Record(Type.String(), Type.String())),
319
- annotations: Type.Optional(Type.Record(Type.String(), Type.String()))
320
- });
321
- const servicePortSchema = Type.Object({
322
- name: Type.Optional(Type.String()),
323
- port: Type.Optional(Type.Number()),
324
- targetPort: Type.Optional(Type.Union([Type.Number(), Type.String()])),
325
- protocol: Type.Optional(Type.String())
326
- });
327
- const serviceSpecSchema = Type.Object({
328
- type: Type.Optional(Type.String()),
329
- selector: Type.Record(Type.String(), Type.String()),
330
- ports: Type.Array(servicePortSchema),
331
- clusterIP: Type.Optional(Type.String()),
332
- clusterIPs: Type.Optional(Type.Array(Type.String())),
333
- externalIPs: Type.Optional(Type.Array(Type.String()))
334
- });
335
- const serviceEntity = defineEntity({
336
- type: "k8s.service",
337
- schema: Type.Object({
338
- type: Type.Literal("k8s.service"),
339
- clusterInfo: clusterInfoSchema,
340
- metadata: metadataSchema,
341
- spec: serviceSpecSchema
342
- }),
343
- meta: {
344
- color: "#2196F3"
345
- }
346
- });
347
- const clusterEntity$1 = defineEntity({
348
- type: "k8s.cluster",
349
- schema: Type.Object({
350
- info: clusterInfoSchema,
351
- kubeconfig: Type.String()
352
- }),
353
- meta: {
354
- color: "#2196F3"
355
- }
356
- });
357
- const existingCluster = defineUnit({
358
- type: "k8s.existing-cluster",
359
- secrets: {
360
- kubeconfig: Type.Record(Type.String(), Type.Any())
361
- },
362
- outputs: {
363
- cluster: clusterEntity$1
364
- },
365
- meta: {
366
- displayName: "Existing Cluster",
367
- description: "An existing Kubernetes cluster.",
368
- primaryIcon: "mdi:kubernetes"
369
- },
370
- source: {
371
- type: "npm",
372
- package: "@highstate/k8s",
373
- path: "existing-cluster"
374
- }
375
- });
376
- const gatewayEntity = defineEntity({
377
- type: "k8s.gateway",
378
- schema: Type.Object({
379
- clusterInfo: clusterInfoSchema,
380
- gatewayClassName: Type.String(),
381
- httpListenerPort: Type.Number(),
382
- httpsListenerPort: Type.Number(),
383
- ip: Type.String(),
384
- service: Type.Optional(serviceEntity.schema)
385
- }),
386
- meta: {
387
- color: "#4CAF50"
388
- }
389
- });
390
- const tlsIssuerEntity = defineEntity({
391
- type: "k8s.tls-issuer",
392
- schema: Type.Object({
393
- clusterInfo: clusterInfoSchema,
394
- clusterIssuerName: Type.String()
395
- }),
396
- meta: {
397
- color: "#f06292"
398
- }
399
- });
400
- const accessPointEntity = defineEntity({
401
- type: "common.access-point",
402
- schema: Type.Object({
403
- gateway: gatewayEntity.schema,
404
- tlsIssuer: tlsIssuerEntity.schema,
405
- dnsProvider: dnsProviderEntity.schema
406
- }),
407
- meta: {
408
- color: "#FFC107"
409
- }
410
- });
411
- const accessPoint = defineUnit({
412
- type: "k8s.access-point",
413
- inputs: {
414
- gateway: gatewayEntity,
415
- tlsIssuer: tlsIssuerEntity,
416
- dnsProvider: dnsProviderEntity
417
- },
418
- outputs: {
419
- accessPoint: accessPointEntity
420
- },
421
- meta: {
422
- displayName: "Access Point",
423
- description: "An access point which can be used to connect to services.",
424
- primaryIcon: "mdi:access-point"
425
- },
426
- source: {
427
- type: "npm",
428
- package: "@highstate/k8s",
429
- path: "access-point"
430
- }
431
- });
432
- const certManager = defineUnit({
433
- type: "k8s.cert-manager",
434
- inputs: {
435
- k8sCluster: clusterEntity$1
436
- },
437
- outputs: {
438
- k8sCluster: clusterEntity$1
439
- },
440
- meta: {
441
- displayName: "Cert Manager",
442
- description: "A certificate manager for managing TLS certificates.",
443
- primaryIcon: "simple-icons:letsencrypt"
444
- },
445
- source: {
446
- type: "npm",
447
- package: "@highstate/k8s",
448
- path: "cert-manager"
449
- }
450
- });
451
- const dns01TlsIssuer = defineUnit({
452
- type: "k8s.dns01-issuer",
453
- inputs: {
454
- k8sCluster: clusterEntity$1,
455
- dnsProvider: dnsProviderEntity
456
- },
457
- outputs: {
458
- tlsIssuer: tlsIssuerEntity
459
- },
460
- meta: {
461
- displayName: "DNS01 Issuer",
462
- description: "A TLS issuer for issuing certificate using DNS01 challenge.",
463
- primaryIcon: "mdi:certificate"
464
- },
465
- source: {
466
- type: "npm",
467
- package: "@highstate/k8s",
468
- path: "dns01-issuer"
469
- }
470
- });
471
- const containerSchema = Type.Object({
472
- name: Type.String(),
473
- image: Type.String()
474
- });
475
- const labelSelectorSchema = Type.Object({
476
- matchLabels: Type.Record(Type.String(), Type.String())
477
- });
478
- const deploymentSpecSchema = Type.Object({
479
- replicas: Type.Number(),
480
- selector: labelSelectorSchema,
481
- template: Type.Object({
482
- metadata: metadataSchema,
483
- spec: Type.Object({
484
- containers: Type.Array(containerSchema)
485
- })
486
- })
487
- });
488
- const deploymentEntity = defineEntity({
489
- type: "k8s.deployment",
490
- schema: Type.Object({
491
- type: Type.Literal("k8s.deployment"),
492
- clusterInfo: clusterInfoSchema,
493
- metadata: metadataSchema,
494
- service: Type.Optional(serviceEntity.schema)
495
- }),
496
- meta: {
497
- color: "#4CAF50"
498
- }
499
- });
500
- const statefulSetEntity = defineEntity({
501
- type: "k8s.stateful-set",
502
- schema: Type.Object({
503
- type: Type.Literal("k8s.stateful-set"),
504
- clusterInfo: clusterInfoSchema,
505
- metadata: metadataSchema,
506
- service: Type.Optional(serviceEntity.schema)
507
- }),
508
- meta: {
509
- color: "#FFC107"
510
- }
511
- });
512
- const persistentVolumeClaimEntity = defineEntity({
513
- type: "k8s.persistent-volume-claim",
514
- schema: Type.Object({
515
- type: Type.Literal("k8s.persistent-volume-claim"),
516
- clusterInfo: clusterInfoSchema,
517
- metadata: metadataSchema
518
- }),
519
- meta: {
520
- color: "#FFC107"
521
- }
522
- });
523
-
524
- var k8s = /*#__PURE__*/Object.freeze({
525
- __proto__: null,
526
- accessPoint: accessPoint,
527
- accessPointEntity: accessPointEntity,
528
- certManager: certManager,
529
- clusterEntity: clusterEntity$1,
530
- clusterInfoSchema: clusterInfoSchema,
531
- containerSchema: containerSchema,
532
- deploymentEntity: deploymentEntity,
533
- deploymentSpecSchema: deploymentSpecSchema,
534
- dns01TlsIssuer: dns01TlsIssuer,
535
- existingCluster: existingCluster,
536
- gatewayEntity: gatewayEntity,
537
- labelSelectorSchema: labelSelectorSchema,
538
- metadataSchema: metadataSchema,
539
- persistentVolumeClaimEntity: persistentVolumeClaimEntity,
540
- serviceEntity: serviceEntity,
541
- servicePortSchema: servicePortSchema,
542
- serviceSpecSchema: serviceSpecSchema,
543
- serviceTypeSchema: serviceTypeSchema,
544
- statefulSetEntity: statefulSetEntity,
545
- tlsIssuerEntity: tlsIssuerEntity
546
- });
547
-
548
- const clusterEntity = defineEntity({
549
- type: "talos.cluster",
550
- schema: Type.Object({
551
- clientConfiguration: Type.String(),
552
- machineSecrets: Type.String()
553
- }),
554
- meta: {
555
- color: "#2d2d2d"
556
- }
557
- });
558
- const cniSchema = Type.Union([
559
- Type.Literal("cilium"),
560
- Type.Literal("flannel"),
561
- Type.Literal("none")
562
- ]);
563
- const csiSchema = Type.Union([Type.Literal("local-path-provisioner"), Type.Literal("none")]);
564
- const cluster$1 = defineUnit({
565
- type: "talos.cluster",
566
- args: {
567
- scheduleOnMasters: {
568
- schema: Type.Optional(Type.Boolean()),
569
- description: text`
570
- Allow scheduling workloads on the master nodes.
571
- By default, "true" if no worker nodes are provided.
572
- `
573
- },
574
- endpoint: {
575
- schema: Type.Optional(Type.String()),
576
- description: text`
577
- The endpoint of the cluster.
578
- By default, the first master node's endpoint is used.
579
- `
580
- },
581
- clusterName: {
582
- schema: Type.Optional(Type.String()),
583
- description: text`
584
- The name of the cluster.
585
- By default, the name of the instance is used.
586
- `
587
- },
588
- cni: {
589
- schema: Type.Optional({ ...cniSchema, default: "cilium" }),
590
- description: text`
591
- The CNI plugin to use.
592
-
593
- The following options are available:
594
- - "cilium" (default)
595
- - "flannel" (built-in in Talos)
596
- - "none" (disable CNI, must be installed manually)
597
-
598
- The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.
599
- `
600
- },
601
- csi: {
602
- schema: Type.Optional({ ...csiSchema, default: "local-path-provisioner" }),
603
- description: text`
604
- The CSI plugin to use.
605
-
606
- The following options are available:
607
- - "local-path-provisioner" (default)
608
- - "none" (disable CSI, must be installed manually if needed)
609
- `
610
- },
611
- sharedConfigPatch: {
612
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
613
- description: text`
614
- The shared configuration patch.
615
- It will be applied to all nodes.
616
- `
617
- },
618
- masterConfigPatch: {
619
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
620
- description: text`
621
- The master configuration patch.
622
- It will be applied to all master nodes.
623
- `
624
- },
625
- workerConfigPatch: {
626
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
627
- description: text`
628
- The worker configuration patch.
629
- It will be applied to all worker nodes.
630
- `
631
- }
632
- },
633
- inputs: {
634
- masters: {
635
- entity: serverEntity,
636
- multiple: true
637
- },
638
- workers: {
639
- entity: serverEntity,
640
- multiple: true,
641
- required: false
642
- }
643
- },
644
- outputs: {
645
- k8sCluster: clusterEntity$1,
646
- talosCluster: clusterEntity
647
- },
648
- meta: {
649
- displayName: "Talos Cluster",
650
- description: "A Kubernetes cluster managed by Talos.",
651
- category: "Talos",
652
- color: "#2d2d2d",
653
- primaryIcon: "simple-icons:talos",
654
- secondaryIcon: "devicon:kubernetes"
655
- },
656
- source: {
657
- type: "npm",
658
- package: "@highstate/talos",
659
- path: "cluster"
660
- }
661
- });
662
-
663
- var talos = /*#__PURE__*/Object.freeze({
664
- __proto__: null,
665
- cluster: cluster$1,
666
- clusterEntity: clusterEntity,
667
- cniSchema: cniSchema,
668
- csiSchema: csiSchema
669
- });
670
-
671
- const backendSchema = Type.Union([
672
- //
673
- Type.Literal("wireguard"),
674
- Type.Literal("amneziawg")
675
- ]);
676
- const presharedKeyModeSchema = Type.Union([
677
- Type.Literal("none"),
678
- Type.Literal("global"),
679
- Type.Literal("secure")
680
- ]);
681
- const networkEntity = defineEntity({
682
- type: "wireguard.network",
683
- schema: Type.Object({
684
- backend: Type.Optional(backendSchema),
685
- presharedKeyMode: presharedKeyModeSchema,
686
- globalPresharedKey: Type.Optional(Type.String())
687
- })
688
- });
689
- const identityEntity = defineEntity({
690
- type: "wireguard.identity",
691
- schema: Type.Object({
692
- name: Type.String(),
693
- network: Type.Optional(networkEntity.schema),
694
- address: Type.Optional(Type.String()),
695
- privateKey: Type.String(),
696
- presharedKeyPart: Type.Optional(Type.String()),
697
- k8sServices: Type.Array(serviceEntity.schema),
698
- exitNode: Type.Boolean(),
699
- listenPort: Type.Optional(Type.Number()),
700
- externalIp: Type.Optional(Type.String()),
701
- endpoint: Type.Optional(Type.String())
702
- }),
703
- meta: {
704
- color: "#F44336"
705
- }
706
- });
707
- const peerEntity = defineEntity({
708
- type: "wireguard.peer",
709
- schema: Type.Object({
710
- name: Type.String(),
711
- network: Type.Optional(networkEntity.schema),
712
- publicKey: Type.String(),
713
- address: Type.Optional(Type.String()),
714
- allowedIps: Type.Array(Type.String()),
715
- endpoint: Type.Optional(Type.String()),
716
- presharedKeyPart: Type.Optional(Type.String())
717
- }),
718
- meta: {
719
- color: "#673AB7"
720
- }
721
- });
722
- const k8sNodeEntity = defineEntity({
723
- type: "wireguard.node",
724
- schema: Type.Object({
725
- network: Type.String(),
726
- address: Type.String(),
727
- endpoint: Type.Optional(Type.String()),
728
- peers: Type.Array(Type.String())
729
- })
730
- });
731
- const network = defineUnit({
732
- type: "wireguard.network",
733
- args: {
734
- /**
735
- * The backend to use for the WireGuard network.
736
- *
737
- * Possible values are:
738
- * 1. `wireguard` - The default backend.
739
- * 2. `amneziawg` - The censorship-resistant fork of WireGuard.
740
- *
741
- * By default, the `wireguard` backend is used.
742
- */
743
- backend: backendSchema,
744
- /**
745
- * The option which defines how to handle pre-shared keys between peers.
746
- *
747
- * 1. `none` - No pre-shared keys will be used.
748
- * 2. `global` - A single pre-shared key will be used for all peer pairs in the network.
749
- * 3. `secure` - Each peer pair will have its own pre-shared key.
750
- * In this case, each identity generates `presharedKeyPart` and the actual pre-shared key
751
- * for each peer pair will be computed as `xor(peer1.presharedKeyPart, peer2.presharedKeyPart)`.
752
- *
753
- * If the whole network is managed by the HighState, the `secure` mode is recommended.
754
- *
755
- * By default, the `none` mode is used.
756
- */
757
- presharedKeyMode: Type.Optional(presharedKeyModeSchema)
758
- },
759
- secrets: {
760
- /**
761
- * The global pre-shared key to use for all peer pairs in the network.
762
- *
763
- * Will be used only if `presharedKeyMode` is set to `global`.
764
- * Will be generated automatically if not provided.
765
- */
766
- globalPresharedKey: Type.Optional(Type.String())
767
- },
768
- outputs: {
769
- network: networkEntity
770
- },
771
- meta: {
772
- description: "The WireGuard network with some shared configuration.",
773
- primaryIcon: "simple-icons:wireguard",
774
- primaryIconColor: "#88171a",
775
- secondaryIcon: "mdi:local-area-network-connect"
776
- },
777
- source: {
778
- type: "npm",
779
- package: "@highstate/wireguard",
780
- path: "network"
781
- }
782
- });
783
- const identity = defineUnit({
784
- type: "wireguard.identity",
785
- args: {
786
- /**
787
- * The name of the WireGuard identity.
788
- *
789
- * If not provided, the identity will be named after the unit.
790
- */
791
- peerName: Type.Optional(Type.String()),
792
- /**
793
- * The address of the WireGuard interface.
794
- *
795
- * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
796
- */
797
- address: Type.Optional(Type.String()),
798
- /**
799
- * The list of allowed IPs for the peer.
800
- *
801
- * Does not affect node which implements the identity, but is used in the peer configuration of other nodes.
802
- *
803
- * If not provided, the `address` will be used.
804
- */
805
- allowedIps: Type.Optional(Type.Array(Type.String())),
806
- /**
807
- * Whether the node should be used as an exit node.
808
- *
809
- * Just an alias for the `allowedIps` with the value of `0.0.0.0/0, ::/0`.
810
- */
811
- exitNode: Type.Optional(Type.Boolean()),
812
- /**
813
- * The port to listen on.
814
- *
815
- * Used by the implementation of the identity and to calculate the endpoint of the peer.
816
- */
817
- listenPort: Type.Optional(Type.Number()),
818
- /**
819
- * The external IP address of the WireGuard identity.
820
- *
821
- * Used by the implementation of the identity and to calculate the endpoint of the peer.
822
- */
823
- externalIp: Type.Optional(Type.String()),
824
- /**
825
- * The endpoint of the WireGuard peer.
826
- *
827
- * By default, the endpoint is calculated as `externalIp:listenPort`.
828
- *
829
- * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
830
- */
831
- endpoint: Type.Optional(Type.String())
832
- },
833
- secrets: {
834
- /**
835
- * The private key of the WireGuard identity.
836
- *
837
- * If not provided, the key will be generated automatically.
838
- */
839
- privateKey: Type.Optional(Type.String()),
840
- /**
841
- * The part of the pre-shared of the WireGuard identity.
842
- *
843
- * Will be generated automatically if not provided.
844
- */
845
- presharedKeyPart: Type.Optional(Type.String())
846
- },
847
- inputs: {
848
- /**
849
- * The network to use for the WireGuard identity.
850
- *
851
- * If not provided, the identity will use default network configuration.
852
- */
853
- network: {
854
- entity: networkEntity,
855
- required: false
856
- },
857
- /**
858
- * The list of Kubernetes services to expose the WireGuard identity.
859
- *
860
- * Their IP addresses will be added to the `allowedIps` of the identity and passed to the node to set up network policies.
861
- */
862
- k8sServices: {
863
- entity: serviceEntity,
864
- multiple: true,
865
- required: false
866
- }
867
- },
868
- outputs: {
869
- identity: identityEntity,
870
- peer: peerEntity
871
- },
872
- meta: {
873
- description: "The WireGuard identity with the public key.",
874
- primaryIcon: "simple-icons:wireguard",
875
- primaryIconColor: "#88171a",
876
- secondaryIcon: "mdi:account"
877
- },
878
- source: {
879
- type: "npm",
880
- package: "@highstate/wireguard",
881
- path: "identity"
882
- }
883
- });
884
- const peer$1 = defineUnit({
885
- type: "wireguard.peer",
886
- args: {
887
- /**
888
- * The name of the WireGuard peer.
889
- *
890
- * If not provided, the peer will be named after the unit.
891
- */
892
- peerName: Type.Optional(Type.String()),
893
- /**
894
- * The address of the WireGuard interface.
895
- *
896
- * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
897
- */
898
- address: Type.Optional(Type.String()),
899
- /**
900
- * The list of allowed IPs for the peer.
901
- *
902
- * Does not affect node which implements the peer, but is used in the peer configuration of other nodes.
903
- */
904
- allowedIps: Type.Optional(Type.Array(Type.String())),
905
- /**
906
- * The endpoint of the WireGuard peer.
907
- *
908
- * By default, the endpoint is calculated as `externalIp:listenPort`.
909
- *
910
- * If overridden, does not affect node which implements the peer, but is used in the peer configuration of other nodes.
911
- */
912
- endpoint: Type.Optional(Type.String()),
913
- /**
914
- * The public key of the WireGuard peer.
915
- */
916
- publicKey: Type.String()
917
- },
918
- inputs: {
919
- /**
920
- * The network to use for the WireGuard peer.
921
- *
922
- * If not provided, the peer will use default network configuration.
923
- */
924
- network: {
925
- entity: networkEntity,
926
- required: false
927
- }
928
- },
929
- outputs: {
930
- peer: peerEntity
931
- },
932
- meta: {
933
- description: "The WireGuard peer with the public key.",
934
- primaryIcon: "simple-icons:wireguard",
935
- primaryIconColor: "#88171a",
936
- secondaryIcon: "mdi:badge-account-horizontal"
937
- },
938
- source: {
939
- type: "npm",
940
- package: "@highstate/wireguard",
941
- path: "peer"
942
- }
943
- });
944
- const node = defineUnit({
945
- type: "wireguard.node",
946
- args: {
947
- appName: Type.Optional(Type.String()),
948
- serviceType: Type.Optional(serviceTypeSchema),
949
- prototype: Type.Optional(Type.Boolean()),
950
- dns: Type.Optional(Type.Array(Type.String()))
951
- },
952
- inputs: {
953
- identity: identityEntity,
954
- k8sCluster: clusterEntity$1,
955
- deployment: {
956
- entity: deploymentEntity,
957
- required: false
958
- },
959
- statefulSet: {
960
- entity: statefulSetEntity,
961
- required: false
962
- },
963
- peers: {
964
- entity: peerEntity,
965
- multiple: true,
966
- required: false
967
- }
968
- },
969
- outputs: {
970
- deployment: {
971
- entity: deploymentEntity,
972
- required: false
973
- },
974
- service: {
975
- entity: serviceEntity,
976
- required: false
977
- }
978
- },
979
- meta: {
980
- description: "The WireGuard node running on the Kubernetes.",
981
- primaryIcon: "simple-icons:wireguard",
982
- primaryIconColor: "#88171a",
983
- secondaryIcon: "mdi:server"
984
- },
985
- source: {
986
- type: "npm",
987
- package: "@highstate/wireguard",
988
- path: "node"
989
- }
990
- });
991
- const config = defineUnit({
992
- type: "wireguard.config",
993
- inputs: {
994
- identity: identityEntity,
995
- peers: {
996
- entity: peerEntity,
997
- multiple: true,
998
- required: false
999
- }
1000
- },
1001
- meta: {
1002
- description: "Just the WireGuard configuration for the identity and peers.",
1003
- primaryIcon: "simple-icons:wireguard",
1004
- primaryIconColor: "#88171a",
1005
- secondaryIcon: "mdi:settings"
1006
- },
1007
- source: {
1008
- type: "npm",
1009
- package: "@highstate/wireguard",
1010
- path: "config"
1011
- }
1012
- });
1013
- const generator = defineComponent({
1014
- type: "wireguard.generator",
1015
- args: {
1016
- clientNames: Type.Array(Type.String()),
1017
- cidr: Type.String()
1018
- },
1019
- inputs: {
1020
- network: networkEntity,
1021
- peer: peerEntity
1022
- },
1023
- outputs: {
1024
- peers: {
1025
- entity: peerEntity,
1026
- multiple: true
1027
- }
1028
- },
1029
- meta: {
1030
- description: "Bulk generate the WireGuard identities and peers.",
1031
- primaryIcon: "simple-icons:wireguard",
1032
- primaryIconColor: "#88171a",
1033
- secondaryIcon: "mdi:accounts"
1034
- },
1035
- create({ name, args, inputs }) {
1036
- const cidr = new IPCIDR(args.cidr);
1037
- const peers = [];
1038
- for (const [index, client] of args.clientNames.entries()) {
1039
- const fullName = `${name}.${client}`;
1040
- const { identity: wgIdentity, peer: wgPeer } = identity({
1041
- name: fullName,
1042
- args: {
1043
- address: cidr.start({ from: index, type: "addressObject" }).address
1044
- },
1045
- inputs: {
1046
- network: inputs.network,
1047
- k8sServices: []
1048
- }
1049
- });
1050
- peers.push(wgPeer);
1051
- config({
1052
- name: fullName,
1053
- inputs: {
1054
- identity: wgIdentity,
1055
- peers: [inputs.peer]
1056
- }
1057
- });
1058
- }
1059
- return { peers };
1060
- }
1061
- });
1062
-
1063
- var wireguard = /*#__PURE__*/Object.freeze({
1064
- __proto__: null,
1065
- backendSchema: backendSchema,
1066
- config: config,
1067
- generator: generator,
1068
- identity: identity,
1069
- identityEntity: identityEntity,
1070
- k8sNodeEntity: k8sNodeEntity,
1071
- network: network,
1072
- networkEntity: networkEntity,
1073
- node: node,
1074
- peer: peer$1,
1075
- peerEntity: peerEntity,
1076
- presharedKeyModeSchema: presharedKeyModeSchema
1077
- });
1078
-
1079
- const repoEntity = defineEntity({
1080
- type: "restic.repo",
1081
- schema: Type.Object({
1082
- password: Type.String(),
1083
- remoteDomains: Type.Array(Type.String()),
1084
- type: Type.Literal("rclone"),
1085
- rcloneConfig: Type.String(),
1086
- remoteName: Type.String(),
1087
- basePath: Type.String()
1088
- }),
1089
- meta: {
1090
- color: "#e56901"
1091
- }
1092
- });
1093
- const repo = defineUnit({
1094
- type: "restic.repo",
1095
- args: {
1096
- remoteDomains: Type.Optional(Type.Array(Type.String())),
1097
- basePath: Type.Optional(Type.String())
1098
- },
1099
- secrets: {
1100
- password: Type.Optional(Type.String()),
1101
- rcloneConfig: Type.String({ multiline: true })
1102
- },
1103
- outputs: {
1104
- repo: repoEntity
1105
- },
1106
- meta: {
1107
- displayName: "Restic Repo",
1108
- description: "Holds the configuration for a Restic repository and its remote storage.",
1109
- primaryIconColor: "#e56901",
1110
- primaryIcon: "material-symbols:backup"
1111
- },
1112
- source: {
1113
- type: "npm",
1114
- package: "@highstate/restic",
1115
- path: "repo"
1116
- }
1117
- });
1118
-
1119
- var restic = /*#__PURE__*/Object.freeze({
1120
- __proto__: null,
1121
- repo: repo,
1122
- repoEntity: repoEntity
1123
- });
1124
-
1125
- const mariadbEntity = defineEntity({
1126
- type: "apps.mariadb",
1127
- schema: Type.Object({
1128
- service: Type.Optional(serviceEntity.schema),
1129
- host: Type.String(),
1130
- port: Type.Number(),
1131
- rootPassword: Type.String()
1132
- }),
1133
- meta: {
1134
- color: "#f06292"
1135
- }
1136
- });
1137
- const mariadb = defineUnit({
1138
- type: "apps.mariadb",
1139
- args: {
1140
- fqdn: Type.Optional(Type.String()),
1141
- appName: Type.Optional(Type.String())
1142
- },
1143
- secrets: {
1144
- rootPassword: Type.Optional(Type.String())
1145
- },
1146
- inputs: {
1147
- k8sCluster: clusterEntity$1,
1148
- resticRepo: {
1149
- entity: repoEntity,
1150
- required: false
1151
- },
1152
- dnsProvider: {
1153
- entity: dnsProviderEntity,
1154
- required: false
1155
- }
1156
- },
1157
- outputs: {
1158
- mariadb: mariadbEntity,
1159
- service: serviceEntity
1160
- },
1161
- meta: {
1162
- displayName: "MariaDB",
1163
- description: "The MariaDB database deployed on Kubernetes.",
1164
- primaryIcon: "simple-icons:mariadb",
1165
- secondaryIcon: "mdi:database"
1166
- },
1167
- source: {
1168
- type: "npm",
1169
- package: "@highstate/apps",
1170
- path: "mariadb/app"
1171
- }
1172
- });
1173
- const mariadbDatabase = defineUnit({
1174
- type: "apps.mariadb.database",
1175
- args: {
1176
- database: Type.Optional(Type.String()),
1177
- username: Type.Optional(Type.String())
1178
- },
1179
- secrets: {
1180
- password: Type.Optional(Type.String())
1181
- },
1182
- inputs: {
1183
- k8sCluster: clusterEntity$1,
1184
- mariadb: mariadbEntity
1185
- },
1186
- meta: {
1187
- displayName: "MariaDB Database",
1188
- description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
1189
- primaryIcon: "simple-icons:mariadb",
1190
- secondaryIcon: "mdi:database-plus"
1191
- },
1192
- source: {
1193
- type: "npm",
1194
- package: "@highstate/apps",
1195
- path: "mariadb/database"
1196
- }
1197
- });
1198
-
1199
- const postgresqlEntity = defineEntity({
1200
- type: "apps.postgresql",
1201
- schema: Type.Object({
1202
- service: Type.Optional(serviceEntity.schema),
1203
- host: Type.String(),
1204
- port: Type.Number(),
1205
- rootPassword: Type.String()
1206
- }),
1207
- meta: {
1208
- color: "#336791"
1209
- }
1210
- });
1211
- const postgresql = defineUnit({
1212
- type: "apps.postgresql",
1213
- args: {
1214
- fqdn: Type.Optional(Type.String()),
1215
- appName: Type.Optional(Type.String())
1216
- },
1217
- secrets: {
1218
- rootPassword: Type.Optional(Type.String())
1219
- },
1220
- inputs: {
1221
- k8sCluster: clusterEntity$1,
1222
- resticRepo: {
1223
- entity: repoEntity,
1224
- required: false
1225
- },
1226
- dnsProvider: {
1227
- entity: dnsProviderEntity,
1228
- required: false
1229
- }
1230
- },
1231
- outputs: {
1232
- postgresql: postgresqlEntity,
1233
- service: serviceEntity
1234
- },
1235
- meta: {
1236
- displayName: "PostgreSQL",
1237
- description: "The PostgreSQL database deployed on Kubernetes.",
1238
- primaryIcon: "simple-icons:postgresql",
1239
- secondaryIcon: "mdi:database"
1240
- },
1241
- source: {
1242
- type: "npm",
1243
- package: "@highstate/apps",
1244
- path: "postgresql/app"
1245
- }
1246
- });
1247
- const postgresqlDatabase = defineUnit({
1248
- type: "apps.postgresql.database",
1249
- args: {
1250
- database: Type.Optional(Type.String()),
1251
- username: Type.Optional(Type.String())
1252
- },
1253
- secrets: {
1254
- password: Type.Optional(Type.String())
1255
- },
1256
- inputs: {
1257
- k8sCluster: clusterEntity$1,
1258
- postgresql: postgresqlEntity
1259
- },
1260
- meta: {
1261
- displayName: "PostgreSQL Database",
1262
- description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
1263
- primaryIcon: "simple-icons:postgresql",
1264
- secondaryIcon: "mdi:database-plus"
1265
- },
1266
- source: {
1267
- type: "npm",
1268
- package: "@highstate/apps",
1269
- path: "postgresql/database"
1270
- }
1271
- });
1272
-
1273
- const vaultwarden = defineUnit({
1274
- type: "apps.vaultwarden",
1275
- args: {
1276
- fqdn: Type.String(),
1277
- appName: Type.Optional(Type.String())
1278
- },
1279
- inputs: {
1280
- mariadb: mariadbEntity,
1281
- accessPoint: accessPointEntity,
1282
- k8sCluster: clusterEntity$1
1283
- },
1284
- secrets: {
1285
- mariadbPassword: Type.Optional(Type.String())
1286
- },
1287
- meta: {
1288
- displayName: "Vaultwarden",
1289
- description: "The Vaultwarden password manager deployed on Kubernetes.",
1290
- primaryIcon: "simple-icons:vaultwarden"
1291
- },
1292
- source: {
1293
- type: "npm",
1294
- package: "@highstate/apps",
1295
- path: "vaultwarden"
1296
- }
1297
- });
1298
-
1299
- const traefikGateway = defineUnit({
1300
- type: "apps.traefik-gateway",
1301
- args: {
1302
- appName: Type.Optional(Type.String()),
1303
- className: Type.Optional(Type.String()),
1304
- serviceType: Type.Optional(serviceTypeSchema)
1305
- },
1306
- inputs: {
1307
- k8sCluster: clusterEntity$1
1308
- },
1309
- outputs: {
1310
- gateway: gatewayEntity,
1311
- service: serviceEntity
1312
- },
1313
- meta: {
1314
- displayName: "Traefik Gateway",
1315
- description: "A Traefik gateway for routing traffic to services.",
1316
- primaryIcon: "simple-icons:traefikproxy"
1317
- },
1318
- source: {
1319
- type: "npm",
1320
- package: "@highstate/apps",
1321
- path: "traefik"
1322
- }
1323
- });
1324
-
1325
- const kubernetesDashboard = defineUnit({
1326
- type: "apps.kubernetes-dashboard",
1327
- args: {
1328
- fqdn: Type.String(),
1329
- appName: Type.Optional(Type.String())
1330
- },
1331
- inputs: {
1332
- k8sCluster: clusterEntity$1,
1333
- accessPoint: accessPointEntity
1334
- },
1335
- meta: {
1336
- displayName: "Kubernetes Dashboard",
1337
- description: "The Kubernetes Dashboard deployed on Kubernetes.",
1338
- primaryIcon: "simple-icons:kubernetes",
1339
- secondaryIcon: "mdi:dashboard"
1340
- },
1341
- source: {
1342
- type: "npm",
1343
- package: "@highstate/apps",
1344
- path: "kubernetes-dashboard"
1345
- }
1346
- });
1347
-
1348
- const grocy = defineUnit({
1349
- type: "apps.grocy",
1350
- args: {
1351
- fqdn: Type.String(),
1352
- appName: Type.Optional(Type.String())
1353
- },
1354
- inputs: {
1355
- resticRepo: {
1356
- entity: repoEntity,
1357
- required: false
1358
- },
1359
- accessPoint: accessPointEntity,
1360
- k8sCluster: clusterEntity$1
1361
- },
1362
- meta: {
1363
- displayName: "Grocy",
1364
- description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
1365
- primaryIcon: "simple-icons:grocy"
1366
- },
1367
- source: {
1368
- type: "npm",
1369
- package: "@highstate/apps",
1370
- path: "grocy"
1371
- }
1372
- });
1373
-
1374
- const maybe = defineUnit({
1375
- type: "apps.maybe",
1376
- args: {
1377
- fqdn: Type.String(),
1378
- appName: Type.Optional(Type.String())
1379
- },
1380
- inputs: {
1381
- postgresql: postgresqlEntity,
1382
- accessPoint: accessPointEntity,
1383
- k8sCluster: clusterEntity$1,
1384
- resticRepo: {
1385
- entity: repoEntity,
1386
- required: false
1387
- }
1388
- },
1389
- secrets: {
1390
- postgresqlPassword: Type.Optional(Type.String()),
1391
- secretKey: Type.Optional(Type.String())
1392
- },
1393
- meta: {
1394
- displayName: "Maybe",
1395
- description: "The OS for your personal finances.",
1396
- primaryIcon: "arcticons:finance-manager"
1397
- },
1398
- source: {
1399
- type: "npm",
1400
- package: "@highstate/apps",
1401
- path: "maybe"
1402
- }
1403
- });
1404
-
1405
- const mongodbEntity = defineEntity({
1406
- type: "apps.mongodb",
1407
- schema: Type.Object({
1408
- service: Type.Optional(serviceEntity.schema),
1409
- host: Type.String(),
1410
- port: Type.Number(),
1411
- rootPassword: Type.String()
1412
- }),
1413
- meta: {
1414
- color: "#13aa52"
1415
- }
1416
- });
1417
- const mongodb = defineUnit({
1418
- type: "apps.mongodb",
1419
- args: {
1420
- fqdn: Type.Optional(Type.String()),
1421
- appName: Type.Optional(Type.String()),
1422
- serviceType: Type.Optional(serviceTypeSchema)
1423
- },
1424
- secrets: {
1425
- rootPassword: Type.Optional(Type.String())
1426
- },
1427
- inputs: {
1428
- k8sCluster: clusterEntity$1,
1429
- resticRepo: {
1430
- entity: repoEntity,
1431
- required: false
1432
- },
1433
- dnsProvider: {
1434
- entity: dnsProviderEntity,
1435
- required: false
1436
- }
1437
- },
1438
- outputs: {
1439
- mongodb: mongodbEntity,
1440
- service: serviceEntity
1441
- },
1442
- meta: {
1443
- displayName: "MongoDB",
1444
- description: "The MongoDB instance deployed on Kubernetes.",
1445
- primaryIcon: "simple-icons:mongodb",
1446
- secondaryIcon: "mdi:database"
1447
- },
1448
- source: {
1449
- type: "npm",
1450
- package: "@highstate/apps",
1451
- path: "mongodb/app"
1452
- }
1453
- });
1454
- const mongodbDatabase = defineUnit({
1455
- type: "apps.mongodb.database",
1456
- args: {
1457
- database: Type.Optional(Type.String()),
1458
- username: Type.Optional(Type.String())
1459
- },
1460
- secrets: {
1461
- password: Type.Optional(Type.String())
1462
- },
1463
- inputs: {
1464
- k8sCluster: clusterEntity$1,
1465
- mongodb: mongodbEntity
1466
- },
1467
- meta: {
1468
- displayName: "MongoDB Database",
1469
- description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
1470
- primaryIcon: "simple-icons:mongodb",
1471
- secondaryIcon: "mdi:database-plus"
1472
- },
1473
- source: {
1474
- type: "npm",
1475
- package: "@highstate/apps",
1476
- path: "mongodb/database"
1477
- }
1478
- });
1479
-
1480
- const deployment = defineUnit({
1481
- type: "apps.deployment",
1482
- args: {
1483
- appName: Type.Optional(Type.String()),
1484
- fqdn: Type.Optional(Type.String()),
1485
- serviceType: Type.Optional(serviceTypeSchema),
1486
- image: Type.Optional(Type.String()),
1487
- port: Type.Optional(Type.Number()),
1488
- replicas: Type.Optional(Type.Number()),
1489
- dataPath: Type.Optional(Type.String()),
1490
- env: Type.Optional(Type.Record(Type.String(), Type.Any())),
1491
- mariadbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1492
- postgresqlEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1493
- mongodbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1494
- manifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
1495
- serviceManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
1496
- httpRouteManifest: Type.Optional(Type.Record(Type.String(), Type.Any()))
1497
- },
1498
- inputs: {
1499
- k8sCluster: clusterEntity$1,
1500
- mariadb: {
1501
- entity: mariadbEntity,
1502
- required: false
1503
- },
1504
- postgresql: {
1505
- entity: postgresqlEntity,
1506
- required: false
1507
- },
1508
- mongodb: {
1509
- entity: mongodbEntity,
1510
- required: false
1511
- },
1512
- resticRepo: {
1513
- entity: repoEntity,
1514
- required: false
1515
- },
1516
- dnsProvider: {
1517
- entity: dnsProviderEntity,
1518
- required: false
1519
- }
1520
- },
1521
- outputs: {
1522
- deployment: deploymentEntity,
1523
- service: serviceEntity
1524
- },
1525
- secrets: {
1526
- mariadbPassword: Type.Optional(Type.String()),
1527
- postgresqlPassword: Type.Optional(Type.String()),
1528
- mongodbPassword: Type.Optional(Type.String())
1529
- },
1530
- meta: {
1531
- displayName: "Kubernetes Deployment",
1532
- description: "A generic Kubernetes deployment with optional service and gateway routes.",
1533
- primaryIcon: "mdi:kubernetes",
1534
- secondaryIcon: "mdi:cube-outline"
1535
- },
1536
- source: {
1537
- type: "npm",
1538
- package: "@highstate/apps"
1539
- }
1540
- });
1541
-
1542
- const backupModeSchema = Type.Union([Type.Literal("metadata"), Type.Literal("full")]);
1543
- const syncthing = defineUnit({
1544
- type: "apps.syncthing",
1545
- args: {
1546
- fqdn: Type.String(),
1547
- deviceFqdn: Type.Optional(Type.String()),
1548
- appName: Type.Optional(Type.String()),
1549
- backupMode: Type.Optional({ ...backupModeSchema, default: "metadata" })
1550
- },
1551
- inputs: {
1552
- accessPoint: accessPointEntity,
1553
- k8sCluster: clusterEntity$1,
1554
- resticRepo: {
1555
- entity: repoEntity,
1556
- required: false
1557
- },
1558
- volume: {
1559
- entity: persistentVolumeClaimEntity,
1560
- required: false
1561
- }
1562
- },
1563
- outputs: {
1564
- service: serviceEntity,
1565
- volume: persistentVolumeClaimEntity
1566
- },
1567
- meta: {
1568
- displayName: "Syncthing",
1569
- description: "The Syncthing instance deployed on Kubernetes.",
1570
- primaryIcon: "simple-icons:syncthing"
1571
- },
1572
- source: {
1573
- type: "npm",
1574
- package: "@highstate/apps",
1575
- path: "syncthing"
1576
- }
1577
- });
1578
-
1579
- const codeServer = defineUnit({
1580
- type: "apps.code-server",
1581
- args: {
1582
- fqdn: Type.String(),
1583
- appName: Type.Optional(Type.String())
1584
- },
1585
- secrets: {
1586
- password: Type.Optional(Type.String()),
1587
- sudoPassword: Type.Optional(Type.String())
1588
- },
1589
- inputs: {
1590
- accessPoint: accessPointEntity,
1591
- k8sCluster: clusterEntity$1,
1592
- resticRepo: {
1593
- entity: repoEntity,
1594
- required: false
1595
- },
1596
- volume: {
1597
- entity: persistentVolumeClaimEntity,
1598
- required: false
1599
- }
1600
- },
1601
- outputs: {
1602
- statefulSet: statefulSetEntity,
1603
- volume: persistentVolumeClaimEntity
1604
- },
1605
- meta: {
1606
- displayName: "Code Server",
1607
- description: "The Code Server instance deployed on Kubernetes.",
1608
- primaryIcon: "material-icon-theme:vscode"
1609
- },
1610
- source: {
1611
- type: "npm",
1612
- package: "@highstate/apps",
1613
- path: "code-server"
1614
- }
1615
- });
1616
-
1617
- var index = /*#__PURE__*/Object.freeze({
1618
- __proto__: null,
1619
- backupModeSchema: backupModeSchema,
1620
- codeServer: codeServer,
1621
- deployment: deployment,
1622
- grocy: grocy,
1623
- kubernetesDashboard: kubernetesDashboard,
1624
- mariadb: mariadb,
1625
- mariadbDatabase: mariadbDatabase,
1626
- mariadbEntity: mariadbEntity,
1627
- maybe: maybe,
1628
- mongodb: mongodb,
1629
- mongodbDatabase: mongodbDatabase,
1630
- mongodbEntity: mongodbEntity,
1631
- postgresql: postgresql,
1632
- postgresqlDatabase: postgresqlDatabase,
1633
- postgresqlEntity: postgresqlEntity,
1634
- syncthing: syncthing,
1635
- traefikGateway: traefikGateway,
1636
- vaultwarden: vaultwarden
1637
- });
1638
-
1639
- const connection = defineUnit({
1640
- type: "cloudflare.connection",
1641
- secrets: {
1642
- apiToken: Type.String()
1643
- },
1644
- outputs: {
1645
- dnsProvider: dnsProviderEntity
1646
- },
1647
- meta: {
1648
- displayName: "Cloudflare Connection",
1649
- description: "Creates a new Cloudflare connection for one zone.",
1650
- primaryIcon: "simple-icons:cloudflare"
1651
- },
1652
- source: {
1653
- type: "npm",
1654
- package: "@highstate/cloudflare",
1655
- path: "connection"
1656
- }
1657
- });
1658
-
1659
- var cloudflare = /*#__PURE__*/Object.freeze({
1660
- __proto__: null,
1661
- connection: connection
1662
- });
1663
-
1664
- const cluster = defineUnit({
1665
- type: "k3s.cluster",
1666
- inputs: {
1667
- server: serverEntity
1668
- },
1669
- outputs: {
1670
- k8sCluster: clusterEntity$1
1671
- },
1672
- meta: {
1673
- displayName: "K3s Cluster",
1674
- description: "The K3s cluster created on top of the server.",
1675
- category: "k3s",
1676
- primaryIcon: "devicon:k3s",
1677
- secondaryIcon: "devicon:kubernetes"
1678
- },
1679
- source: {
1680
- type: "npm",
1681
- package: "@highstate/k3s",
1682
- path: "cluster"
1683
- }
1684
- });
1685
-
1686
- var k3s = /*#__PURE__*/Object.freeze({
1687
- __proto__: null,
1688
- cluster: cluster
1689
- });
1690
-
1691
- const endpointType = Type.Union([
1692
- Type.Literal("fqdn"),
1693
- Type.Literal("ipv4"),
1694
- Type.Literal("ipv6")
1695
- ]);
1696
- const peer = defineUnit({
1697
- type: "mullvad.peer",
1698
- args: {
1699
- hostname: Type.Optional(Type.String()),
1700
- endpointType: Type.Optional({ ...endpointType, default: "fqdn" })
1701
- },
1702
- outputs: {
1703
- peer: peerEntity
1704
- },
1705
- meta: {
1706
- displayName: "Mullvad Peer",
1707
- description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
1708
- primaryIcon: "simple-icons:mullvad",
1709
- secondaryIcon: "cib:wireguard",
1710
- secondaryIconColor: "#88171a"
1711
- },
1712
- source: {
1713
- type: "npm",
1714
- package: "@highstate/mullvad",
1715
- path: "peer"
1716
- }
1717
- });
1718
-
1719
- var mullvad = /*#__PURE__*/Object.freeze({
1720
- __proto__: null,
1721
- endpointType: endpointType,
1722
- peer: peer
1723
- });
1724
-
1725
- export { index as apps, cloudflare, common, k3s, k8s, mullvad, proxmox, restic, ssh, talos, wireguard };