@highstate/library 0.4.1 → 0.4.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +306 -110
  2. package/dist/index.mjs +409 -104
  3. package/package.json +7 -5
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { defineEntity, defineUnit, text } from '@highstate/contract';
2
- import { Type } from '@sinclair/typebox';
1
+ import { Type, defineEntity, defineUnit, text, defineComponent } from '@highstate/contract';
2
+ import IPCIDR from 'ip-cidr';
3
3
 
4
4
  const keyTypeSchema = Type.Union([
5
5
  //
@@ -26,44 +26,19 @@ const credentialsSchema = Type.Object({
26
26
  user: Type.Optional(Type.String()),
27
27
  port: Type.Optional(Type.Number()),
28
28
  password: Type.Optional(Type.String()),
29
- privateKey: keyPairEntity.schema
29
+ privateKey: Type.Optional(keyPairEntity.schema)
30
30
  });
31
31
  const keyPair = defineUnit({
32
32
  type: "ssh.key-pair",
33
- outputs: {
34
- keyPair: keyPairEntity
35
- },
36
- meta: {
37
- displayName: "SSH Key Pair",
38
- description: "Generates a new ED25519 SSH key pair.",
39
- category: "ssh",
40
- primaryIcon: "charm:key",
41
- primaryIconColor: "#ffffff",
42
- secondaryIcon: "mdi:lock",
43
- secondaryIconColor: "#ffffff"
44
- },
45
- source: {
46
- type: "npm",
47
- package: "@highstate/ssh"
48
- }
49
- });
50
- const existingKeyPair = defineUnit({
51
- type: "ssh.existing-key-pair",
52
- args: {
53
- type: {
54
- schema: keyTypeSchema,
55
- description: "The type of the key pair."
56
- }
57
- },
58
33
  secrets: {
59
- privateKey: Type.String()
34
+ privateKey: Type.Optional(Type.String())
60
35
  },
61
36
  outputs: {
62
37
  keyPair: keyPairEntity
63
38
  },
64
39
  meta: {
65
- displayName: "SSH Existing Key Pair",
66
- description: "Uses an existing SSH key pair.",
40
+ displayName: "SSH Key Pair",
41
+ description: "Generates a new ED25519 SSH key pair.",
67
42
  category: "ssh",
68
43
  primaryIcon: "charm:key",
69
44
  primaryIconColor: "#ffffff",
@@ -72,7 +47,8 @@ const existingKeyPair = defineUnit({
72
47
  },
73
48
  source: {
74
49
  type: "npm",
75
- package: "@highstate/ssh"
50
+ package: "@highstate/common",
51
+ path: "ssh/key-pair"
76
52
  }
77
53
  });
78
54
  const existingPublicKey = defineUnit({
@@ -101,14 +77,14 @@ const existingPublicKey = defineUnit({
101
77
  },
102
78
  source: {
103
79
  type: "npm",
104
- package: "@highstate/ssh"
80
+ package: "@highstate/common",
81
+ path: "ssh/existing-public-key"
105
82
  }
106
83
  });
107
84
 
108
85
  var ssh = /*#__PURE__*/Object.freeze({
109
86
  __proto__: null,
110
87
  credentialsSchema: credentialsSchema,
111
- existingKeyPair: existingKeyPair,
112
88
  existingPublicKey: existingPublicKey,
113
89
  keyPair: keyPair,
114
90
  keyPairEntity: keyPairEntity,
@@ -120,12 +96,33 @@ const serverEntity = defineEntity({
120
96
  type: "common.server",
121
97
  schema: Type.Object({
122
98
  endpoint: Type.String(),
123
- sshCredentials: credentialsSchema
99
+ hostname: Type.String(),
100
+ sshCredentials: Type.Optional(credentialsSchema)
124
101
  }),
125
102
  meta: {
126
103
  color: "#009688"
127
104
  }
128
105
  });
106
+ const innerCircuitEntity = defineEntity({
107
+ type: "common.inner-circuit",
108
+ schema: Type.Object({
109
+ interface: Type.String()
110
+ }),
111
+ meta: {
112
+ color: "#2196F3",
113
+ description: "The inner circuit of a network where the traffic is flowing inside the single kernel."
114
+ }
115
+ });
116
+ const outerCircuitEntity = defineEntity({
117
+ type: "common.outer-circuit",
118
+ schema: Type.Object({
119
+ interface: Type.String()
120
+ }),
121
+ meta: {
122
+ color: "#FFC107",
123
+ description: "The outer circuit of a network which traffic will be routed to another network."
124
+ }
125
+ });
129
126
  const gatewayEntity = defineEntity({
130
127
  type: "common.gateway",
131
128
  schema: Type.Object({
@@ -176,7 +173,33 @@ const accessPoint = defineUnit({
176
173
  },
177
174
  source: {
178
175
  type: "npm",
179
- package: "@highstate/common"
176
+ package: "@highstate/common",
177
+ path: "access-point"
178
+ }
179
+ });
180
+ const existingServer = defineUnit({
181
+ type: "common.existing-server",
182
+ args: {
183
+ endpoint: Type.String(),
184
+ sshUser: Type.Optional(Type.String({ default: "root" })),
185
+ sshPort: Type.Optional(Type.Number({ default: 22 }))
186
+ },
187
+ secrets: {
188
+ sshPassword: Type.Optional(Type.String())
189
+ },
190
+ outputs: {
191
+ server: serverEntity
192
+ },
193
+ meta: {
194
+ displayName: "Existing Server",
195
+ description: "An existing server that can be used in the configuration.",
196
+ primaryIcon: "mdi:server",
197
+ defaultNamePrefix: "server"
198
+ },
199
+ source: {
200
+ type: "npm",
201
+ package: "@highstate/common",
202
+ path: "existing-server"
180
203
  }
181
204
  });
182
205
 
@@ -185,12 +208,15 @@ var common = /*#__PURE__*/Object.freeze({
185
208
  accessPoint: accessPoint,
186
209
  accessPointEntity: accessPointEntity,
187
210
  dnsProviderEntity: dnsProviderEntity,
211
+ existingServer: existingServer,
188
212
  gatewayEntity: gatewayEntity,
213
+ innerCircuitEntity: innerCircuitEntity,
214
+ outerCircuitEntity: outerCircuitEntity,
189
215
  serverEntity: serverEntity,
190
216
  tlsIssuerEntity: tlsIssuerEntity
191
217
  });
192
218
 
193
- const clusterEntity$1 = defineEntity({
219
+ const clusterEntity$2 = defineEntity({
194
220
  type: "proxmox.cluster",
195
221
  schema: Type.Object({
196
222
  endpoint: Type.String(),
@@ -228,7 +254,7 @@ const connection$1 = defineUnit({
228
254
  apiToken: Type.Optional(Type.String())
229
255
  },
230
256
  outputs: {
231
- proxmoxCluster: clusterEntity$1
257
+ proxmoxCluster: clusterEntity$2
232
258
  },
233
259
  meta: {
234
260
  displayName: "Proxmox Connection",
@@ -240,7 +266,8 @@ const connection$1 = defineUnit({
240
266
  },
241
267
  source: {
242
268
  type: "npm",
243
- package: "@highstate/proxmox"
269
+ package: "@highstate/proxmox",
270
+ path: "connection"
244
271
  }
245
272
  });
246
273
  const image = defineUnit({
@@ -252,7 +279,7 @@ const image = defineUnit({
252
279
  datastoreId: Type.Optional(Type.String())
253
280
  },
254
281
  inputs: {
255
- proxmoxCluster: clusterEntity$1
282
+ proxmoxCluster: clusterEntity$2
256
283
  },
257
284
  outputs: {
258
285
  image: imageEntity
@@ -267,7 +294,8 @@ const image = defineUnit({
267
294
  },
268
295
  source: {
269
296
  type: "npm",
270
- package: "@highstate/proxmox"
297
+ package: "@highstate/proxmox",
298
+ path: "image"
271
299
  }
272
300
  });
273
301
  const existingImage = defineUnit({
@@ -288,7 +316,8 @@ const existingImage = defineUnit({
288
316
  },
289
317
  source: {
290
318
  type: "npm",
291
- package: "@highstate/proxmox"
319
+ package: "@highstate/proxmox",
320
+ path: "existing-image"
292
321
  }
293
322
  });
294
323
  const virtualMachine = defineUnit({
@@ -306,7 +335,7 @@ const virtualMachine = defineUnit({
306
335
  bridge: Type.Optional(Type.String())
307
336
  },
308
337
  inputs: {
309
- proxmoxCluster: clusterEntity$1,
338
+ proxmoxCluster: clusterEntity$2,
310
339
  image: imageEntity,
311
340
  sshPublicKey: {
312
341
  entity: publicKeyEntity,
@@ -330,13 +359,14 @@ const virtualMachine = defineUnit({
330
359
  },
331
360
  source: {
332
361
  type: "npm",
333
- package: "@highstate/proxmox"
362
+ package: "@highstate/proxmox",
363
+ path: "virtual-machine"
334
364
  }
335
365
  });
336
366
 
337
367
  var proxmox = /*#__PURE__*/Object.freeze({
338
368
  __proto__: null,
339
- clusterEntity: clusterEntity$1,
369
+ clusterEntity: clusterEntity$2,
340
370
  connection: connection$1,
341
371
  existingImage: existingImage,
342
372
  image: image,
@@ -344,8 +374,9 @@ var proxmox = /*#__PURE__*/Object.freeze({
344
374
  virtualMachine: virtualMachine
345
375
  });
346
376
 
347
- const clusterEntity = defineEntity({
377
+ const clusterEntity$1 = defineEntity({
348
378
  type: "k8s.cluster",
379
+ sensitive: true,
349
380
  schema: Type.Object({
350
381
  kubeconfig: Type.String()
351
382
  }),
@@ -365,7 +396,7 @@ const routeEntity = defineEntity({
365
396
  const traefikGateway = defineUnit({
366
397
  type: "k8s.traefik-gateway",
367
398
  inputs: {
368
- k8sCluster: clusterEntity,
399
+ k8sCluster: clusterEntity$1,
369
400
  ingress: routeEntity
370
401
  },
371
402
  outputs: {
@@ -378,13 +409,14 @@ const traefikGateway = defineUnit({
378
409
  },
379
410
  source: {
380
411
  type: "npm",
381
- package: "@highstate/k8s"
412
+ package: "@highstate/apps",
413
+ path: "traefik"
382
414
  }
383
415
  });
384
416
  const certManager = defineUnit({
385
417
  type: "k8s.cert-manager",
386
418
  inputs: {
387
- k8sCluster: clusterEntity,
419
+ k8sCluster: clusterEntity$1,
388
420
  dnsProvider: dnsProviderEntity
389
421
  },
390
422
  outputs: {
@@ -397,13 +429,14 @@ const certManager = defineUnit({
397
429
  },
398
430
  source: {
399
431
  type: "npm",
400
- package: "@highstate/k8s"
432
+ package: "@highstate/apps",
433
+ path: "cert-manager"
401
434
  }
402
435
  });
403
436
  const coredns = defineUnit({
404
437
  type: "k8s.coredns",
405
438
  inputs: {
406
- k8sCluster: clusterEntity
439
+ k8sCluster: clusterEntity$1
407
440
  },
408
441
  outputs: {
409
442
  dnsProvider: dnsProviderEntity
@@ -415,20 +448,32 @@ const coredns = defineUnit({
415
448
  },
416
449
  source: {
417
450
  type: "npm",
418
- package: "@highstate/k8s"
451
+ package: "@highstate/apps",
452
+ path: "coredns"
419
453
  }
420
454
  });
421
455
 
422
456
  var k8s = /*#__PURE__*/Object.freeze({
423
457
  __proto__: null,
424
458
  certManager: certManager,
425
- clusterEntity: clusterEntity,
459
+ clusterEntity: clusterEntity$1,
426
460
  coredns: coredns,
427
461
  routeEntity: routeEntity,
428
462
  traefikGateway: traefikGateway
429
463
  });
430
464
 
431
- const cluster = defineUnit({
465
+ const clusterEntity = defineEntity({
466
+ type: "talos.cluster",
467
+ sensitive: true,
468
+ schema: Type.Object({
469
+ clientConfiguration: Type.String(),
470
+ machineSecrets: Type.String()
471
+ }),
472
+ meta: {
473
+ color: "#2d2d2d"
474
+ }
475
+ });
476
+ const cluster$1 = defineUnit({
432
477
  type: "talos.cluster",
433
478
  args: {
434
479
  scheduleOnMasters: {
@@ -437,6 +482,41 @@ const cluster = defineUnit({
437
482
  Allow scheduling workloads on the master nodes.
438
483
  By default, "true" if no worker nodes are provided.
439
484
  `
485
+ },
486
+ endpoint: {
487
+ schema: Type.Optional(Type.String()),
488
+ description: text`
489
+ The endpoint of the cluster.
490
+ By default, the first master node's endpoint is used.
491
+ `
492
+ },
493
+ clusterName: {
494
+ schema: Type.Optional(Type.String()),
495
+ description: text`
496
+ The name of the cluster.
497
+ By default, the name of the instance is used.
498
+ `
499
+ },
500
+ sharedConfigPatch: {
501
+ schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
502
+ description: text`
503
+ The shared configuration patch.
504
+ It will be applied to all nodes.
505
+ `
506
+ },
507
+ masterConfigPatch: {
508
+ schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
509
+ description: text`
510
+ The master configuration patch.
511
+ It will be applied to all master nodes.
512
+ `
513
+ },
514
+ workerConfigPatch: {
515
+ schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
516
+ description: text`
517
+ The worker configuration patch.
518
+ It will be applied to all worker nodes.
519
+ `
440
520
  }
441
521
  },
442
522
  inputs: {
@@ -451,7 +531,8 @@ const cluster = defineUnit({
451
531
  }
452
532
  },
453
533
  outputs: {
454
- k8sCluster: clusterEntity,
534
+ k8sCluster: clusterEntity$1,
535
+ talosCluster: clusterEntity,
455
536
  egress: routeEntity
456
537
  },
457
538
  meta: {
@@ -464,31 +545,43 @@ const cluster = defineUnit({
464
545
  },
465
546
  source: {
466
547
  type: "npm",
467
- package: "@highstate/talos"
548
+ package: "@highstate/talos",
549
+ path: "cluster"
468
550
  }
469
551
  });
470
552
 
471
553
  var talos = /*#__PURE__*/Object.freeze({
472
554
  __proto__: null,
473
- cluster: cluster
555
+ cluster: cluster$1,
556
+ clusterEntity: clusterEntity
474
557
  });
475
558
 
476
- const backendSchema = Type.Union([Type.Literal("wireguard"), Type.Literal("amneziawg")], {
477
- default: "wireguard"
478
- });
559
+ const backendSchema = Type.Union([
560
+ //
561
+ Type.Literal("wireguard"),
562
+ Type.Literal("amneziawg")
563
+ ]);
564
+ const presharedKeyModeSchema = Type.Union([
565
+ Type.Literal("none"),
566
+ Type.Literal("global"),
567
+ Type.Literal("secure")
568
+ ]);
479
569
  const networkEntity = defineEntity({
480
570
  type: "wireguard.network",
481
571
  schema: Type.Object({
482
572
  backend: Type.Optional(backendSchema),
483
- preSharedKey: Type.Optional(Type.String())
573
+ presharedKeyMode: presharedKeyModeSchema,
574
+ globalPresharedKey: Type.Optional(Type.String())
484
575
  })
485
576
  });
486
577
  const identityEntity = defineEntity({
487
578
  type: "wireguard.identity",
488
579
  schema: Type.Object({
489
- network: Type.String(),
580
+ name: Type.String(),
581
+ network: Type.Optional(networkEntity.schema),
490
582
  address: Type.String(),
491
- privateKey: Type.String()
583
+ privateKey: Type.String(),
584
+ presharedKeyPart: Type.Optional(Type.String())
492
585
  }),
493
586
  meta: {
494
587
  color: "#F44336"
@@ -497,10 +590,13 @@ const identityEntity = defineEntity({
497
590
  const peerEntity = defineEntity({
498
591
  type: "wireguard.peer",
499
592
  schema: Type.Object({
500
- network: Type.String(),
501
- address: Type.String(),
593
+ name: Type.String(),
594
+ network: Type.Optional(networkEntity.schema),
502
595
  publicKey: Type.String(),
503
- endpoint: Type.Optional(Type.String())
596
+ address: Type.String(),
597
+ allowedIps: Type.Array(Type.String()),
598
+ endpoint: Type.Optional(Type.String()),
599
+ presharedKeyPart: Type.Optional(Type.String())
504
600
  }),
505
601
  meta: {
506
602
  color: "#673AB7"
@@ -511,7 +607,6 @@ const k8sNodeEntity = defineEntity({
511
607
  schema: Type.Object({
512
608
  network: Type.String(),
513
609
  address: Type.String(),
514
- allowedIps: Type.Array(Type.String()),
515
610
  endpoint: Type.Optional(Type.String()),
516
611
  peers: Type.Array(Type.String())
517
612
  })
@@ -519,8 +614,39 @@ const k8sNodeEntity = defineEntity({
519
614
  const network = defineUnit({
520
615
  type: "wireguard.network",
521
616
  args: {
522
- backend: Type.Optional(backendSchema),
523
- preSharedKey: Type.Optional(Type.String())
617
+ /**
618
+ * The backend to use for the WireGuard network.
619
+ *
620
+ * Possible values are:
621
+ * 1. `wireguard` - The default backend.
622
+ * 2. `amneziawg` - The censorship-resistant fork of WireGuard.
623
+ *
624
+ * By default, the `wireguard` backend is used.
625
+ */
626
+ backend: backendSchema,
627
+ /**
628
+ * The option which defines how to handle pre-shared keys between peers.
629
+ *
630
+ * 1. `none` - No pre-shared keys will be used.
631
+ * 2. `global` - A single pre-shared key will be used for all peer pairs in the network.
632
+ * 3. `secure` - Each peer pair will have its own pre-shared key.
633
+ * In this case, each identity generates `presharedKeyPart` and the actual pre-shared key
634
+ * for each peer pair will be computed as `xor(peer1.presharedKeyPart, peer2.presharedKeyPart)`.
635
+ *
636
+ * If the whole network is managed by the HighState, the `secure` mode is recommended.
637
+ *
638
+ * By default, the `none` mode is used.
639
+ */
640
+ presharedKeyMode: Type.Optional(presharedKeyModeSchema)
641
+ },
642
+ secrets: {
643
+ /**
644
+ * The global pre-shared key to use for all peer pairs in the network.
645
+ *
646
+ * Will be used only if `presharedKeyMode` is set to `global`.
647
+ * Will be generated automatically if not provided.
648
+ */
649
+ globalPresharedKey: Type.Optional(Type.String())
524
650
  },
525
651
  outputs: {
526
652
  network: networkEntity
@@ -533,17 +659,70 @@ const network = defineUnit({
533
659
  },
534
660
  source: {
535
661
  type: "npm",
536
- package: "@highstate/wireguard"
662
+ package: "@highstate/wireguard",
663
+ path: "network"
537
664
  }
538
665
  });
539
666
  const identity = defineUnit({
540
667
  type: "wireguard.identity",
541
668
  args: {
669
+ /**
670
+ * The name of the WireGuard identity.
671
+ *
672
+ * If not provided, the identity will be named after the unit.
673
+ */
674
+ peerName: Type.Optional(Type.String()),
675
+ /**
676
+ * The address of the WireGuard interface.
677
+ *
678
+ * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
679
+ */
542
680
  address: Type.String(),
543
- endpoint: Type.Optional(Type.String())
681
+ /**
682
+ * The endpoint of the WireGuard peer.
683
+ *
684
+ * Does not affect node which implements the identity, but is used in the peer configuration of other nodes.
685
+ */
686
+ endpoint: Type.Optional(Type.String()),
687
+ /**
688
+ * The list of allowed IPs for the peer.
689
+ *
690
+ * Does not affect node which implements the identity, but is used in the peer configuration of other nodes.
691
+ *
692
+ * If not provided, the `address` will be used.
693
+ */
694
+ allowedIps: Type.Optional(Type.Array(Type.String())),
695
+ /**
696
+ * Whether the node should be used as an exit node.
697
+ *
698
+ * Just an alias for the `allowedIps` with the value of `0.0.0.0/0, ::/0`.
699
+ */
700
+ exitNode: Type.Optional(Type.Boolean())
701
+ },
702
+ secrets: {
703
+ /**
704
+ * The private key of the WireGuard identity.
705
+ *
706
+ * If not provided, the key will be generated automatically.
707
+ */
708
+ privateKey: Type.Optional(Type.String()),
709
+ /**
710
+ * The part of the pre-shared of the WireGuard identity.
711
+ *
712
+ * Will be generated automatically if not provided.
713
+ */
714
+ presharedKeyPart: Type.Optional(Type.String())
544
715
  },
545
716
  inputs: {
546
- network: networkEntity
717
+ /**
718
+ * The network to use for the WireGuard identity.
719
+ *
720
+ * If not provided, the identity will use default network configuration.
721
+ */
722
+ network: {
723
+ entity: networkEntity,
724
+ required: false
725
+ }
547
726
  },
548
727
  outputs: {
549
728
  identity: identityEntity,
@@ -557,13 +736,13 @@ const identity = defineUnit({
557
736
  },
558
737
  source: {
559
738
  type: "npm",
560
- package: "@highstate/wireguard"
739
+ package: "@highstate/wireguard",
740
+ path: "identity"
561
741
  }
562
742
  });
563
743
  const node = defineUnit({
564
- type: "wireguard.node-k8s",
744
+ type: "wireguard.node",
565
745
  args: {
566
- allowedIps: Type.Optional(Type.Array(Type.String())),
567
746
  listenPort: Type.Optional(Type.Number()),
568
747
  externalIp: Type.Optional(Type.String()),
569
748
  serviceType: Type.Optional(
@@ -577,17 +756,16 @@ const node = defineUnit({
577
756
  inputs: {
578
757
  identity: identityEntity,
579
758
  k8sCluster: {
580
- entity: clusterEntity,
759
+ entity: clusterEntity$1,
581
760
  required: false
582
761
  },
583
762
  peers: {
584
763
  entity: peerEntity,
585
764
  multiple: true,
586
765
  required: false
587
- }
588
- },
589
- outputs: {
590
- egress: routeEntity
766
+ },
767
+ innerCircuit: innerCircuitEntity,
768
+ outerCircuit: outerCircuitEntity
591
769
  },
592
770
  meta: {
593
771
  description: "The WireGuard node running on the Kubernetes.",
@@ -597,7 +775,8 @@ const node = defineUnit({
597
775
  },
598
776
  source: {
599
777
  type: "npm",
600
- package: "@highstate/wireguard"
778
+ package: "@highstate/wireguard",
779
+ path: "node"
601
780
  }
602
781
  });
603
782
  const config = defineUnit({
@@ -618,7 +797,56 @@ const config = defineUnit({
618
797
  },
619
798
  source: {
620
799
  type: "npm",
621
- package: "@highstate/wireguard"
800
+ package: "@highstate/wireguard",
801
+ path: "config"
802
+ }
803
+ });
804
+ const generator = defineComponent({
805
+ type: "wireguard.generator",
806
+ args: {
807
+ clientNames: Type.Array(Type.String()),
808
+ cidr: Type.String()
809
+ },
810
+ inputs: {
811
+ network: networkEntity,
812
+ peer: peerEntity
813
+ },
814
+ outputs: {
815
+ peers: {
816
+ entity: peerEntity,
817
+ multiple: true
818
+ }
819
+ },
820
+ meta: {
821
+ description: "Bulk generate the WireGuard identities and peers.",
822
+ primaryIcon: "simple-icons:wireguard",
823
+ primaryIconColor: "#88171a",
824
+ secondaryIcon: "mdi:accounts"
825
+ },
826
+ create({ name, args, inputs }) {
827
+ const cidr = new IPCIDR(args.cidr);
828
+ const peers = [];
829
+ for (const [index, client] of args.clientNames.entries()) {
830
+ const fullName = `${name}.${client}`;
831
+ const { identity: wgIdentity, peer: wgPeer } = identity({
832
+ name: fullName,
833
+ args: {
834
+ address: cidr.start({ from: index, type: "addressObject" }).address
835
+ },
836
+ inputs: {
837
+ network: inputs.network
838
+ }
839
+ });
840
+ peers.push(wgPeer);
841
+ config({
842
+ name: fullName,
843
+ inputs: {
844
+ identity: wgIdentity,
845
+ peers: [inputs.peer]
846
+ }
847
+ });
848
+ }
849
+ return { peers };
622
850
  }
623
851
  });
624
852
 
@@ -626,13 +854,15 @@ var wireguard = /*#__PURE__*/Object.freeze({
626
854
  __proto__: null,
627
855
  backendSchema: backendSchema,
628
856
  config: config,
857
+ generator: generator,
629
858
  identity: identity,
630
859
  identityEntity: identityEntity,
631
860
  k8sNodeEntity: k8sNodeEntity,
632
861
  network: network,
633
862
  networkEntity: networkEntity,
634
863
  node: node,
635
- peerEntity: peerEntity
864
+ peerEntity: peerEntity,
865
+ presharedKeyModeSchema: presharedKeyModeSchema
636
866
  });
637
867
 
638
868
  const mariadbEntity = defineEntity({
@@ -657,12 +887,11 @@ const postgresqlEntity = defineEntity({
657
887
  });
658
888
  const mariadb = defineUnit({
659
889
  type: "apps.mariadb",
660
- args: {
661
- rootPassword: Type.String(),
662
- databases: Type.Array(Type.String())
890
+ secrets: {
891
+ rootPassword: Type.String()
663
892
  },
664
893
  inputs: {
665
- k8sCluster: clusterEntity
894
+ k8sCluster: clusterEntity$1
666
895
  },
667
896
  outputs: {
668
897
  mariadb: {
@@ -678,17 +907,17 @@ const mariadb = defineUnit({
678
907
  },
679
908
  source: {
680
909
  type: "npm",
681
- package: "@highstate/apps"
910
+ package: "@highstate/apps",
911
+ path: "mariadb"
682
912
  }
683
913
  });
684
914
  const postgresql = defineUnit({
685
915
  type: "apps.postgresql",
686
- args: {
687
- rootPassword: Type.String(),
688
- databases: Type.Array(Type.String())
916
+ secrets: {
917
+ rootPassword: Type.String()
689
918
  },
690
919
  inputs: {
691
- k8sCluster: clusterEntity
920
+ k8sCluster: clusterEntity$1
692
921
  },
693
922
  outputs: {
694
923
  postgresql: {
@@ -704,7 +933,8 @@ const postgresql = defineUnit({
704
933
  },
705
934
  source: {
706
935
  type: "npm",
707
- package: "@highstate/apps"
936
+ package: "@highstate/apps",
937
+ path: "postgresql"
708
938
  }
709
939
  });
710
940
  const vaultwarden = defineUnit({
@@ -726,7 +956,8 @@ const vaultwarden = defineUnit({
726
956
  },
727
957
  source: {
728
958
  type: "npm",
729
- package: "@highstate/apps"
959
+ package: "@highstate/apps",
960
+ path: "vaultwarden"
730
961
  }
731
962
  });
732
963
  const gitea = defineUnit({
@@ -748,7 +979,8 @@ const gitea = defineUnit({
748
979
  },
749
980
  source: {
750
981
  type: "npm",
751
- package: "@highstate/apps"
982
+ package: "@highstate/apps",
983
+ path: "gitea"
752
984
  }
753
985
  });
754
986
  const zitadel = defineUnit({
@@ -770,7 +1002,8 @@ const zitadel = defineUnit({
770
1002
  },
771
1003
  source: {
772
1004
  type: "npm",
773
- package: "@highstate/apps"
1005
+ package: "@highstate/apps",
1006
+ path: "zitadel"
774
1007
  }
775
1008
  });
776
1009
 
@@ -796,11 +1029,8 @@ const connectionEntity = defineEntity({
796
1029
  });
797
1030
  const connection = defineUnit({
798
1031
  type: "cloudflare.connection",
799
- args: {
800
- apiKey: {
801
- schema: Type.String(),
802
- secret: true
803
- }
1032
+ secrets: {
1033
+ apiKey: Type.String()
804
1034
  },
805
1035
  outputs: {
806
1036
  connection: connectionEntity
@@ -812,7 +1042,8 @@ const connection = defineUnit({
812
1042
  },
813
1043
  source: {
814
1044
  type: "npm",
815
- package: "@highstate/cloudflare"
1045
+ package: "@highstate/cloudflare",
1046
+ path: "connection"
816
1047
  }
817
1048
  });
818
1049
  const zone = defineUnit({
@@ -835,7 +1066,8 @@ const zone = defineUnit({
835
1066
  },
836
1067
  source: {
837
1068
  type: "npm",
838
- package: "@highstate/cloudflare"
1069
+ package: "@highstate/cloudflare",
1070
+ path: "zone"
839
1071
  }
840
1072
  });
841
1073
 
@@ -846,4 +1078,77 @@ var cloudflare = /*#__PURE__*/Object.freeze({
846
1078
  zone: zone
847
1079
  });
848
1080
 
849
- export { apps, cloudflare, common, k8s, proxmox, ssh, talos, wireguard };
1081
+ const cluster = defineUnit({
1082
+ type: "k3s.cluster",
1083
+ inputs: {
1084
+ server: serverEntity
1085
+ },
1086
+ outputs: {
1087
+ k8sCluster: clusterEntity$1
1088
+ },
1089
+ meta: {
1090
+ displayName: "K3s Cluster",
1091
+ description: "The K3s cluster created on top of the server.",
1092
+ category: "k3s",
1093
+ primaryIcon: "devicon:k3s",
1094
+ secondaryIcon: "devicon:kubernetes"
1095
+ },
1096
+ source: {
1097
+ type: "npm",
1098
+ package: "@highstate/k3s",
1099
+ path: "cluster"
1100
+ }
1101
+ });
1102
+
1103
+ var k3s = /*#__PURE__*/Object.freeze({
1104
+ __proto__: null,
1105
+ cluster: cluster
1106
+ });
1107
+
1108
+ const channelEntity = defineEntity({
1109
+ type: "xt-wgobfs.target",
1110
+ schema: Type.Object({
1111
+ endpoint: Type.String()
1112
+ })
1113
+ });
1114
+ const obfuscatorNode = defineUnit({
1115
+ type: "xt-wgobfs.obfuscator",
1116
+ outputs: {
1117
+ outerCircuit: outerCircuitEntity,
1118
+ channel: channelEntity
1119
+ },
1120
+ source: {
1121
+ type: "npm",
1122
+ package: "@highstate/xt-wgobfs",
1123
+ path: "target-node"
1124
+ },
1125
+ meta: {
1126
+ displayName: "xt-wgobfs Deobfuscator"
1127
+ }
1128
+ });
1129
+ const deobfuscatorNode = defineUnit({
1130
+ type: "xt-wgobfs.deobfuscator",
1131
+ inputs: {
1132
+ channel: channelEntity
1133
+ },
1134
+ outputs: {
1135
+ outerCircuit: outerCircuitEntity
1136
+ },
1137
+ source: {
1138
+ type: "npm",
1139
+ package: "@highstate/xt-wgobfs",
1140
+ path: "source-node"
1141
+ },
1142
+ meta: {
1143
+ displayName: "xt-wgobfs Obfuscator"
1144
+ }
1145
+ });
1146
+
1147
+ var xtWgobfs = /*#__PURE__*/Object.freeze({
1148
+ __proto__: null,
1149
+ channelEntity: channelEntity,
1150
+ deobfuscatorNode: deobfuscatorNode,
1151
+ obfuscatorNode: obfuscatorNode
1152
+ });
1153
+
1154
+ export { apps, cloudflare, common, k3s, k8s, proxmox, ssh, talos, wireguard, xtWgobfs };