@highstate/library 0.9.9 → 0.9.11
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.js +164 -38
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/apps/hubble.ts +20 -0
- package/src/apps/index.ts +1 -0
- package/src/apps/mariadb.ts +5 -0
- package/src/apps/mongodb.ts +5 -0
- package/src/apps/postgresql.ts +5 -0
- package/src/apps/syncthing.ts +8 -3
- package/src/k3s.ts +38 -0
- package/src/k8s.ts +44 -1
- package/src/proxmox.ts +19 -9
- package/dist/highstate.manifest.json +0 -5
package/dist/index.js
CHANGED
@@ -571,7 +571,8 @@ var clusterEntity = defineEntity5({
|
|
571
571
|
defaultNodeName: Type6.String(),
|
572
572
|
defaultDatastoreId: Type6.String(),
|
573
573
|
password: Type6.Optional(Type6.String()),
|
574
|
-
apiToken: Type6.Optional(Type6.String())
|
574
|
+
apiToken: Type6.Optional(Type6.String()),
|
575
|
+
sshKeyPair: Type6.Optional(keyPairEntity.schema)
|
575
576
|
}),
|
576
577
|
meta: {
|
577
578
|
color: "#e56901"
|
@@ -599,6 +600,12 @@ var connection = defineUnit4({
|
|
599
600
|
password: Type6.Optional(Type6.String()),
|
600
601
|
apiToken: Type6.Optional(Type6.String())
|
601
602
|
},
|
603
|
+
inputs: {
|
604
|
+
sshKeyPair: {
|
605
|
+
entity: keyPairEntity,
|
606
|
+
required: false
|
607
|
+
}
|
608
|
+
},
|
602
609
|
outputs: {
|
603
610
|
proxmoxCluster: clusterEntity
|
604
611
|
},
|
@@ -669,19 +676,20 @@ var virtualMachine = defineUnit4({
|
|
669
676
|
type: "proxmox.virtual-machine",
|
670
677
|
args: {
|
671
678
|
nodeName: Type6.Optional(Type6.String()),
|
672
|
-
cpuType: Type6.
|
673
|
-
cores: Type6.
|
674
|
-
sockets: Type6.
|
675
|
-
memory: Type6.
|
679
|
+
cpuType: Type6.Default(Type6.String(), "host"),
|
680
|
+
cores: Type6.Default(Type6.Number(), 1),
|
681
|
+
sockets: Type6.Default(Type6.Number(), 1),
|
682
|
+
memory: Type6.Default(Type6.Number(), 512),
|
676
683
|
ipv4: Type6.Optional(Type6.String()),
|
677
684
|
ipv4Gateway: Type6.Optional(Type6.String()),
|
678
685
|
dns: Type6.Optional(Type6.Array(Type6.String())),
|
679
686
|
datastoreId: Type6.Optional(Type6.String()),
|
680
|
-
diskSize: Type6.
|
681
|
-
bridge: Type6.
|
682
|
-
sshPort: Type6.
|
683
|
-
sshUser: Type6.
|
684
|
-
waitForAgent: Type6.
|
687
|
+
diskSize: Type6.Default(Type6.Number(), 8),
|
688
|
+
bridge: Type6.Default(Type6.String(), "vmbr0"),
|
689
|
+
sshPort: Type6.Default(Type6.Number(), 22),
|
690
|
+
sshUser: Type6.Default(Type6.String(), "root"),
|
691
|
+
waitForAgent: Type6.Default(Type6.Boolean(), true),
|
692
|
+
vendorData: Type6.Optional(Type6.String({ language: "yaml" }))
|
685
693
|
},
|
686
694
|
secrets: {
|
687
695
|
sshPassword: Type6.Optional(Type6.String())
|
@@ -715,6 +723,7 @@ __export(k8s_exports, {
|
|
715
723
|
accessPoint: () => accessPoint,
|
716
724
|
accessPointEntity: () => accessPointEntity,
|
717
725
|
certManager: () => certManager,
|
726
|
+
cilium: () => cilium,
|
718
727
|
clusterDns: () => clusterDns,
|
719
728
|
clusterEntity: () => clusterEntity2,
|
720
729
|
clusterInfoProperties: () => clusterInfoProperties,
|
@@ -890,6 +899,15 @@ var clusterInfoProperties = {
|
|
890
899
|
quirks: {
|
891
900
|
...Type7.Optional(clusterQuirksSchema),
|
892
901
|
description: `The extra quirks of the cluster to improve compatibility.`
|
902
|
+
},
|
903
|
+
/**
|
904
|
+
* The extra metadata to attach to the cluster.
|
905
|
+
*
|
906
|
+
* @schema
|
907
|
+
*/
|
908
|
+
metadata: {
|
909
|
+
...Type7.Optional(Type7.Record(Type7.String(), Type7.Unknown())),
|
910
|
+
description: `The extra metadata to attach to the cluster.`
|
893
911
|
}
|
894
912
|
};
|
895
913
|
var serviceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
|
@@ -1115,7 +1133,7 @@ var clusterPatch = defineUnit5({
|
|
1115
1133
|
}
|
1116
1134
|
});
|
1117
1135
|
var clusterDns = defineUnit5({
|
1118
|
-
type: "cluster-dns",
|
1136
|
+
type: "k8s.cluster-dns",
|
1119
1137
|
args: {
|
1120
1138
|
...createArgs(),
|
1121
1139
|
...createArgs("api")
|
@@ -1324,6 +1342,36 @@ var gatewayApi = defineUnit5({
|
|
1324
1342
|
path: "units/gateway-api"
|
1325
1343
|
}
|
1326
1344
|
});
|
1345
|
+
var cilium = defineUnit5({
|
1346
|
+
type: "k8s.cilium",
|
1347
|
+
args: {
|
1348
|
+
/**
|
1349
|
+
* If set to `true`, the generated network policy will allow
|
1350
|
+
* all DNS queries to be resolved, even if they are
|
1351
|
+
* for forbidden (non-allowed) FQDNs.
|
1352
|
+
*
|
1353
|
+
* By default, is `false`.
|
1354
|
+
*/
|
1355
|
+
allowForbiddenFqdnResolution: Type7.Default(Type7.Boolean(), false)
|
1356
|
+
},
|
1357
|
+
inputs: {
|
1358
|
+
k8sCluster: clusterEntity2
|
1359
|
+
},
|
1360
|
+
outputs: {
|
1361
|
+
k8sCluster: clusterEntity2
|
1362
|
+
},
|
1363
|
+
meta: {
|
1364
|
+
displayName: "Cilium",
|
1365
|
+
description: "The Cilium CNI deployed on Kubernetes.",
|
1366
|
+
primaryIcon: "simple-icons:cilium",
|
1367
|
+
secondaryIcon: "devicon:kubernetes",
|
1368
|
+
category: "Kubernetes"
|
1369
|
+
},
|
1370
|
+
source: {
|
1371
|
+
package: "@highstate/cilium",
|
1372
|
+
path: "unit"
|
1373
|
+
}
|
1374
|
+
});
|
1327
1375
|
|
1328
1376
|
// src/talos.ts
|
1329
1377
|
var talos_exports = {};
|
@@ -2197,6 +2245,7 @@ __export(apps_exports, {
|
|
2197
2245
|
endpointFilter: () => endpointFilter,
|
2198
2246
|
explicitEndpointFilterSchema: () => explicitEndpointFilterSchema,
|
2199
2247
|
grocy: () => grocy,
|
2248
|
+
hubble: () => hubble,
|
2200
2249
|
kubernetesDashboard: () => kubernetesDashboard,
|
2201
2250
|
mariadb: () => mariadb,
|
2202
2251
|
mariadbDatabase: () => mariadbDatabase,
|
@@ -2455,7 +2504,11 @@ var mariadb = defineUnit9({
|
|
2455
2504
|
inputs: createInputs(["resticRepo"]),
|
2456
2505
|
outputs: {
|
2457
2506
|
mariadb: mariadbEntity,
|
2458
|
-
service: serviceEntity
|
2507
|
+
service: serviceEntity,
|
2508
|
+
endpoints: {
|
2509
|
+
entity: l4EndpointEntity,
|
2510
|
+
multiple: true
|
2511
|
+
}
|
2459
2512
|
},
|
2460
2513
|
meta: {
|
2461
2514
|
displayName: "MariaDB",
|
@@ -2506,7 +2559,11 @@ var postgresql = defineUnit10({
|
|
2506
2559
|
inputs: createInputs(["resticRepo", "dnsProviders"]),
|
2507
2560
|
outputs: {
|
2508
2561
|
postgresql: postgresqlEntity,
|
2509
|
-
service: serviceEntity
|
2562
|
+
service: serviceEntity,
|
2563
|
+
endpoints: {
|
2564
|
+
entity: l4EndpointEntity,
|
2565
|
+
multiple: true
|
2566
|
+
}
|
2510
2567
|
},
|
2511
2568
|
meta: {
|
2512
2569
|
displayName: "PostgreSQL",
|
@@ -2575,7 +2632,11 @@ var mongodb = defineUnit12({
|
|
2575
2632
|
inputs: createInputs(["resticRepo"]),
|
2576
2633
|
outputs: {
|
2577
2634
|
mongodb: mongodbEntity,
|
2578
|
-
service: serviceEntity
|
2635
|
+
service: serviceEntity,
|
2636
|
+
endpoints: {
|
2637
|
+
entity: l4EndpointEntity,
|
2638
|
+
multiple: true
|
2639
|
+
}
|
2579
2640
|
},
|
2580
2641
|
meta: {
|
2581
2642
|
displayName: "MongoDB",
|
@@ -2888,7 +2949,7 @@ var backupModeSchema = Type21.StringEnum(["state", "full"]);
|
|
2888
2949
|
var syncthing = defineUnit20({
|
2889
2950
|
type: "apps.syncthing",
|
2890
2951
|
args: {
|
2891
|
-
...createArgs2("syncthing", ["fqdn"]),
|
2952
|
+
...createArgs2("syncthing", ["fqdn", "external"]),
|
2892
2953
|
/**
|
2893
2954
|
* The FQDN of the Syncthing instance used to sync with other devices.
|
2894
2955
|
*
|
@@ -2908,10 +2969,14 @@ var syncthing = defineUnit20({
|
|
2908
2969
|
backupMode: Type21.Default(backupModeSchema, "state")
|
2909
2970
|
},
|
2910
2971
|
secrets: createSecrets(["backupPassword"]),
|
2911
|
-
inputs: createInputs(["accessPoint", "resticRepo", "
|
2972
|
+
inputs: createInputs(["accessPoint", "resticRepo", "volume"]),
|
2912
2973
|
outputs: {
|
2974
|
+
volume: persistentVolumeClaimEntity,
|
2913
2975
|
service: serviceEntity,
|
2914
|
-
|
2976
|
+
endpoints: {
|
2977
|
+
entity: l4EndpointEntity,
|
2978
|
+
multiple: true
|
2979
|
+
}
|
2915
2980
|
},
|
2916
2981
|
meta: {
|
2917
2982
|
displayName: "Syncthing",
|
@@ -2949,13 +3014,29 @@ var codeServer = defineUnit21({
|
|
2949
3014
|
}
|
2950
3015
|
});
|
2951
3016
|
|
3017
|
+
// src/apps/hubble.ts
|
3018
|
+
import { defineUnit as defineUnit22 } from "@highstate/contract";
|
3019
|
+
var hubble = defineUnit22({
|
3020
|
+
type: "apps.hubble",
|
3021
|
+
args: createArgs2("hubble", ["fqdn"]),
|
3022
|
+
inputs: createInputs(["accessPoint"]),
|
3023
|
+
meta: {
|
3024
|
+
displayName: "Hubble",
|
3025
|
+
description: "Exposes Hubble UI to the user. It must be already installed in the cluster as part of the Cilium.",
|
3026
|
+
primaryIcon: "mdi:eye",
|
3027
|
+
secondaryIcon: "simple-icons:cilium",
|
3028
|
+
category: "Observability"
|
3029
|
+
},
|
3030
|
+
source: createSource("hubble")
|
3031
|
+
});
|
3032
|
+
|
2952
3033
|
// src/cloudflare.ts
|
2953
3034
|
var cloudflare_exports = {};
|
2954
3035
|
__export(cloudflare_exports, {
|
2955
3036
|
connection: () => connection2
|
2956
3037
|
});
|
2957
|
-
import { defineUnit as
|
2958
|
-
var connection2 =
|
3038
|
+
import { defineUnit as defineUnit23, Type as Type23 } from "@highstate/contract";
|
3039
|
+
var connection2 = defineUnit23({
|
2959
3040
|
type: "cloudflare.connection",
|
2960
3041
|
secrets: {
|
2961
3042
|
apiToken: Type23.String()
|
@@ -2978,12 +3059,57 @@ var connection2 = defineUnit22({
|
|
2978
3059
|
// src/k3s.ts
|
2979
3060
|
var k3s_exports = {};
|
2980
3061
|
__export(k3s_exports, {
|
2981
|
-
cluster: () => cluster2
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
3062
|
+
cluster: () => cluster2,
|
3063
|
+
cniSchema: () => cniSchema3,
|
3064
|
+
componentSchema: () => componentSchema,
|
3065
|
+
internalComponents: () => internalComponents,
|
3066
|
+
packagedComponents: () => packagedComponents
|
3067
|
+
});
|
3068
|
+
import { defineUnit as defineUnit24, Type as Type24 } from "@highstate/contract";
|
3069
|
+
var packagedComponents = [
|
3070
|
+
"coredns",
|
3071
|
+
"servicelb",
|
3072
|
+
"traefik",
|
3073
|
+
"local-storage",
|
3074
|
+
"metrics-server",
|
3075
|
+
"runtimes"
|
3076
|
+
];
|
3077
|
+
var internalComponents = [
|
3078
|
+
"scheduler",
|
3079
|
+
"cloud-controller",
|
3080
|
+
"kube-proxy",
|
3081
|
+
"network-policy",
|
3082
|
+
"helm-controller"
|
3083
|
+
];
|
3084
|
+
var componentSchema = Type24.StringEnum([...packagedComponents, ...internalComponents]);
|
3085
|
+
var cniSchema3 = Type24.StringEnum(["none", "flannel"]);
|
3086
|
+
var cluster2 = defineUnit24({
|
2985
3087
|
type: "k3s.cluster",
|
2986
3088
|
args: {
|
3089
|
+
/**
|
3090
|
+
* The components to disable in the K3S cluster.
|
3091
|
+
*
|
3092
|
+
* @schema
|
3093
|
+
*/
|
3094
|
+
disabledComponents: {
|
3095
|
+
...Type24.Default(Type24.Array(componentSchema), []),
|
3096
|
+
description: `The components to disable in the K3S cluster.`
|
3097
|
+
},
|
3098
|
+
/**
|
3099
|
+
* The CNI to use in the K3S cluster.
|
3100
|
+
*
|
3101
|
+
* Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
|
3102
|
+
* If needed, you can disable them using `disabledComponents` argument.
|
3103
|
+
*
|
3104
|
+
* @schema
|
3105
|
+
*/
|
3106
|
+
cni: {
|
3107
|
+
...Type24.Default(cniSchema3, "flannel"),
|
3108
|
+
description: `The CNI to use in the K3S cluster.
|
3109
|
+
|
3110
|
+
Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
|
3111
|
+
If needed, you can disable them using \`disabledComponents\` argument.`
|
3112
|
+
},
|
2987
3113
|
/**
|
2988
3114
|
* The K3S configuration to pass to each server or agent in the cluster.
|
2989
3115
|
*
|
@@ -3031,8 +3157,8 @@ var mullvad_exports = {};
|
|
3031
3157
|
__export(mullvad_exports, {
|
3032
3158
|
peer: () => peer2
|
3033
3159
|
});
|
3034
|
-
import { defineUnit as
|
3035
|
-
var peer2 =
|
3160
|
+
import { defineUnit as defineUnit25, Type as Type25 } from "@highstate/contract";
|
3161
|
+
var peer2 = defineUnit25({
|
3036
3162
|
type: "mullvad.peer",
|
3037
3163
|
args: {
|
3038
3164
|
hostname: Type25.Optional(Type25.String()),
|
@@ -3092,7 +3218,7 @@ __export(timeweb_exports, {
|
|
3092
3218
|
connectionEntity: () => connectionEntity,
|
3093
3219
|
virtualMachine: () => virtualMachine2
|
3094
3220
|
});
|
3095
|
-
import { defineEntity as defineEntity13, defineUnit as
|
3221
|
+
import { defineEntity as defineEntity13, defineUnit as defineUnit26, Type as Type26 } from "@highstate/contract";
|
3096
3222
|
var connectionEntity = defineEntity13({
|
3097
3223
|
type: "timeweb.connection",
|
3098
3224
|
schema: Type26.Object({
|
@@ -3100,7 +3226,7 @@ var connectionEntity = defineEntity13({
|
|
3100
3226
|
apiToken: Type26.String()
|
3101
3227
|
})
|
3102
3228
|
});
|
3103
|
-
var connection3 =
|
3229
|
+
var connection3 = defineUnit26({
|
3104
3230
|
type: "timeweb.connection",
|
3105
3231
|
secrets: {
|
3106
3232
|
apiToken: Type26.String()
|
@@ -3119,7 +3245,7 @@ var connection3 = defineUnit25({
|
|
3119
3245
|
path: "connection"
|
3120
3246
|
}
|
3121
3247
|
});
|
3122
|
-
var virtualMachine2 =
|
3248
|
+
var virtualMachine2 = defineUnit26({
|
3123
3249
|
type: "timeweb.virtual-machine",
|
3124
3250
|
args: {
|
3125
3251
|
presetId: Type26.Optional(Type26.Number()),
|
@@ -3162,7 +3288,7 @@ __export(nixos_exports, {
|
|
3162
3288
|
remoteFlake: () => remoteFlake,
|
3163
3289
|
system: () => system
|
3164
3290
|
});
|
3165
|
-
import { defineEntity as defineEntity14, defineUnit as
|
3291
|
+
import { defineEntity as defineEntity14, defineUnit as defineUnit27, Type as Type27 } from "@highstate/contract";
|
3166
3292
|
var inlineModuleEntity = defineEntity14({
|
3167
3293
|
type: "nixos.inline-module",
|
3168
3294
|
schema: Type27.Object({
|
@@ -3174,7 +3300,7 @@ var inlineModuleEntity = defineEntity14({
|
|
3174
3300
|
color: "#5277c3"
|
3175
3301
|
}
|
3176
3302
|
});
|
3177
|
-
var inlineModule =
|
3303
|
+
var inlineModule = defineUnit27({
|
3178
3304
|
type: "nixos.inline-module",
|
3179
3305
|
args: {
|
3180
3306
|
code: Type27.String({ language: "nix" })
|
@@ -3213,7 +3339,7 @@ var flakeEntity = defineEntity14({
|
|
3213
3339
|
color: "#5277c3"
|
3214
3340
|
}
|
3215
3341
|
});
|
3216
|
-
var remoteFlake =
|
3342
|
+
var remoteFlake = defineUnit27({
|
3217
3343
|
type: "nixos.remote-flake",
|
3218
3344
|
args: {
|
3219
3345
|
url: Type27.String()
|
@@ -3235,7 +3361,7 @@ var remoteFlake = defineUnit26({
|
|
3235
3361
|
path: "flake"
|
3236
3362
|
}
|
3237
3363
|
});
|
3238
|
-
var inlineFlake =
|
3364
|
+
var inlineFlake = defineUnit27({
|
3239
3365
|
type: "nixos.inline-flake",
|
3240
3366
|
args: {
|
3241
3367
|
code: Type27.String({ language: "nix" })
|
@@ -3273,7 +3399,7 @@ var inlineFlake = defineUnit26({
|
|
3273
3399
|
path: "inline-flake"
|
3274
3400
|
}
|
3275
3401
|
});
|
3276
|
-
var system =
|
3402
|
+
var system = defineUnit27({
|
3277
3403
|
type: "nixos.system",
|
3278
3404
|
args: {
|
3279
3405
|
system: Type27.Optional(Type27.String())
|
@@ -3309,8 +3435,8 @@ var sops_exports = {};
|
|
3309
3435
|
__export(sops_exports, {
|
3310
3436
|
secrets: () => secrets
|
3311
3437
|
});
|
3312
|
-
import { defineUnit as
|
3313
|
-
var secrets =
|
3438
|
+
import { defineUnit as defineUnit28, Type as Type28 } from "@highstate/contract";
|
3439
|
+
var secrets = defineUnit28({
|
3314
3440
|
type: "sops.secrets",
|
3315
3441
|
args: {
|
3316
3442
|
secrets: Type28.Record(Type28.String(), Type28.Any())
|
@@ -3511,8 +3637,8 @@ __export(phantun_exports, {
|
|
3511
3637
|
deobfuscator: () => deobfuscator,
|
3512
3638
|
obfuscator: () => obfuscator
|
3513
3639
|
});
|
3514
|
-
import { defineUnit as
|
3515
|
-
var deobfuscator =
|
3640
|
+
import { defineUnit as defineUnit29 } from "@highstate/contract";
|
3641
|
+
var deobfuscator = defineUnit29({
|
3516
3642
|
type: "obfuscators.phantun.deobfuscator",
|
3517
3643
|
...deobfuscatorSpec,
|
3518
3644
|
meta: {
|
@@ -3527,7 +3653,7 @@ var deobfuscator = defineUnit28({
|
|
3527
3653
|
path: "phantun/deobfuscator"
|
3528
3654
|
}
|
3529
3655
|
});
|
3530
|
-
var obfuscator =
|
3656
|
+
var obfuscator = defineUnit29({
|
3531
3657
|
type: "obfuscators.phantun.obfuscator",
|
3532
3658
|
...obfuscatorSpec,
|
3533
3659
|
meta: {
|