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