@highstate/library 0.4.4 → 0.4.6

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 +626 -154
  2. package/dist/index.mjs +450 -263
  3. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -8,25 +8,21 @@ const keyTypeSchema = Type.Union([
8
8
  ]);
9
9
  const keyPairEntity = defineEntity({
10
10
  type: "ssh.key-pair",
11
- sensitive: true,
12
11
  schema: Type.Object({
13
12
  type: keyTypeSchema,
14
13
  privateKey: Type.String(),
15
14
  publicKey: Type.String()
16
- })
17
- });
18
- const publicKeyEntity = defineEntity({
19
- type: "ssh.public-key",
20
- schema: Type.Object({
21
- publicKey: Type.String()
22
- })
15
+ }),
16
+ meta: {
17
+ color: "#2b5797"
18
+ }
23
19
  });
24
20
  const credentialsSchema = Type.Object({
25
21
  endpoint: Type.Optional(Type.String()),
26
22
  user: Type.Optional(Type.String()),
27
23
  port: Type.Optional(Type.Number()),
28
24
  password: Type.Optional(Type.String()),
29
- privateKey: Type.Optional(keyPairEntity.schema)
25
+ keyPair: Type.Optional(keyPairEntity.schema)
30
26
  });
31
27
  const keyPair = defineUnit({
32
28
  type: "ssh.key-pair",
@@ -38,7 +34,7 @@ const keyPair = defineUnit({
38
34
  },
39
35
  meta: {
40
36
  displayName: "SSH Key Pair",
41
- description: "Generates a new ED25519 SSH key pair.",
37
+ description: "Holds the ED25519 SSH key pair and generates the private key if not provided.",
42
38
  category: "ssh",
43
39
  primaryIcon: "charm:key",
44
40
  primaryIconColor: "#ffffff",
@@ -51,45 +47,13 @@ const keyPair = defineUnit({
51
47
  path: "ssh/key-pair"
52
48
  }
53
49
  });
54
- const existingPublicKey = defineUnit({
55
- type: "ssh.existing-public-key",
56
- args: {
57
- type: {
58
- schema: keyTypeSchema,
59
- description: "The type of the key pair."
60
- },
61
- publicKey: {
62
- schema: Type.String(),
63
- description: "The public key in OpenSSH format."
64
- }
65
- },
66
- outputs: {
67
- publicKey: publicKeyEntity
68
- },
69
- meta: {
70
- displayName: "SSH Existing Public Key",
71
- description: "Uses an existing SSH public key.",
72
- category: "ssh",
73
- primaryIcon: "charm:key",
74
- primaryIconColor: "#ffffff",
75
- secondaryIcon: "mdi:public",
76
- secondaryIconColor: "#ffffff"
77
- },
78
- source: {
79
- type: "npm",
80
- package: "@highstate/common",
81
- path: "ssh/existing-public-key"
82
- }
83
- });
84
50
 
85
51
  var ssh = /*#__PURE__*/Object.freeze({
86
52
  __proto__: null,
87
53
  credentialsSchema: credentialsSchema,
88
- existingPublicKey: existingPublicKey,
89
54
  keyPair: keyPair,
90
55
  keyPairEntity: keyPairEntity,
91
- keyTypeSchema: keyTypeSchema,
92
- publicKeyEntity: publicKeyEntity
56
+ keyTypeSchema: keyTypeSchema
93
57
  });
94
58
 
95
59
  const serverEntity = defineEntity({
@@ -103,80 +67,38 @@ const serverEntity = defineEntity({
103
67
  color: "#009688"
104
68
  }
105
69
  });
106
- const innerCircuitEntity = defineEntity({
107
- type: "common.inner-circuit",
70
+ const interfaceEntity = defineEntity({
71
+ type: "common.interface",
108
72
  schema: Type.Object({
109
73
  interface: Type.String()
110
74
  }),
111
75
  meta: {
112
76
  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
- });
126
- const gatewayEntity = defineEntity({
127
- type: "common.gateway",
128
- schema: Type.Object({
129
- endpoint: Type.String()
130
- }),
131
- meta: {
132
- color: "#4CAF50"
77
+ description: "The interface in a network space of the kernel which can accept or transmit packets."
133
78
  }
134
79
  });
135
- const tlsIssuerEntity = defineEntity({
136
- type: "common.tls-issuer",
80
+ const endpointEntity = defineEntity({
81
+ type: "common.endpoint",
137
82
  schema: Type.Object({
138
83
  endpoint: Type.String()
139
84
  }),
140
85
  meta: {
141
- color: "#f06292"
86
+ color: "#FFC107",
87
+ description: "The L3-L4 endpoint for some network service."
142
88
  }
143
89
  });
144
90
  const dnsProviderEntity = defineEntity({
145
91
  type: "common.dns-provider",
146
92
  schema: Type.Object({
147
- endpoint: Type.String()
93
+ name: Type.String(),
94
+ type: Type.String(),
95
+ data: Type.Record(Type.String(), Type.Unknown()),
96
+ domain: Type.String()
148
97
  }),
149
98
  meta: {
150
99
  color: "#FF5722"
151
100
  }
152
101
  });
153
- const accessPointEntity = defineEntity({
154
- type: "common.access-point",
155
- schema: Type.Object({
156
- name: Type.String()
157
- })
158
- });
159
- const accessPoint = defineUnit({
160
- type: "common.access-point",
161
- inputs: {
162
- gateway: gatewayEntity,
163
- tlsIssuer: tlsIssuerEntity,
164
- dnsProvider: dnsProviderEntity
165
- },
166
- outputs: {
167
- accessPoint: accessPointEntity
168
- },
169
- meta: {
170
- displayName: "Access Point",
171
- description: "An access point which can be used to connect to services.",
172
- primaryIcon: "mdi:access-point"
173
- },
174
- source: {
175
- type: "npm",
176
- package: "@highstate/common",
177
- path: "access-point"
178
- }
179
- });
180
102
  const existingServer = defineUnit({
181
103
  type: "common.existing-server",
182
104
  args: {
@@ -205,15 +127,11 @@ const existingServer = defineUnit({
205
127
 
206
128
  var common = /*#__PURE__*/Object.freeze({
207
129
  __proto__: null,
208
- accessPoint: accessPoint,
209
- accessPointEntity: accessPointEntity,
210
130
  dnsProviderEntity: dnsProviderEntity,
131
+ endpointEntity: endpointEntity,
211
132
  existingServer: existingServer,
212
- gatewayEntity: gatewayEntity,
213
- innerCircuitEntity: innerCircuitEntity,
214
- outerCircuitEntity: outerCircuitEntity,
215
- serverEntity: serverEntity,
216
- tlsIssuerEntity: tlsIssuerEntity
133
+ interfaceEntity: interfaceEntity,
134
+ serverEntity: serverEntity
217
135
  });
218
136
 
219
137
  const clusterEntity$2 = defineEntity({
@@ -223,7 +141,7 @@ const clusterEntity$2 = defineEntity({
223
141
  insecure: Type.Optional(Type.Boolean()),
224
142
  username: Type.Optional(Type.String()),
225
143
  defaultNodeName: Type.String(),
226
- defaultDatastoreId: Type.Optional(Type.String()),
144
+ defaultDatastoreId: Type.String(),
227
145
  password: Type.Optional(Type.String()),
228
146
  apiToken: Type.Optional(Type.String())
229
147
  }),
@@ -246,7 +164,7 @@ const connection$1 = defineUnit({
246
164
  endpoint: Type.String(),
247
165
  insecure: Type.Optional(Type.Boolean()),
248
166
  username: Type.Optional(Type.String()),
249
- defaultNodeName: Type.String(),
167
+ defaultNodeName: Type.Optional(Type.String()),
250
168
  defaultDatastoreId: Type.Optional(Type.String())
251
169
  },
252
170
  secrets: {
@@ -324,23 +242,23 @@ const virtualMachine = defineUnit({
324
242
  type: "proxmox.virtual-machine",
325
243
  args: {
326
244
  nodeName: Type.Optional(Type.String()),
327
- cores: Type.Optional(Type.Number()),
328
- sockets: Type.Optional(Type.Number()),
329
- memory: Type.Optional(Type.Number()),
245
+ cpuType: Type.Optional(Type.String({ default: "host" })),
246
+ cores: Type.Optional(Type.Number({ default: 1 })),
247
+ sockets: Type.Optional(Type.Number({ default: 1 })),
248
+ memory: Type.Optional(Type.Number({ default: 512 })),
330
249
  ipv4: Type.Optional(Type.String()),
331
250
  ipv4Gateway: Type.Optional(Type.String()),
332
251
  dns: Type.Optional(Type.Array(Type.String())),
333
252
  datastoreId: Type.Optional(Type.String()),
334
- diskSize: Type.Optional(Type.Number()),
335
- bridge: Type.Optional(Type.String())
253
+ diskSize: Type.Optional(Type.Number({ default: 8 })),
254
+ bridge: Type.Optional(Type.String({ default: "vmbr0" })),
255
+ sshPort: Type.Optional(Type.Number({ default: 22 })),
256
+ sshUser: Type.Optional(Type.String({ default: "root" })),
257
+ waitForAgent: Type.Optional(Type.Boolean({ default: true }))
336
258
  },
337
259
  inputs: {
338
260
  proxmoxCluster: clusterEntity$2,
339
261
  image: imageEntity,
340
- sshPublicKey: {
341
- entity: publicKeyEntity,
342
- required: false
343
- },
344
262
  sshKeyPair: {
345
263
  entity: keyPairEntity,
346
264
  required: false
@@ -376,51 +294,96 @@ var proxmox = /*#__PURE__*/Object.freeze({
376
294
 
377
295
  const clusterEntity$1 = defineEntity({
378
296
  type: "k8s.cluster",
379
- sensitive: true,
380
297
  schema: Type.Object({
381
- kubeconfig: Type.String()
298
+ name: Type.String(),
299
+ kubeconfig: Type.String(),
300
+ cni: Type.String()
382
301
  }),
383
302
  meta: {
384
303
  color: "#2196F3"
385
304
  }
386
305
  });
387
- const routeEntity = defineEntity({
388
- type: "k8s.route",
306
+ const existingCluster = defineUnit({
307
+ type: "k8s.existing-cluster",
308
+ secrets: {
309
+ kubeconfig: Type.Record(Type.String(), Type.Any())
310
+ },
311
+ outputs: {
312
+ cluster: clusterEntity$1
313
+ },
314
+ meta: {
315
+ displayName: "Existing Cluster",
316
+ description: "An existing Kubernetes cluster.",
317
+ primaryIcon: "mdi:kubernetes"
318
+ },
319
+ source: {
320
+ type: "npm",
321
+ package: "@highstate/k8s",
322
+ path: "existing-cluster"
323
+ }
324
+ });
325
+ const gatewayEntity = defineEntity({
326
+ type: "k8s.gateway",
389
327
  schema: Type.Object({
390
- someField: Type.String()
328
+ clusterName: Type.String(),
329
+ gatewayClassName: Type.String(),
330
+ httpListenerPort: Type.Number(),
331
+ httpsListenerPort: Type.Number(),
332
+ ip: Type.String()
391
333
  }),
392
334
  meta: {
393
- color: "#F44336"
335
+ color: "#4CAF50"
394
336
  }
395
337
  });
396
- const traefikGateway = defineUnit({
397
- type: "k8s.traefik-gateway",
338
+ const tlsIssuerEntity = defineEntity({
339
+ type: "k8s.tls-issuer",
340
+ schema: Type.Object({
341
+ clusterName: Type.String(),
342
+ clusterIssuerName: Type.String()
343
+ }),
344
+ meta: {
345
+ color: "#f06292"
346
+ }
347
+ });
348
+ const accessPointEntity = defineEntity({
349
+ type: "common.access-point",
350
+ schema: Type.Object({
351
+ gateway: gatewayEntity.schema,
352
+ tlsIssuer: tlsIssuerEntity.schema,
353
+ dnsProvider: dnsProviderEntity.schema
354
+ }),
355
+ meta: {
356
+ color: "#FFC107"
357
+ }
358
+ });
359
+ const accessPoint = defineUnit({
360
+ type: "k8s.access-point",
398
361
  inputs: {
399
- k8sCluster: clusterEntity$1,
400
- ingress: routeEntity
362
+ gateway: gatewayEntity,
363
+ tlsIssuer: tlsIssuerEntity,
364
+ dnsProvider: dnsProviderEntity
401
365
  },
402
366
  outputs: {
403
- gateway: gatewayEntity
367
+ accessPoint: accessPointEntity
404
368
  },
405
369
  meta: {
406
- displayName: "Traefik Gateway",
407
- description: "A Traefik gateway for routing traffic to services.",
408
- primaryIcon: "simple-icons:traefikproxy"
370
+ displayName: "Access Point",
371
+ description: "An access point which can be used to connect to services.",
372
+ primaryIcon: "mdi:access-point"
409
373
  },
410
374
  source: {
411
375
  type: "npm",
412
- package: "@highstate/apps",
413
- path: "traefik"
376
+ package: "@highstate/k8s",
377
+ path: "access-point"
414
378
  }
415
379
  });
416
380
  const certManager = defineUnit({
417
381
  type: "k8s.cert-manager",
418
382
  inputs: {
419
- k8sCluster: clusterEntity$1,
420
- dnsProvider: dnsProviderEntity
383
+ k8sCluster: clusterEntity$1
421
384
  },
422
385
  outputs: {
423
- tlsIssuer: tlsIssuerEntity
386
+ k8sCluster: clusterEntity$1
424
387
  },
425
388
  meta: {
426
389
  displayName: "Cert Manager",
@@ -429,42 +392,67 @@ const certManager = defineUnit({
429
392
  },
430
393
  source: {
431
394
  type: "npm",
432
- package: "@highstate/apps",
395
+ package: "@highstate/k8s",
433
396
  path: "cert-manager"
434
397
  }
435
398
  });
436
- const coredns = defineUnit({
437
- type: "k8s.coredns",
399
+ const dns01TlsIssuer = defineUnit({
400
+ type: "k8s.dns01-issuer",
438
401
  inputs: {
439
- k8sCluster: clusterEntity$1
402
+ k8sCluster: clusterEntity$1,
403
+ dnsProvider: dnsProviderEntity
440
404
  },
441
405
  outputs: {
442
- dnsProvider: dnsProviderEntity
406
+ tlsIssuer: tlsIssuerEntity
443
407
  },
444
408
  meta: {
445
- displayName: "CoreDNS",
446
- description: "A separate CoreDNS instance for custom DNS records.",
447
- primaryIcon: "mdi:dns"
409
+ displayName: "DNS01 Issuer",
410
+ description: "A TLS issuer for issuing certificate using DNS01 challenge.",
411
+ primaryIcon: "mdi:certificate"
448
412
  },
449
413
  source: {
450
414
  type: "npm",
451
- package: "@highstate/apps",
452
- path: "coredns"
415
+ package: "@highstate/k8s",
416
+ path: "dns01-issuer"
417
+ }
418
+ });
419
+ const serviceTypeSchema = Type.Union([
420
+ Type.Literal("NodePort"),
421
+ Type.Literal("LoadBalancer"),
422
+ Type.Literal("ClusterIP")
423
+ ]);
424
+ const serviceEntity = defineEntity({
425
+ type: "k8s.service",
426
+ schema: Type.Object({
427
+ clusterName: Type.String(),
428
+ name: Type.String(),
429
+ namespace: Type.String(),
430
+ selector: Type.Record(Type.String(), Type.String()),
431
+ serviceType: serviceTypeSchema,
432
+ ip: Type.Optional(Type.String()),
433
+ ports: Type.Array(Type.Number())
434
+ }),
435
+ meta: {
436
+ color: "#2196F3"
453
437
  }
454
438
  });
455
439
 
456
440
  var k8s = /*#__PURE__*/Object.freeze({
457
441
  __proto__: null,
442
+ accessPoint: accessPoint,
443
+ accessPointEntity: accessPointEntity,
458
444
  certManager: certManager,
459
445
  clusterEntity: clusterEntity$1,
460
- coredns: coredns,
461
- routeEntity: routeEntity,
462
- traefikGateway: traefikGateway
446
+ dns01TlsIssuer: dns01TlsIssuer,
447
+ existingCluster: existingCluster,
448
+ gatewayEntity: gatewayEntity,
449
+ serviceEntity: serviceEntity,
450
+ serviceTypeSchema: serviceTypeSchema,
451
+ tlsIssuerEntity: tlsIssuerEntity
463
452
  });
464
453
 
465
454
  const clusterEntity = defineEntity({
466
455
  type: "talos.cluster",
467
- sensitive: true,
468
456
  schema: Type.Object({
469
457
  clientConfiguration: Type.String(),
470
458
  machineSecrets: Type.String()
@@ -473,6 +461,12 @@ const clusterEntity = defineEntity({
473
461
  color: "#2d2d2d"
474
462
  }
475
463
  });
464
+ const cniSchema = Type.Union([
465
+ Type.Literal("cilium"),
466
+ Type.Literal("flannel"),
467
+ Type.Literal("none")
468
+ ]);
469
+ const csiSchema = Type.Union([Type.Literal("local-path-provisioner"), Type.Literal("none")]);
476
470
  const cluster$1 = defineUnit({
477
471
  type: "talos.cluster",
478
472
  args: {
@@ -497,6 +491,29 @@ const cluster$1 = defineUnit({
497
491
  By default, the name of the instance is used.
498
492
  `
499
493
  },
494
+ cni: {
495
+ schema: Type.Optional({ ...cniSchema, default: "cilium" }),
496
+ description: text`
497
+ The CNI plugin to use.
498
+
499
+ The following options are available:
500
+ - "cilium" (default)
501
+ - "flannel" (built-in in Talos)
502
+ - "none" (disable CNI, must be installed manually)
503
+
504
+ The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.
505
+ `
506
+ },
507
+ csi: {
508
+ schema: Type.Optional({ ...csiSchema, default: "local-path-provisioner" }),
509
+ description: text`
510
+ The CSI plugin to use.
511
+
512
+ The following options are available:
513
+ - "local-path-provisioner" (default)
514
+ - "none" (disable CSI, must be installed manually if needed)
515
+ `
516
+ },
500
517
  sharedConfigPatch: {
501
518
  schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
502
519
  description: text`
@@ -532,8 +549,7 @@ const cluster$1 = defineUnit({
532
549
  },
533
550
  outputs: {
534
551
  k8sCluster: clusterEntity$1,
535
- talosCluster: clusterEntity,
536
- egress: routeEntity
552
+ talosCluster: clusterEntity
537
553
  },
538
554
  meta: {
539
555
  displayName: "Talos Cluster",
@@ -553,7 +569,9 @@ const cluster$1 = defineUnit({
553
569
  var talos = /*#__PURE__*/Object.freeze({
554
570
  __proto__: null,
555
571
  cluster: cluster$1,
556
- clusterEntity: clusterEntity
572
+ clusterEntity: clusterEntity,
573
+ cniSchema: cniSchema,
574
+ csiSchema: csiSchema
557
575
  });
558
576
 
559
577
  const backendSchema = Type.Union([
@@ -581,7 +599,11 @@ const identityEntity = defineEntity({
581
599
  network: Type.Optional(networkEntity.schema),
582
600
  address: Type.String(),
583
601
  privateKey: Type.String(),
584
- presharedKeyPart: Type.Optional(Type.String())
602
+ presharedKeyPart: Type.Optional(Type.String()),
603
+ k8sServices: Type.Array(serviceEntity.schema),
604
+ exitNode: Type.Boolean(),
605
+ listenPort: Type.Optional(Type.Number()),
606
+ externalIp: Type.Optional(Type.String())
585
607
  }),
586
608
  meta: {
587
609
  color: "#F44336"
@@ -678,12 +700,6 @@ const identity = defineUnit({
678
700
  * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
679
701
  */
680
702
  address: 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
703
  /**
688
704
  * The list of allowed IPs for the peer.
689
705
  *
@@ -697,7 +713,27 @@ const identity = defineUnit({
697
713
  *
698
714
  * Just an alias for the `allowedIps` with the value of `0.0.0.0/0, ::/0`.
699
715
  */
700
- exitNode: Type.Optional(Type.Boolean())
716
+ exitNode: Type.Optional(Type.Boolean()),
717
+ /**
718
+ * The port to listen on.
719
+ *
720
+ * Used by the implementation of the identity and to calculate the endpoint of the peer.
721
+ */
722
+ listenPort: Type.Optional(Type.Number()),
723
+ /**
724
+ * The external IP address of the WireGuard identity.
725
+ *
726
+ * Used by the implementation of the identity and to calculate the endpoint of the peer.
727
+ */
728
+ externalIp: Type.Optional(Type.String()),
729
+ /**
730
+ * The endpoint of the WireGuard peer.
731
+ *
732
+ * By default, the endpoint is calculated as `externalIp:listenPort`.
733
+ *
734
+ * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
735
+ */
736
+ endpoint: Type.Optional(Type.String())
701
737
  },
702
738
  secrets: {
703
739
  /**
@@ -722,6 +758,16 @@ const identity = defineUnit({
722
758
  network: {
723
759
  entity: networkEntity,
724
760
  required: false
761
+ },
762
+ /**
763
+ * The list of Kubernetes services to expose the WireGuard identity.
764
+ *
765
+ * Their IP addresses will be added to the `allowedIps` of the identity and passed to the node to set up network policies.
766
+ */
767
+ k8sServices: {
768
+ entity: serviceEntity,
769
+ multiple: true,
770
+ required: false
725
771
  }
726
772
  },
727
773
  outputs: {
@@ -743,29 +789,17 @@ const identity = defineUnit({
743
789
  const node = defineUnit({
744
790
  type: "wireguard.node",
745
791
  args: {
746
- listenPort: Type.Optional(Type.Number()),
747
- externalIp: Type.Optional(Type.String()),
748
- serviceType: Type.Optional(
749
- Type.Union([
750
- Type.Literal("NodePort"),
751
- Type.Literal("LoadBalancer"),
752
- Type.Literal("ClusterIP")
753
- ])
754
- )
792
+ appName: Type.Optional(Type.String()),
793
+ serviceType: Type.Optional(serviceTypeSchema)
755
794
  },
756
795
  inputs: {
757
796
  identity: identityEntity,
758
- k8sCluster: {
759
- entity: clusterEntity$1,
760
- required: false
761
- },
797
+ k8sCluster: clusterEntity$1,
762
798
  peers: {
763
799
  entity: peerEntity,
764
800
  multiple: true,
765
801
  required: false
766
- },
767
- innerCircuit: innerCircuitEntity,
768
- outerCircuit: outerCircuitEntity
802
+ }
769
803
  },
770
804
  meta: {
771
805
  description: "The WireGuard node running on the Kubernetes.",
@@ -834,7 +868,8 @@ const generator = defineComponent({
834
868
  address: cidr.start({ from: index, type: "addressObject" }).address
835
869
  },
836
870
  inputs: {
837
- network: inputs.network
871
+ network: inputs.network,
872
+ k8sServices: []
838
873
  }
839
874
  });
840
875
  peers.push(wgPeer);
@@ -865,39 +900,88 @@ var wireguard = /*#__PURE__*/Object.freeze({
865
900
  presharedKeyModeSchema: presharedKeyModeSchema
866
901
  });
867
902
 
868
- const mariadbEntity = defineEntity({
869
- type: "mariadb",
903
+ const repoEntity = defineEntity({
904
+ type: "restic.repo",
870
905
  schema: Type.Object({
871
- rootPassword: Type.String(),
872
- databases: Type.Array(Type.String())
906
+ password: Type.String(),
907
+ remoteDomains: Type.Array(Type.String()),
908
+ type: Type.Literal("rclone"),
909
+ rcloneConfig: Type.String(),
910
+ remoteName: Type.String(),
911
+ basePath: Type.String()
873
912
  }),
874
913
  meta: {
875
- color: "#f06292"
914
+ color: "#e56901"
876
915
  }
877
916
  });
878
- const postgresqlEntity = defineEntity({
879
- type: "postgresql",
917
+ const repo = defineUnit({
918
+ type: "restic.repo",
919
+ args: {
920
+ remoteDomains: Type.Optional(Type.Array(Type.String())),
921
+ basePath: Type.Optional(Type.String())
922
+ },
923
+ secrets: {
924
+ password: Type.Optional(Type.String()),
925
+ rcloneConfig: Type.String({ multiline: true })
926
+ },
927
+ outputs: {
928
+ repo: repoEntity
929
+ },
930
+ meta: {
931
+ primaryIconColor: "#e56901",
932
+ primaryIcon: "material-symbols:backup"
933
+ },
934
+ source: {
935
+ type: "npm",
936
+ package: "@highstate/restic",
937
+ path: "repo"
938
+ }
939
+ });
940
+
941
+ var restic = /*#__PURE__*/Object.freeze({
942
+ __proto__: null,
943
+ repo: repo,
944
+ repoEntity: repoEntity
945
+ });
946
+
947
+ const mariadbEntity = defineEntity({
948
+ type: "mariadb",
880
949
  schema: Type.Object({
950
+ host: Type.String(),
951
+ port: Type.Number(),
881
952
  rootPassword: Type.String(),
882
- databases: Type.Array(Type.String())
953
+ clusterName: Type.Optional(Type.String()),
954
+ clusterHost: Type.String(),
955
+ clusterIp: Type.String(),
956
+ fqdn: Type.Optional(Type.String())
883
957
  }),
884
958
  meta: {
885
- color: "#336791"
959
+ color: "#f06292"
886
960
  }
887
961
  });
888
962
  const mariadb = defineUnit({
889
963
  type: "apps.mariadb",
964
+ args: {
965
+ fqdn: Type.Optional(Type.String()),
966
+ appName: Type.Optional(Type.String())
967
+ },
890
968
  secrets: {
891
- rootPassword: Type.String()
969
+ rootPassword: Type.Optional(Type.String())
892
970
  },
893
971
  inputs: {
894
- k8sCluster: clusterEntity$1
972
+ k8sCluster: clusterEntity$1,
973
+ resticRepo: {
974
+ entity: repoEntity,
975
+ required: false
976
+ },
977
+ dnsProvider: {
978
+ entity: dnsProviderEntity,
979
+ required: false
980
+ }
895
981
  },
896
982
  outputs: {
897
- mariadb: {
898
- entity: mariadbEntity,
899
- displayName: "MariaDB"
900
- }
983
+ mariadb: mariadbEntity,
984
+ service: serviceEntity
901
985
  },
902
986
  meta: {
903
987
  displayName: "MariaDB",
@@ -907,23 +991,49 @@ const mariadb = defineUnit({
907
991
  },
908
992
  source: {
909
993
  type: "npm",
910
- package: "@highstate/apps",
911
- path: "mariadb"
994
+ package: "@highstate/mariadb",
995
+ path: "app"
996
+ }
997
+ });
998
+
999
+ const postgresqlEntity = defineEntity({
1000
+ type: "postgresql",
1001
+ schema: Type.Object({
1002
+ host: Type.String(),
1003
+ port: Type.Number(),
1004
+ rootPassword: Type.String(),
1005
+ clusterName: Type.Optional(Type.String()),
1006
+ clusterHost: Type.String(),
1007
+ clusterIp: Type.String(),
1008
+ fqdn: Type.Optional(Type.String())
1009
+ }),
1010
+ meta: {
1011
+ color: "#336791"
912
1012
  }
913
1013
  });
914
1014
  const postgresql = defineUnit({
915
1015
  type: "apps.postgresql",
1016
+ args: {
1017
+ fqdn: Type.Optional(Type.String()),
1018
+ appName: Type.Optional(Type.String())
1019
+ },
916
1020
  secrets: {
917
- rootPassword: Type.String()
1021
+ rootPassword: Type.Optional(Type.String())
918
1022
  },
919
1023
  inputs: {
920
- k8sCluster: clusterEntity$1
1024
+ k8sCluster: clusterEntity$1,
1025
+ resticRepo: {
1026
+ entity: repoEntity,
1027
+ required: false
1028
+ },
1029
+ dnsProvider: {
1030
+ entity: dnsProviderEntity,
1031
+ required: false
1032
+ }
921
1033
  },
922
1034
  outputs: {
923
- postgresql: {
924
- entity: postgresqlEntity,
925
- displayName: "PostgreSQL"
926
- }
1035
+ postgresql: postgresqlEntity,
1036
+ service: serviceEntity
927
1037
  },
928
1038
  meta: {
929
1039
  displayName: "PostgreSQL",
@@ -933,33 +1043,61 @@ const postgresql = defineUnit({
933
1043
  },
934
1044
  source: {
935
1045
  type: "npm",
936
- package: "@highstate/apps",
937
- path: "postgresql"
1046
+ package: "@highstate/postgresql",
1047
+ path: "app"
938
1048
  }
939
1049
  });
1050
+
940
1051
  const vaultwarden = defineUnit({
941
1052
  type: "apps.vaultwarden",
942
1053
  args: {
943
- domain: Type.String()
1054
+ fqdn: Type.String(),
1055
+ appName: Type.Optional(Type.String())
944
1056
  },
945
1057
  inputs: {
946
- mariadb: {
947
- entity: mariadbEntity,
948
- displayName: "MariaDB"
949
- },
950
- accessPoint: accessPointEntity
1058
+ mariadb: mariadbEntity,
1059
+ accessPoint: accessPointEntity,
1060
+ k8sCluster: clusterEntity$1
1061
+ },
1062
+ secrets: {
1063
+ mariadbPassword: Type.Optional(Type.String())
951
1064
  },
952
1065
  meta: {
953
1066
  displayName: "Vaultwarden",
954
1067
  description: "The Vaultwarden password manager deployed on Kubernetes.",
955
1068
  primaryIcon: "simple-icons:vaultwarden"
956
1069
  },
1070
+ source: {
1071
+ type: "npm",
1072
+ package: "@highstate/vaultwarden"
1073
+ }
1074
+ });
1075
+
1076
+ const zitadel = defineUnit({
1077
+ type: "apps.zitadel",
1078
+ args: {
1079
+ domain: Type.String()
1080
+ },
1081
+ inputs: {
1082
+ postgresql: {
1083
+ entity: postgresqlEntity,
1084
+ displayName: "PostgreSQL"
1085
+ },
1086
+ accessPoint: accessPointEntity,
1087
+ k8sCluster: clusterEntity$1
1088
+ },
1089
+ meta: {
1090
+ displayName: "Zitadel",
1091
+ description: "The Zitadel IAM deployed on Kubernetes.",
1092
+ primaryIcon: "hugeicons:access"
1093
+ },
957
1094
  source: {
958
1095
  type: "npm",
959
1096
  package: "@highstate/apps",
960
- path: "vaultwarden"
1097
+ path: "zitadel"
961
1098
  }
962
1099
  });
1100
+
963
1101
  const gitea = defineUnit({
964
1102
  type: "apps.gitea",
965
1103
  args: {
@@ -970,7 +1108,8 @@ const gitea = defineUnit({
970
1108
  entity: mariadbEntity,
971
1109
  displayName: "MariaDB"
972
1110
  },
973
- accessPoint: accessPointEntity
1111
+ accessPoint: accessPointEntity,
1112
+ k8sCluster: clusterEntity$1
974
1113
  },
975
1114
  meta: {
976
1115
  displayName: "Gitea",
@@ -983,61 +1122,135 @@ const gitea = defineUnit({
983
1122
  path: "gitea"
984
1123
  }
985
1124
  });
986
- const zitadel = defineUnit({
987
- type: "apps.zitadel",
1125
+
1126
+ const traefikGateway = defineUnit({
1127
+ type: "apps.traefik-gateway",
988
1128
  args: {
989
- domain: Type.String()
1129
+ className: Type.Optional(Type.String()),
1130
+ serviceType: Type.Optional(serviceTypeSchema)
990
1131
  },
991
1132
  inputs: {
992
- postgresql: {
993
- entity: postgresqlEntity,
994
- displayName: "PostgreSQL"
995
- },
1133
+ k8sCluster: clusterEntity$1
1134
+ },
1135
+ outputs: {
1136
+ gateway: gatewayEntity,
1137
+ service: serviceEntity
1138
+ },
1139
+ meta: {
1140
+ displayName: "Traefik Gateway",
1141
+ description: "A Traefik gateway for routing traffic to services.",
1142
+ primaryIcon: "simple-icons:traefikproxy"
1143
+ },
1144
+ source: {
1145
+ type: "npm",
1146
+ package: "@highstate/traefik",
1147
+ path: "gateway"
1148
+ }
1149
+ });
1150
+
1151
+ const kubernetesDashboard = defineUnit({
1152
+ type: "apps.kubernetes-dashboard",
1153
+ args: {
1154
+ fqdn: Type.String(),
1155
+ appName: Type.Optional(Type.String())
1156
+ },
1157
+ inputs: {
1158
+ k8sCluster: clusterEntity$1,
996
1159
  accessPoint: accessPointEntity
997
1160
  },
998
1161
  meta: {
999
- displayName: "Zitadel",
1000
- description: "The Zitadel IAM deployed on Kubernetes.",
1001
- primaryIcon: "hugeicons:access"
1162
+ displayName: "Kubernetes Dashboard",
1163
+ description: "The Kubernetes Dashboard deployed on Kubernetes.",
1164
+ primaryIcon: "simple-icons:kubernetes",
1165
+ secondaryIcon: "mdi:dashboard"
1002
1166
  },
1003
1167
  source: {
1004
1168
  type: "npm",
1005
- package: "@highstate/apps",
1006
- path: "zitadel"
1169
+ package: "@highstate/kubernetes-dashboard"
1170
+ }
1171
+ });
1172
+
1173
+ const grocy = defineUnit({
1174
+ type: "apps.grocy",
1175
+ args: {
1176
+ fqdn: Type.String(),
1177
+ appName: Type.Optional(Type.String())
1178
+ },
1179
+ inputs: {
1180
+ resticRepo: {
1181
+ entity: repoEntity,
1182
+ required: false
1183
+ },
1184
+ accessPoint: accessPointEntity,
1185
+ k8sCluster: clusterEntity$1
1186
+ },
1187
+ meta: {
1188
+ displayName: "Grocy",
1189
+ description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
1190
+ primaryIcon: "simple-icons:grocy"
1191
+ },
1192
+ source: {
1193
+ type: "npm",
1194
+ package: "@highstate/grocy"
1007
1195
  }
1008
1196
  });
1009
1197
 
1010
- var apps = /*#__PURE__*/Object.freeze({
1198
+ const maybe = defineUnit({
1199
+ type: "apps.maybe",
1200
+ args: {
1201
+ fqdn: Type.String(),
1202
+ appName: Type.Optional(Type.String())
1203
+ },
1204
+ inputs: {
1205
+ postgresql: postgresqlEntity,
1206
+ accessPoint: accessPointEntity,
1207
+ k8sCluster: clusterEntity$1,
1208
+ resticRepo: {
1209
+ entity: repoEntity,
1210
+ required: false
1211
+ }
1212
+ },
1213
+ secrets: {
1214
+ postgresqlPassword: Type.Optional(Type.String()),
1215
+ secretKey: Type.Optional(Type.String())
1216
+ },
1217
+ meta: {
1218
+ displayName: "Maybe",
1219
+ description: "The OS for your personal finances.",
1220
+ primaryIcon: "arcticons:finance-manager"
1221
+ },
1222
+ source: {
1223
+ type: "npm",
1224
+ package: "@highstate/maybe"
1225
+ }
1226
+ });
1227
+
1228
+ var index = /*#__PURE__*/Object.freeze({
1011
1229
  __proto__: null,
1012
1230
  gitea: gitea,
1231
+ grocy: grocy,
1232
+ kubernetesDashboard: kubernetesDashboard,
1013
1233
  mariadb: mariadb,
1014
1234
  mariadbEntity: mariadbEntity,
1235
+ maybe: maybe,
1015
1236
  postgresql: postgresql,
1016
1237
  postgresqlEntity: postgresqlEntity,
1238
+ traefikGateway: traefikGateway,
1017
1239
  vaultwarden: vaultwarden,
1018
1240
  zitadel: zitadel
1019
1241
  });
1020
1242
 
1021
- const connectionEntity = defineEntity({
1022
- type: "cloudflare.connection",
1023
- schema: Type.Object({
1024
- apiKey: Type.String()
1025
- }),
1026
- meta: {
1027
- color: "#f38020"
1028
- }
1029
- });
1030
1243
  const connection = defineUnit({
1031
1244
  type: "cloudflare.connection",
1032
1245
  secrets: {
1033
- apiKey: Type.String()
1246
+ apiToken: Type.String()
1034
1247
  },
1035
1248
  outputs: {
1036
- connection: connectionEntity
1249
+ dnsProvider: dnsProviderEntity
1037
1250
  },
1038
1251
  meta: {
1039
1252
  displayName: "Cloudflare Connection",
1040
- description: "Creates a new Cloudflare connection.",
1253
+ description: "Creates a new Cloudflare connection for one zone.",
1041
1254
  primaryIcon: "simple-icons:cloudflare"
1042
1255
  },
1043
1256
  source: {
@@ -1046,36 +1259,10 @@ const connection = defineUnit({
1046
1259
  path: "connection"
1047
1260
  }
1048
1261
  });
1049
- const zone = defineUnit({
1050
- type: "cloudflare.zone",
1051
- args: {
1052
- zoneId: Type.String(),
1053
- domain: Type.String()
1054
- },
1055
- inputs: {
1056
- connection: connectionEntity
1057
- },
1058
- outputs: {
1059
- dnsProvider: dnsProviderEntity
1060
- },
1061
- meta: {
1062
- displayName: "Cloudflare Zone",
1063
- description: "Creates a new Cloudflare zone.",
1064
- primaryIcon: "simple-icons:cloudflare",
1065
- secondaryIcon: "material-symbols:domain"
1066
- },
1067
- source: {
1068
- type: "npm",
1069
- package: "@highstate/cloudflare",
1070
- path: "zone"
1071
- }
1072
- });
1073
1262
 
1074
1263
  var cloudflare = /*#__PURE__*/Object.freeze({
1075
1264
  __proto__: null,
1076
- connection: connection,
1077
- connectionEntity: connectionEntity,
1078
- zone: zone
1265
+ connection: connection
1079
1266
  });
1080
1267
 
1081
1268
  const cluster = defineUnit({
@@ -1114,7 +1301,7 @@ const channelEntity = defineEntity({
1114
1301
  const obfuscatorNode = defineUnit({
1115
1302
  type: "xt-wgobfs.obfuscator",
1116
1303
  outputs: {
1117
- outerCircuit: outerCircuitEntity,
1304
+ outerCircuit: endpointEntity,
1118
1305
  channel: channelEntity
1119
1306
  },
1120
1307
  source: {
@@ -1132,7 +1319,7 @@ const deobfuscatorNode = defineUnit({
1132
1319
  channel: channelEntity
1133
1320
  },
1134
1321
  outputs: {
1135
- outerCircuit: outerCircuitEntity
1322
+ outerCircuit: endpointEntity
1136
1323
  },
1137
1324
  source: {
1138
1325
  type: "npm",
@@ -1151,4 +1338,4 @@ var xtWgobfs = /*#__PURE__*/Object.freeze({
1151
1338
  obfuscatorNode: obfuscatorNode
1152
1339
  });
1153
1340
 
1154
- export { apps, cloudflare, common, k3s, k8s, proxmox, ssh, talos, wireguard, xtWgobfs };
1341
+ export { index as apps, cloudflare, common, k3s, k8s, proxmox, restic, ssh, talos, wireguard, xtWgobfs };