@highstate/library 0.9.9 → 0.9.10

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 CHANGED
@@ -2455,7 +2455,11 @@ var mariadb = defineUnit9({
2455
2455
  inputs: createInputs(["resticRepo"]),
2456
2456
  outputs: {
2457
2457
  mariadb: mariadbEntity,
2458
- service: serviceEntity
2458
+ service: serviceEntity,
2459
+ endpoints: {
2460
+ entity: l4EndpointEntity,
2461
+ multiple: true
2462
+ }
2459
2463
  },
2460
2464
  meta: {
2461
2465
  displayName: "MariaDB",
@@ -2506,7 +2510,11 @@ var postgresql = defineUnit10({
2506
2510
  inputs: createInputs(["resticRepo", "dnsProviders"]),
2507
2511
  outputs: {
2508
2512
  postgresql: postgresqlEntity,
2509
- service: serviceEntity
2513
+ service: serviceEntity,
2514
+ endpoints: {
2515
+ entity: l4EndpointEntity,
2516
+ multiple: true
2517
+ }
2510
2518
  },
2511
2519
  meta: {
2512
2520
  displayName: "PostgreSQL",
@@ -2575,7 +2583,11 @@ var mongodb = defineUnit12({
2575
2583
  inputs: createInputs(["resticRepo"]),
2576
2584
  outputs: {
2577
2585
  mongodb: mongodbEntity,
2578
- service: serviceEntity
2586
+ service: serviceEntity,
2587
+ endpoints: {
2588
+ entity: l4EndpointEntity,
2589
+ multiple: true
2590
+ }
2579
2591
  },
2580
2592
  meta: {
2581
2593
  displayName: "MongoDB",
@@ -2888,7 +2900,7 @@ var backupModeSchema = Type21.StringEnum(["state", "full"]);
2888
2900
  var syncthing = defineUnit20({
2889
2901
  type: "apps.syncthing",
2890
2902
  args: {
2891
- ...createArgs2("syncthing", ["fqdn"]),
2903
+ ...createArgs2("syncthing", ["fqdn", "external"]),
2892
2904
  /**
2893
2905
  * The FQDN of the Syncthing instance used to sync with other devices.
2894
2906
  *
@@ -2908,10 +2920,14 @@ var syncthing = defineUnit20({
2908
2920
  backupMode: Type21.Default(backupModeSchema, "state")
2909
2921
  },
2910
2922
  secrets: createSecrets(["backupPassword"]),
2911
- inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
2923
+ inputs: createInputs(["accessPoint", "resticRepo", "volume"]),
2912
2924
  outputs: {
2925
+ volume: persistentVolumeClaimEntity,
2913
2926
  service: serviceEntity,
2914
- volume: persistentVolumeClaimEntity
2927
+ endpoints: {
2928
+ entity: l4EndpointEntity,
2929
+ multiple: true
2930
+ }
2915
2931
  },
2916
2932
  meta: {
2917
2933
  displayName: "Syncthing",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/ssh.ts","../src/network.ts","../src/dns.ts","../src/utils.ts","../src/proxmox.ts","../src/k8s.ts","../src/talos.ts","../src/wireguard.ts","../src/apps/index.ts","../src/apps/mariadb.ts","../src/apps/shared.ts","../src/restic.ts","../src/apps/postgresql.ts","../src/apps/vaultwarden.ts","../src/apps/mongodb.ts","../src/apps/network.ts","../src/apps/dns.ts","../src/apps/traefik.ts","../src/apps/kubernetes-dashboard.ts","../src/apps/grocy.ts","../src/apps/maybe.ts","../src/apps/deployment.ts","../src/apps/syncthing.ts","../src/apps/code-server.ts","../src/cloudflare.ts","../src/k3s.ts","../src/mullvad.ts","../src/timeweb.ts","../src/nixos.ts","../src/sops.ts","../src/obfuscators/index.ts","../src/obfuscators/shared.ts","../src/obfuscators/phantun.ts"],"sourcesContent":["import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { credentialsSchema, keyPairEntity } from \"./ssh\"\nimport { l3EndpointEntity } from \"./network\"\nimport * as dns from \"./dns\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const serverEntity = defineEntity({\n type: \"common.server\",\n\n schema: Type.Object({\n hostname: Type.String(),\n endpoints: Type.Array(l3EndpointEntity.schema),\n ssh: Type.Optional(credentialsSchema),\n }),\n\n meta: {\n color: \"#009688\",\n },\n})\n\nexport const serverOutputs = {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n} as const\n\nexport const existingServer = defineUnit({\n type: \"common.existing-server\",\n\n args: {\n /**\n * The endpoint of the server.\n *\n * Takes precedence over the `endpoint` input.\n */\n endpoint: Type.Optional(Type.String()),\n\n /**\n * The SSH user to use for connecting to the server.\n */\n sshUser: Type.Default(Type.String(), \"root\"),\n\n /**\n * The SSH port to use for connecting to the server.\n */\n sshPort: Type.Default(Type.Number(), 22),\n },\n\n secrets: {\n sshPassword: Type.Optional(Type.String()),\n sshPrivateKey: Type.Optional(Type.String()),\n },\n\n inputs: {\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n endpoint: {\n entity: l3EndpointEntity,\n required: false,\n },\n },\n\n outputs: serverOutputs,\n\n meta: {\n displayName: \"Existing Server\",\n description: \"An existing server that can be used in the configuration.\",\n primaryIcon: \"mdi:server\",\n defaultNamePrefix: \"server\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/existing-server\",\n },\n})\n\nexport const serverPatch = defineUnit({\n type: \"common.server-patch\",\n\n args: {\n /**\n * The endpoints of the server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same server may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the server.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same server may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n },\n\n inputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Server Patch\",\n description: \"Patches some properties of the server.\",\n primaryIcon: \"mdi:server\",\n secondaryIcon: \"fluent:patch-20-filled\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/server-patch\",\n },\n})\n\nexport const serverDns = defineUnit({\n type: \"common.server-dns\",\n\n args: dns.createArgs(),\n\n inputs: {\n server: serverEntity,\n ...dns.inputs,\n },\n\n outputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Server DNS\",\n description: \"Creates DNS records for the server and updates endpoints.\",\n primaryIcon: \"mdi:server\",\n secondaryIcon: \"mdi:dns\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/server-dns\",\n },\n})\n\nexport const script = defineUnit({\n type: \"common.script\",\n\n args: {\n script: Type.String({ language: \"shell\" }),\n updateScript: Type.Optional(Type.String({ language: \"shell\" })),\n deleteScript: Type.Optional(Type.String({ language: \"shell\" })),\n },\n\n inputs: {\n server: serverEntity,\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"Shell Script\",\n description: \"Run a shell script on the server.\",\n primaryIcon: \"mdi:bash\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/script\",\n },\n})\n\nexport const fileMetaEntity = defineEntity({\n type: \"common.file-meta\",\n\n schema: Type.Object({\n name: Type.String(),\n size: Type.Number(),\n mode: Type.Number(),\n isBinary: Type.Optional(Type.Boolean()),\n }),\n\n meta: {\n color: \"#FF5722\",\n description: \"Metadata for a file.\",\n },\n})\n\nexport const fileContentEntity = defineEntity({\n type: \"common.file-content\",\n\n schema: Type.Union([\n Type.Object({\n type: Type.Literal(\"inline\"),\n content: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"remote\"),\n url: Type.String(),\n }),\n ]),\n\n meta: {\n color: \"#FF5722\",\n description: \"The content of a file.\",\n },\n})\n\nexport const fileEntity = defineEntity({\n type: \"common.file\",\n\n schema: Type.Object({\n meta: fileMetaEntity.schema,\n content: fileContentEntity.schema,\n }),\n\n meta: {\n color: \"#FF5722\",\n },\n})\n\nexport type Server = Static<typeof serverEntity.schema>\n\nexport type File = Static<typeof fileEntity.schema>\nexport type FileMeta = Static<typeof fileMetaEntity.schema>\nexport type FileContent = Static<typeof fileContentEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { l4EndpointEntity } from \"./network\"\n\nexport const keyTypeSchema = Type.StringEnum([\"ed25519\"])\n\nexport const keyPairEntity = defineEntity({\n type: \"ssh.key-pair\",\n\n schema: Type.Object({\n type: keyTypeSchema,\n fingerprint: Type.String(),\n publicKey: Type.String(),\n privateKey: Type.String(),\n }),\n\n meta: {\n color: \"#2b5797\",\n },\n})\n\nexport const credentialsSchema = Type.Object({\n endpoints: Type.Array(l4EndpointEntity.schema),\n hostKey: Type.String(),\n user: Type.String(),\n password: Type.Optional(Type.String()),\n keyPair: Type.Optional(keyPairEntity.schema),\n})\n\nexport const keyPair = defineUnit({\n type: \"ssh.key-pair\",\n\n secrets: {\n privateKey: Type.Optional(Type.String()),\n },\n\n outputs: {\n keyPair: keyPairEntity,\n },\n\n meta: {\n displayName: \"SSH Key Pair\",\n description: \"Holds the ED25519 SSH key pair and generates the private key if not provided.\",\n category: \"ssh\",\n primaryIcon: \"charm:key\",\n primaryIconColor: \"#ffffff\",\n secondaryIcon: \"mdi:lock\",\n secondaryIconColor: \"#ffffff\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/ssh/key-pair\",\n },\n})\n\nexport type KeyType = Static<typeof keyTypeSchema>\nexport type Credentials = Static<typeof credentialsSchema>\nexport type KeyPair = Static<typeof keyPairEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\n\nexport const endpointVisibilitySchema = Type.StringEnum([\n \"public\", // Reachable from the public internet\n \"external\", // Reachable from outside the system boundary, but not public\n \"internal\", // Reachable only from within the system or cluster\n])\n\nexport const endpointFilterSchema = Type.Array(endpointVisibilitySchema)\n\nexport const l3EndpointEntity = defineEntity({\n type: \"network.l3-endpoint\",\n\n schema: Type.Intersect([\n Type.Object({\n visibility: endpointVisibilitySchema,\n metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n }),\n Type.Union([\n Type.Object({\n type: Type.Literal(\"hostname\"),\n\n /**\n * The hostname of the endpoint in the format of a domain name.\n */\n hostname: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"ipv4\"),\n\n /**\n * The IPv4 address of the endpoint.\n */\n address: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"ipv6\"),\n\n /**\n * The IPv6 address of the endpoint.\n */\n address: Type.String(),\n }),\n ]),\n ]),\n\n meta: {\n color: \"#4CAF50\",\n description: \"The L3 endpoint for some service. May be a domain name or an IP address.\",\n },\n})\n\nexport const l4ProtocolSchema = Type.StringEnum([\"tcp\", \"udp\"])\n\nexport const portInfoSchema = Type.Object({\n port: Type.Number(),\n protocol: l4ProtocolSchema,\n})\n\nexport const l4EndpointEntity = defineEntity({\n type: \"network.l4-endpoint\",\n\n schema: Type.Intersect([l3EndpointEntity.schema, portInfoSchema]),\n\n meta: {\n color: \"#2196F3\",\n description: \"The L4 endpoint for some service. Extends an L3 endpoint with a port.\",\n },\n})\n\nexport const l3Endpoint = defineUnit({\n type: \"network.l3-endpoint\",\n\n args: {\n /**\n * The string representation of the endpoint.\n *\n * May be a domain name or an IP address.\n */\n endpoint: Type.String(),\n\n /**\n * The visibility of the endpoint.\n */\n visibility: Type.Default(endpointVisibilitySchema, \"public\"),\n },\n\n outputs: {\n endpoint: l3EndpointEntity,\n },\n\n meta: {\n displayName: \"L3 Endpoint\",\n description: \"An L3 endpoint for some service. May be a domain name or an IP address.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#4CAF50\",\n defaultNamePrefix: \"endpoint\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/network/l3-endpoint\",\n },\n})\n\nexport const l4Endpoint = defineUnit({\n type: \"network.l4-endpoint\",\n\n args: {\n /**\n * The string representation of the endpoint.\n *\n * May be a domain name or an IP address + port/protocol.\n *\n * The possible formats are:\n *\n * - `endpoint:port` (TCP by default)\n * - `tcp://endpoint:port`\n * - `udp://endpoint:port`\n */\n endpoint: Type.String(),\n\n /**\n * The visibility of the endpoint.\n */\n visibility: Type.Default(endpointVisibilitySchema, \"public\"),\n },\n\n outputs: {\n endpoint: l4EndpointEntity,\n },\n\n meta: {\n displayName: \"L4 Endpoint\",\n description: \"An L4 endpoint for some service. Extends an L3 endpoint with a port.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#2196F3\",\n defaultNamePrefix: \"endpoint\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/network/l4-endpoint\",\n },\n})\n\n/**\n * The generic visibility of an endpoint.\n *\n * - `public`: Reachable from the public internet.\n * - `external`: Reachable from outside the system boundary (e.g., LAN, VPC), but not public.\n * - `internal`: Reachable only from within the application or infrastructure boundary (e.g., within a cluster).\n */\nexport type EndpointVisibility = Static<typeof endpointVisibilitySchema>\n\n/**\n * Filter values used to select relevant endpoints based on visibility.\n *\n * - `public`: Only endpoints exposed to the public internet.\n * - `private`: Endpoints not publicly accessible (external + internal).\n * - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).\n * - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).\n * - `most`: Select the most widely accessible endpoints, preferring visibility in the following order: `public` > `external` > `internal`.\n * - If any public endpoints exist, all public endpoints are selected.\n * - Otherwise, if any external endpoints exist, all external endpoints are selected.\n * - If neither exist, all internal endpoints are selected.\n */\nexport type EndpointFilter = Static<typeof endpointFilterSchema>\n\nexport type L3Endpoint = Static<typeof l3EndpointEntity.schema>\nexport type L4Endpoint = Static<typeof l4EndpointEntity.schema>\nexport type L4Protocol = Static<typeof l4ProtocolSchema>\nexport type L4PortInfo = Static<typeof portInfoSchema>\n\n/**\n * The L3 or L4 endpoint for some service.\n */\nexport type L34Endpoint = (L3Endpoint & { port?: undefined; protocol?: undefined }) | L4Endpoint\n","import { defineEntity, Type, type Static } from \"@highstate/contract\"\nimport { endpointFilterSchema } from \"./network\"\nimport { arrayPatchModeSchema, prefixKeysWith } from \"./utils\"\n\nexport const providerEntity = defineEntity({\n type: \"dns.provider\",\n\n schema: Type.Object({\n name: Type.String(),\n type: Type.String(),\n data: Type.Record(Type.String(), Type.Unknown()),\n domain: Type.String(),\n }),\n\n meta: {\n color: \"#FF5722\",\n },\n})\n\nexport function createArgs<TPrefix extends string = \"\">(prefix?: TPrefix) {\n return prefixKeysWith(prefix, {\n /**\n * The FQDN to register the existing endpoints with.\n *\n * Will be inserted at the beginning of the resulting endpoint list.\n *\n * Will throw an error if no matching provider is found.\n *\n * @schema\n */\n fqdn: {\n ...Type.Optional(Type.String()),\n description: `The FQDN to register the existing endpoints with.\n\n Will be inserted at the beginning of the resulting endpoint list.\n\n Will throw an error if no matching provider is found.`,\n},\n\n /**\n * The endpoint filter to filter the endpoints before creating the DNS records.\n *\n * Possible values:\n *\n * - `public`: Only endpoints exposed to the public internet.\n * - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).\n * - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).\n *\n * You can select one or more values.\n *\n * If no value is provided, the endpoints will be filtered by the most accessible type:\n *\n * - If any public endpoints exist, all public endpoints are selected;\n * - Otherwise, if any external endpoints exist, all external endpoints are selected;\n * - If neither exist, all internal endpoints are selected.\n *\n * @schema\n */\n endpointFilter: {\n ...Type.Default(endpointFilterSchema, []),\n description: `The endpoint filter to filter the endpoints before creating the DNS records.\n\n Possible values:\n\n - \\`public\\`: Only endpoints exposed to the public internet.\n - \\`external\\`: Reachable from outside the system but not public (e.g., LAN, VPC).\n - \\`internal\\`: Reachable only from within the system boundary (e.g., inside a cluster).\n\n You can select one or more values.\n\n If no value is provided, the endpoints will be filtered by the most accessible type:\n\n - If any public endpoints exist, all public endpoints are selected;\n - Otherwise, if any external endpoints exist, all external endpoints are selected;\n - If neither exist, all internal endpoints are selected.`,\n},\n\n /**\n * The mode to use for patching the existing endpoints.\n *\n * - `prepend`: Prepend the FQDN to the existing endpoints. It will make them prioritized.\n * - `replace`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.\n *\n * The default is `prepend`.\n *\n * @schema\n */\n patchMode: {\n ...Type.Default(arrayPatchModeSchema, \"prepend\"),\n description: `The mode to use for patching the existing endpoints.\n\n - \\`prepend\\`: Prepend the FQDN to the existing endpoints. It will make them prioritized.\n - \\`replace\\`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.\n\n The default is \\`prepend\\`.`,\n},\n })\n}\n\nexport const inputs = {\n /**\n * The DNS providers to use to create the DNS records.\n *\n * If multiple providers match the domain, all of them will be used and multiple DNS records will be created.\n *\n * @schema\n */\n dnsProviders: {\n ...{\n entity: providerEntity,\n multiple: true,\n },\n description: `The DNS providers to use to create the DNS records.\n\n If multiple providers match the domain, all of them will be used and multiple DNS records will be created.`,\n},\n} as const\n\nexport type Provider = Static<typeof providerEntity.schema>\n","import { Type, type Static } from \"@highstate/contract\"\n\ntype PrefixWith<TString extends string, TPrefix extends string> = TPrefix extends \"\"\n ? TString\n : `${TPrefix}${Capitalize<TString>}`\n\nfunction prefixWith<TString extends string, TPrefix extends string>(\n string: TString,\n prefix?: TPrefix,\n): PrefixWith<TString, TPrefix> {\n return (\n prefix ? `${prefix}${string.charAt(0).toUpperCase()}${string.slice(1)}` : string\n ) as PrefixWith<TString, TPrefix>\n}\n\ntype PrefixedKeys<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as PrefixWith<Extract<K, string>, Prefix>]: T[K]\n}\n\nexport function prefixKeysWith<T extends Record<string, unknown>, Prefix extends string>(\n prefix: Prefix | undefined,\n obj: T,\n): PrefixedKeys<T, Prefix> {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [prefixWith(key, prefix), value]),\n ) as PrefixedKeys<T, Prefix>\n}\n\nexport const arrayPatchModeSchema = Type.StringEnum([\"prepend\", \"replace\"])\n\n/**\n * The mode to use when patching some array.\n *\n * - `prepend`: Prepend the values of the new array to the existing array.\n * - `replace`: Replace the existing array with the new array.\n */\nexport type ArrayPatchMode = Static<typeof arrayPatchModeSchema>\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { serverOutputs } from \"./common\"\nimport { keyPairEntity } from \"./ssh\"\n\nexport const clusterEntity = defineEntity({\n type: \"proxmox.cluster\",\n\n schema: Type.Object({\n endpoint: Type.String(),\n insecure: Type.Optional(Type.Boolean()),\n username: Type.Optional(Type.String()),\n\n defaultNodeName: Type.String(),\n defaultDatastoreId: Type.String(),\n\n password: Type.Optional(Type.String()),\n apiToken: Type.Optional(Type.String()),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const imageEntity = defineEntity({\n type: \"proxmox.image\",\n\n schema: Type.Object({\n id: Type.String(),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const connection = defineUnit({\n type: \"proxmox.connection\",\n\n args: {\n endpoint: Type.String(),\n insecure: Type.Optional(Type.Boolean()),\n username: Type.Optional(Type.String()),\n\n defaultNodeName: Type.Optional(Type.String()),\n defaultDatastoreId: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n apiToken: Type.Optional(Type.String()),\n },\n\n outputs: {\n proxmoxCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Proxmox Connection\",\n description: \"The connection to an existing Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"connection\",\n },\n})\n\nexport const image = defineUnit({\n type: \"proxmox.image\",\n\n args: {\n url: Type.String(),\n nodeName: Type.Optional(Type.String()),\n sha256: Type.Optional(Type.String()),\n datastoreId: Type.Optional(Type.String()),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n },\n\n outputs: {\n image: imageEntity,\n },\n\n meta: {\n displayName: \"Proxmox Image\",\n description: \"The image to upload to a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"mage:compact-disk-fill\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"image\",\n },\n})\n\nexport const existingImage = defineUnit({\n type: \"proxmox.existing-image\",\n\n args: {\n id: Type.String(),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n },\n\n outputs: {\n image: imageEntity,\n },\n\n meta: {\n displayName: \"Proxmox Existing Image\",\n description: \"The existing image on a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"mage:compact-disk-fill\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"existing-image\",\n },\n})\n\nexport const virtualMachine = defineUnit({\n type: \"proxmox.virtual-machine\",\n\n args: {\n nodeName: Type.Optional(Type.String()),\n\n cpuType: Type.Optional(Type.String({ default: \"host\" })),\n cores: Type.Optional(Type.Number({ default: 1 })),\n sockets: Type.Optional(Type.Number({ default: 1 })),\n memory: Type.Optional(Type.Number({ default: 512 })),\n\n ipv4: Type.Optional(Type.String()),\n ipv4Gateway: Type.Optional(Type.String()),\n dns: Type.Optional(Type.Array(Type.String())),\n\n datastoreId: Type.Optional(Type.String()),\n diskSize: Type.Optional(Type.Number({ default: 8 })),\n bridge: Type.Optional(Type.String({ default: \"vmbr0\" })),\n\n sshPort: Type.Optional(Type.Number({ default: 22 })),\n sshUser: Type.Optional(Type.String({ default: \"root\" })),\n\n waitForAgent: Type.Optional(Type.Boolean({ default: true })),\n },\n\n secrets: {\n sshPassword: Type.Optional(Type.String()),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n image: imageEntity,\n\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n },\n\n outputs: serverOutputs,\n\n meta: {\n displayName: \"Proxmox Virtual Machine\",\n description: \"The virtual machine on a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"codicon:vm\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"virtual-machine\",\n },\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { Literal } from \"@sinclair/typebox\"\nimport * as dns from \"./dns\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\nimport { serverEntity } from \"./common\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const fallbackKubeApiAccessSchema = Type.Object({\n serverIp: Type.String(),\n serverPort: Type.Number(),\n})\n\nexport const tunDevicePolicySchema = Type.Union([\n Type.Object({\n type: Literal(\"host\"),\n }),\n Type.Object({\n type: Literal(\"plugin\"),\n resourceName: Type.String(),\n resourceValue: Type.String(),\n }),\n])\n\nexport const externalServiceTypeSchema = Type.StringEnum([\"NodePort\", \"LoadBalancer\"])\nexport const scheduleOnMastersPolicySchema = Type.StringEnum([\"always\", \"when-no-workers\", \"never\"])\nexport const cniSchema = Type.StringEnum([\"cilium\", \"other\"])\n\nexport const clusterQuirksSchema = Type.Object({\n /**\n * The IP and port of the kube-apiserver available from the cluster.\n *\n * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.\n *\n * @schema\n */\n fallbackKubeApiAccess: {\n ...Type.Optional(fallbackKubeApiAccessSchema),\n description: `The IP and port of the kube-apiserver available from the cluster.\n\n Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.`,\n},\n\n /**\n * Specifies the policy for using the tun device inside containers.\n *\n * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.\n *\n * For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.\n *\n * @schema\n */\n tunDevicePolicy: {\n ...Type.Optional(tunDevicePolicySchema),\n description: `Specifies the policy for using the tun device inside containers.\n\n If not provided, the default policy is \\`host\\` which assumes just mounting /dev/net/tun from the host.\n\n For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.`,\n},\n\n /**\n * The service type to use for external services.\n *\n * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.\n *\n * @schema\n */\n externalServiceType: {\n ...Type.Optional(externalServiceTypeSchema),\n description: `The service type to use for external services.\n\n If not provided, the default service type is \\`NodePort\\` since \\`LoadBalancer\\` may not be available.`,\n},\n})\n\nexport const clusterInfoProperties = {\n /**\n * The unique identifier of the cluster.\n *\n * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.\n *\n * @schema\n */\n id: {\n ...Type.String(),\n description: `The unique identifier of the cluster.\n\n Should be defined as a UUID of the \\`kube-system\\` namespace which is always present in the cluster.`,\n},\n\n /**\n * The name of the cluster.\n *\n * @schema\n */\n name: {\n ...Type.String(),\n description: `The name of the cluster.`,\n},\n\n /**\n * The name of the CNI plugin used by the cluster.\n *\n * Supported values are:\n * - `cilium`\n * - `other`\n *\n * @schema\n */\n cni: {\n ...cniSchema,\n description: `The name of the CNI plugin used by the cluster.\n\n Supported values are:\n - \\`cilium\\`\n - \\`other\\``,\n},\n\n /**\n * The endpoints of the cluster nodes.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Array(l3EndpointEntity.schema),\n description: `The endpoints of the cluster nodes.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The endpoints of the API server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n */\n apiEndpoints: Type.Array(l4EndpointEntity.schema),\n\n /**\n * The external IPs of the cluster nodes allowed to be used for external access.\n *\n * @schema\n */\n externalIps: {\n ...Type.Array(Type.String()),\n description: `The external IPs of the cluster nodes allowed to be used for external access.`,\n},\n\n /**\n * The extra quirks of the cluster to improve compatibility.\n *\n * @schema\n */\n quirks: {\n ...Type.Optional(clusterQuirksSchema),\n description: `The extra quirks of the cluster to improve compatibility.`,\n},\n} as const\n\nexport const serviceTypeSchema = Type.StringEnum([\"NodePort\", \"LoadBalancer\", \"ClusterIP\"])\n\nexport const metadataSchema = Type.Object({\n name: Type.String(),\n namespace: Type.String(),\n labels: Type.Optional(Type.Record(Type.String(), Type.String())),\n annotations: Type.Optional(Type.Record(Type.String(), Type.String())),\n})\n\nexport const resourceSchema = Type.Object({\n clusterId: Type.String(),\n metadata: metadataSchema,\n})\n\nexport const serviceEntity = defineEntity({\n type: \"k8s.service\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.service\"),\n ...resourceSchema.properties,\n endpoints: Type.Array(l4EndpointEntity.schema),\n }),\n\n meta: {\n color: \"#2196F3\",\n },\n})\n\nexport const clusterEntity = defineEntity({\n type: \"k8s.cluster\",\n\n schema: Type.Object({\n ...clusterInfoProperties,\n kubeconfig: Type.String(),\n }),\n\n meta: {\n color: \"#2196F3\",\n },\n})\n\nexport const internalIpsPolicySchema = Type.StringEnum([\"always\", \"public\", \"never\"])\n\nexport const scheduleOnMastersPolicyArgs = {\n /**\n * The policy for scheduling workloads on master nodes.\n *\n * - `always`: always schedule workloads on master nodes regardless of the number of workers;\n * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);\n * - `never`: never schedule workloads on master nodes.\n *\n * @schema\n */\n scheduleOnMastersPolicy: {\n ...Type.Default(scheduleOnMastersPolicySchema, \"when-no-workers\"),\n description: `The policy for scheduling workloads on master nodes.\n\n - \\`always\\`: always schedule workloads on master nodes regardless of the number of workers;\n - \\`when-no-workers\\`: schedule workloads on master nodes only if there are no workers (default);\n - \\`never\\`: never schedule workloads on master nodes.`,\n},\n}\n\nexport const clusterInputs = {\n masters: {\n entity: serverEntity,\n multiple: true,\n },\n workers: {\n entity: serverEntity,\n multiple: true,\n required: false,\n },\n} as const\n\nexport const clusterOutputs = {\n k8sCluster: clusterEntity,\n apiEndpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n} as const\n\nexport const existingCluster = defineUnit({\n type: \"k8s.existing-cluster\",\n\n args: {\n /**\n * The list of external IPs of the cluster nodes allowed to be used for external access.\n *\n * If not provided, will be automatically detected by querying the cluster nodes.\n *\n * @schema\n */\n externalIps: {\n ...Type.Optional(Type.Array(Type.String())),\n description: `The list of external IPs of the cluster nodes allowed to be used for external access.\n\n If not provided, will be automatically detected by querying the cluster nodes.`,\n},\n\n /**\n * The policy for using internal IPs of the nodes as external IPs.\n *\n * - `always`: always use internal IPs as external IPs;\n * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;\n * - `never`: never use internal IPs as external IPs.\n *\n * @schema\n */\n internalIpsPolicy: {\n ...Type.Default(internalIpsPolicySchema, \"public\"),\n description: `The policy for using internal IPs of the nodes as external IPs.\n\n - \\`always\\`: always use internal IPs as external IPs;\n - \\`public\\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;\n - \\`never\\`: never use internal IPs as external IPs.`,\n},\n\n /**\n * The extra quirks of the cluster to improve compatibility.\n *\n * @schema\n */\n quirks: {\n ...Type.Optional(clusterQuirksSchema),\n description: `The extra quirks of the cluster to improve compatibility.`,\n},\n },\n\n secrets: {\n /**\n * The kubeconfig of the cluster to use for connecting to the cluster.\n *\n * Will be available for all components using `cluster` output of this unit.\n *\n * @schema\n */\n kubeconfig: {\n ...Type.Record(Type.String(), Type.Any()),\n description: `The kubeconfig of the cluster to use for connecting to the cluster.\n\n Will be available for all components using \\`cluster\\` output of this unit.`,\n},\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Existing Cluster\",\n description: \"An existing Kubernetes cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/existing-cluster\",\n },\n})\n\nexport const clusterPatch = defineUnit({\n type: \"k8s.cluster-patch\",\n\n args: {\n /**\n * The endpoints of the API server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n apiEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the API server.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the API endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n apiEndpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n /**\n * The endpoints of the cluster nodes.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the cluster nodes.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n apiEndpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Cluster Patch\",\n description: \"Patches some properties of the cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"fluent:patch-20-filled\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cluster-patch\",\n },\n})\n\nexport const clusterDns = defineUnit({\n type: \"cluster-dns\",\n\n args: {\n ...dns.createArgs(),\n ...dns.createArgs(\"api\"),\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n ...dns.inputs,\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Cluster DNS\",\n description: \"Creates DNS records for the cluster and updates endpoints.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:dns\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cluster-dns\",\n },\n})\n\nexport const gatewayEntity = defineEntity({\n type: \"k8s.gateway\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n gatewayClassName: Type.String(),\n httpListenerPort: Type.Number(),\n httpsListenerPort: Type.Number(),\n endpoints: Type.Array(l3EndpointEntity.schema),\n }),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const tlsIssuerEntity = defineEntity({\n type: \"k8s.tls-issuer\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n clusterIssuerName: Type.String(),\n }),\n\n meta: {\n color: \"#f06292\",\n },\n})\n\nexport const accessPointEntity = defineEntity({\n type: \"k8s.access-point\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n gateway: gatewayEntity.schema,\n tlsIssuer: tlsIssuerEntity.schema,\n dnsProviders: Type.Array(dns.providerEntity.schema),\n }),\n\n meta: {\n color: \"#F57F17\",\n },\n})\n\nexport const accessPoint = defineUnit({\n type: \"k8s.access-point\",\n\n inputs: {\n gateway: gatewayEntity,\n tlsIssuer: tlsIssuerEntity,\n dnsProviders: {\n entity: dns.providerEntity,\n multiple: true,\n },\n },\n\n outputs: {\n accessPoint: accessPointEntity,\n },\n\n meta: {\n displayName: \"Access Point\",\n description: \"An access point which can be used to connect to services.\",\n primaryIcon: \"mdi:access-point\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/access-point\",\n },\n})\n\nexport const certManager = defineUnit({\n type: \"k8s.cert-manager\",\n\n inputs: {\n k8sCluster: clusterEntity,\n },\n\n outputs: {\n k8sCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Cert Manager\",\n description: \"A certificate manager for managing TLS certificates.\",\n primaryIcon: \"simple-icons:letsencrypt\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cert-manager\",\n },\n})\n\nexport const dns01TlsIssuer = defineUnit({\n type: \"k8s.dns01-issuer\",\n\n args: {\n /**\n * The top-level domains to filter the DNS01 challenge for.\n *\n * If not provided, will use all domains passed to the DNS providers.\n *\n * @schema\n */\n domains: {\n ...Type.Optional(Type.Array(Type.String())),\n description: `The top-level domains to filter the DNS01 challenge for.\n\n If not provided, will use all domains passed to the DNS providers.`,\n},\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n dnsProviders: {\n entity: dns.providerEntity,\n multiple: true,\n },\n },\n\n outputs: {\n tlsIssuer: tlsIssuerEntity,\n },\n\n meta: {\n displayName: \"DNS01 Issuer\",\n description: \"A TLS issuer for issuing certificate using DNS01 challenge.\",\n primaryIcon: \"mdi:certificate\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/dns01-issuer\",\n },\n})\n\nexport const deploymentEntity = defineEntity({\n type: \"k8s.deployment\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.deployment\"),\n ...resourceSchema.properties,\n service: Type.Optional(serviceEntity.schema),\n }),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const statefulSetEntity = defineEntity({\n type: \"k8s.stateful-set\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.stateful-set\"),\n ...resourceSchema.properties,\n service: serviceEntity.schema,\n }),\n\n meta: {\n color: \"#FFC107\",\n },\n})\n\nexport const exposableWorkloadEntity = defineEntity({\n type: \"k8s.exposable-workload\",\n\n schema: Type.Union([deploymentEntity.schema, statefulSetEntity.schema]),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const persistentVolumeClaimEntity = defineEntity({\n type: \"k8s.persistent-volume-claim\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.persistent-volume-claim\"),\n ...resourceSchema.properties,\n }),\n\n meta: {\n color: \"#FFC107\",\n },\n})\n\nexport const interfaceEntity = defineEntity({\n type: \"k8s.interface\",\n\n schema: Type.Object({\n name: Type.String(),\n workload: exposableWorkloadEntity.schema,\n }),\n\n meta: {\n color: \"#2196F3\",\n description:\n \"The interface in a network space of pod kernel which can accept or transmit packets.\",\n },\n})\n\nexport const gatewayApi = defineUnit({\n type: \"k8s.gateway-api\",\n\n inputs: {\n k8sCluster: clusterEntity,\n },\n\n outputs: {\n k8sCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Gateway API\",\n description: \"Installs the Gateway API CRDs to the cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:api\",\n secondaryIconColor: \"#4CAF50\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/gateway-api\",\n },\n})\n\nexport type CNI = Static<typeof cniSchema>\nexport type Cluster = Static<typeof clusterEntity.schema>\n\nexport type Gateway = Static<typeof gatewayEntity.schema>\nexport type TlsIssuer = Static<typeof tlsIssuerEntity.schema>\nexport type AccessPoint = Static<typeof accessPointEntity.schema>\n\nexport type Metadata = Static<typeof metadataSchema>\nexport type Resource = Static<typeof resourceSchema>\n\nexport type ServiceType = Static<typeof serviceTypeSchema>\nexport type Service = Static<typeof serviceEntity.schema>\n\nexport type Deployment = Static<typeof deploymentEntity.schema>\nexport type ExposableWorkload = Static<typeof exposableWorkloadEntity.schema>\n\nexport type PersistentVolumeClaim = Static<typeof persistentVolumeClaimEntity.schema>\nexport type StatefulSet = Static<typeof statefulSetEntity.schema>\n\nexport type Interface = Static<typeof interfaceEntity.schema>\nexport type InternalIpsPolicy = Static<typeof internalIpsPolicySchema>\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { clusterInputs, clusterOutputs, scheduleOnMastersPolicyArgs } from \"./k8s\"\n\nexport const clusterEntity = defineEntity({\n type: \"talos.cluster\",\n\n schema: Type.Object({\n clientConfiguration: Type.String(),\n machineSecrets: Type.String(),\n }),\n\n meta: {\n color: \"#2d2d2d\",\n },\n})\n\nexport const cniSchema = Type.StringEnum([\"none\", \"cilium\", \"flannel\"])\nexport const csiSchema = Type.StringEnum([\"none\", \"local-path-provisioner\"])\n\nexport const cluster = defineUnit({\n type: \"talos.cluster\",\n\n args: {\n ...scheduleOnMastersPolicyArgs,\n\n /**\n * The name of the cluster.\n *\n * By default, the name of the instance is used.\n *\n * @schema\n */\n clusterName: {\n ...Type.Optional(Type.String()),\n description: `The name of the cluster.\n\n By default, the name of the instance is used.`,\n},\n\n /**\n * The CNI plugin to use.\n *\n * The following options are available:\n * - \"cilium\" (default)\n * - \"flannel\" (built-in in Talos)\n * - \"none\" (disable CNI, must be installed manually)\n *\n * The \"cilium\" CNI plugin is recommended to cover advanced network policies like FQDNs.\n *\n * @schema\n */\n cni: {\n ...Type.Default(cniSchema, \"cilium\"),\n description: `The CNI plugin to use.\n\n The following options are available:\n - \"cilium\" (default)\n - \"flannel\" (built-in in Talos)\n - \"none\" (disable CNI, must be installed manually)\n\n The \"cilium\" CNI plugin is recommended to cover advanced network policies like FQDNs.`,\n},\n\n /**\n * The CSI plugin to use.\n *\n * The following options are available:\n * - \"local-path-provisioner\" (default)\n * - \"none\" (disable CSI, must be installed manually if needed)\n *\n * @schema\n */\n csi: {\n ...Type.Default(csiSchema, \"local-path-provisioner\"),\n description: `The CSI plugin to use.\n\n The following options are available:\n - \"local-path-provisioner\" (default)\n - \"none\" (disable CSI, must be installed manually if needed)`,\n},\n\n /**\n * The shared configuration patch.\n * It will be applied to all nodes.\n *\n * @schema\n */\n sharedConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The shared configuration patch.\n It will be applied to all nodes.`,\n},\n\n /**\n * The master configuration patch.\n * It will be applied to all master nodes.\n *\n * @schema\n */\n masterConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The master configuration patch.\n It will be applied to all master nodes.`,\n},\n\n /**\n * The worker configuration patch.\n * It will be applied to all worker nodes.\n *\n * @schema\n */\n workerConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The worker configuration patch.\n It will be applied to all worker nodes.`,\n},\n\n /**\n * Whether to enable the Tun device plugin.\n *\n * There is the only option for Talos to get tun device in containers.\n *\n * By default, this option is set to true.\n */\n enableTunDevicePlugin: Type.Default(Type.Boolean(), true),\n },\n\n inputs: clusterInputs,\n\n outputs: {\n ...clusterOutputs,\n talosCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Talos Cluster\",\n description: \"A Kubernetes cluster managed by Talos.\",\n category: \"Talos\",\n color: \"#2d2d2d\",\n primaryIcon: \"simple-icons:talos\",\n secondaryIcon: \"devicon:kubernetes\",\n },\n\n source: {\n package: \"@highstate/talos\",\n path: \"cluster\",\n },\n})\n","import { defineEntity, defineUnit, Type, type Static, type TObject } from \"@highstate/contract\"\nimport { omit } from \"remeda\"\nimport { clusterEntity, interfaceEntity, exposableWorkloadEntity } from \"./k8s\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const backendSchema = Type.StringEnum([\"wireguard\", \"amneziawg\"])\n\nexport type Backend = Static<typeof backendSchema>\n\nexport const networkEntity = defineEntity({\n type: \"wireguard.network\",\n\n schema: Type.Object({\n backend: backendSchema,\n ipv6: Type.Boolean(),\n }),\n})\n\nexport const nodeExposePolicySchema = Type.StringEnum([\"always\", \"when-has-endpoint\", \"never\"])\n\nexport const peerEntity = defineEntity({\n type: \"wireguard.peer\",\n\n schema: Type.Object({\n name: Type.String(),\n network: Type.Optional(networkEntity.schema),\n publicKey: Type.String(),\n address: Type.Optional(Type.String()),\n allowedIps: Type.Array(Type.String()),\n endpoints: Type.Array(l4EndpointEntity.schema),\n allowedEndpoints: Type.Array(Type.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),\n\n /**\n * The pre-shared key of the WireGuard peer.\n *\n * If one of two peers has `presharedKey` set, the other peer must have `presharedKey` set too and they must be equal.\n *\n * Will be ignored if both peers have `presharedKeyPart` set.\n */\n presharedKey: Type.Optional(Type.String()),\n\n /**\n * The pre-shared key part of the WireGuard peer.\n *\n * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as XOR of the two parts.\n */\n presharedKeyPart: Type.Optional(Type.String()),\n\n excludedIps: Type.Array(Type.String()),\n dns: Type.Array(Type.String()),\n listenPort: Type.Optional(Type.Number()),\n }),\n\n meta: {\n color: \"#673AB7\",\n },\n})\n\nexport const identityEntity = defineEntity({\n type: \"wireguard.identity\",\n\n schema: Type.Object({\n peer: peerEntity.schema,\n privateKey: Type.String(),\n }),\n\n meta: {\n color: \"#F44336\",\n },\n})\n\nexport type Network = Static<typeof networkEntity.schema>\nexport type Identity = Static<typeof identityEntity.schema>\nexport type Peer = Static<typeof peerEntity.schema>\nexport type NodeExposePolicy = Static<typeof nodeExposePolicySchema>\n\n/**\n * The network hols the shared configuration for the WireGuard identities, peers and nodes.\n */\nexport const network = defineUnit({\n type: \"wireguard.network\",\n\n args: {\n /**\n * The backend to use for the WireGuard network.\n *\n * Possible values are:\n * 1. `wireguard` - The default backend.\n * 2. `amneziawg` - The censorship-resistant fork of WireGuard.\n *\n * By default, the `wireguard` backend is used.\n *\n * @schema\n */\n backend: {\n ...Type.Default(backendSchema, \"wireguard\"),\n description: `The backend to use for the WireGuard network.\n\n Possible values are:\n 1. \\`wireguard\\` - The default backend.\n 2. \\`amneziawg\\` - The censorship-resistant fork of WireGuard.\n\n By default, the \\`wireguard\\` backend is used.`,\n},\n\n /**\n * The option to enable IPv6 support in the network.\n *\n * By default, IPv6 support is disabled.\n *\n * @schema\n */\n ipv6: {\n ...Type.Default(Type.Boolean(), false),\n description: `The option to enable IPv6 support in the network.\n\n By default, IPv6 support is disabled.`,\n},\n },\n\n outputs: {\n network: networkEntity,\n },\n\n meta: {\n description: \"The WireGuard network with some shared configuration.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:local-area-network-connect\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"network\",\n },\n})\n\nconst sharedPeerArgs = {\n /**\n * The name of the WireGuard peer.\n *\n * If not provided, the peer will be named after the unit.\n *\n * @schema\n */\n peerName: {\n ...Type.Optional(Type.String()),\n description: `The name of the WireGuard peer.\n\n If not provided, the peer will be named after the unit.`,\n},\n\n /**\n * The address of the WireGuard interface.\n *\n * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.\n *\n * @schema\n */\n address: {\n ...Type.Optional(Type.String()),\n description: `The address of the WireGuard interface.\n\n The address may be any IPv4 or IPv6 address. CIDR notation is also supported.`,\n},\n\n /**\n * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.\n *\n * Will be merged with the `allowedIps` if provided.\n *\n * @schema\n */\n exitNode: {\n ...Type.Default(Type.Boolean(), false),\n description: `The convenience option to set \\`allowedIps\\` to \\`0.0.0.0/0, ::/0\\`.\n\n Will be merged with the \\`allowedIps\\` if provided.`,\n},\n\n /**\n * The list of IP ranges to exclude from the tunnel.\n *\n * Implementation notes:\n *\n * - This list will not be used to generate the allowed IPs for the peer.\n * - Instead, the node will setup extra direct routes to these IPs via default gateway.\n * - This allows to use `0.0.0.0/0, ::/0` in the `allowedIps` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.\n *\n * @schema\n */\n excludedIps: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The list of IP ranges to exclude from the tunnel.\n\n Implementation notes:\n\n - This list will not be used to generate the allowed IPs for the peer.\n - Instead, the node will setup extra direct routes to these IPs via default gateway.\n - This allows to use \\`0.0.0.0/0, ::/0\\` in the \\`allowedIps\\` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.`,\n},\n\n /**\n * The convenience option to exclude private IPs from the tunnel.\n *\n * For IPv4, the private IPs are:\n *\n * - `10.0.0.0/8`\n * - `172.16.0.0/12`\n * - `192.168.0.0/16`\n *\n * For IPv6, the private IPs are:\n *\n * - `fc00::/7`\n * - `fe80::/10`\n *\n * Will be merged with `excludedIps` if provided.\n *\n * @schema\n */\n excludePrivateIps: {\n ...Type.Default(Type.Boolean(), false),\n description: `The convenience option to exclude private IPs from the tunnel.\n\n For IPv4, the private IPs are:\n\n - \\`10.0.0.0/8\\`\n - \\`172.16.0.0/12\\`\n - \\`192.168.0.0/16\\`\n\n For IPv6, the private IPs are:\n\n - \\`fc00::/7\\`\n - \\`fe80::/10\\`\n\n Will be merged with \\`excludedIps\\` if provided.`,\n},\n\n /**\n * The endpoints of the WireGuard peer.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the WireGuard peer.`,\n},\n\n /**\n * The allowed endpoints of the WireGuard peer.\n *\n * The non `hostname` endpoints will be added to the `allowedIps` of the peer.\n *\n * @schema\n */\n allowedEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The allowed endpoints of the WireGuard peer.\n\n The non \\`hostname\\` endpoints will be added to the \\`allowedIps\\` of the peer.`,\n},\n\n /**\n * The DNS servers that should be used by the interface connected to the WireGuard peer.\n *\n * If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).\n *\n * @schema\n */\n dns: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The DNS servers that should be used by the interface connected to the WireGuard peer.\n\n If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).`,\n},\n\n /**\n * The convenience option to include the DNS servers to the allowed IPs.\n *\n * By default, is `true`.\n *\n * @schema\n */\n includeDns: {\n ...Type.Default(Type.Boolean(), true),\n description: `The convenience option to include the DNS servers to the allowed IPs.\n\n By default, is \\`true\\`.`,\n},\n\n /**\n * The port to listen on.\n *\n * @schema\n */\n listenPort: {\n ...Type.Optional(Type.Number()),\n description: `The port to listen on.`,\n},\n}\n\nconst sharedPeerInputs = {\n /**\n * The network to use for the WireGuard identity.\n *\n * If not provided, the identity will use default network configuration.\n *\n * @schema\n */\n network: {\n ...{\n entity: networkEntity,\n required: false,\n },\n description: `The network to use for the WireGuard identity.\n\n If not provided, the identity will use default network configuration.`,\n},\n\n /**\n * The L3 endpoints of the identity.\n *\n * Will produce L4 endpoints for each of the provided L3 endpoints.\n *\n * @schema\n */\n l3Endpoints: {\n ...{\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L3 endpoints of the identity.\n\n Will produce L4 endpoints for each of the provided L3 endpoints.`,\n},\n\n /**\n * The L4 endpoints of the identity.\n *\n * Will take priority over all calculated endpoints if provided.\n *\n * @schema\n */\n l4Endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the identity.\n\n Will take priority over all calculated endpoints if provided.`,\n},\n\n /**\n * The L3 endpoints to add to the allowed IPs of the identity.\n *\n * `hostname` endpoints will be ignored.\n *\n * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n * the corresponding network policy will be created.\n *\n * @schema\n */\n allowedL3Endpoints: {\n ...{\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L3 endpoints to add to the allowed IPs of the identity.\n\n \\`hostname\\` endpoints will be ignored.\n\n If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n the corresponding network policy will be created.`,\n},\n\n /**\n * The L4 endpoints to add to the allowed IPs of the identity.\n *\n * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n * the corresponding network policy will be created.\n *\n * @schema\n */\n allowedL4Endpoints: {\n ...{\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L4 endpoints to add to the allowed IPs of the identity.\n\n If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n the corresponding network policy will be created.`,\n},\n} as const\n\nconst sharedPeerOutputs = {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n} as const\n\nexport type SharedPeerArgs = Static<TObject<typeof sharedPeerArgs>>\n\nexport const peer = defineUnit({\n type: \"wireguard.peer\",\n\n args: {\n ...sharedPeerArgs,\n\n /**\n * The public key of the WireGuard peer.\n *\n * @schema\n */\n publicKey: {\n ...Type.String(),\n description: `The public key of the WireGuard peer.`,\n},\n },\n\n secrets: {\n /**\n * The pre-shared key which should be used for the peer.\n *\n * @schema\n */\n presharedKey: {\n ...Type.Optional(Type.String()),\n description: `The pre-shared key which should be used for the peer.`,\n},\n },\n\n inputs: sharedPeerInputs,\n outputs: sharedPeerOutputs,\n\n meta: {\n description: \"The WireGuard peer with the public key.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:badge-account-horizontal\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"peer\",\n },\n})\n\nexport const peerPatch = defineUnit({\n type: \"wireguard.peer-patch\",\n\n args: {\n /**\n * The endpoints of the WireGuard peer.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the WireGuard peer.`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n /**\n * The allowed endpoints of the WireGuard peer.\n *\n * The non `hostname` endpoints will be added to the `allowedIps` of the peer.\n *\n * @schema\n */\n allowedEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The allowed endpoints of the WireGuard peer.\n\n The non \\`hostname\\` endpoints will be added to the \\`allowedIps\\` of the peer.`,\n},\n\n /**\n * The mode to use for patching the allowed endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n allowedEndpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n ...omit(sharedPeerArgs, [\"endpoints\", \"allowedEndpoints\"]),\n },\n\n inputs: {\n peer: peerEntity,\n ...sharedPeerInputs,\n },\n\n outputs: {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"WireGuard Peer Patch\",\n description: \"Patches some properties of the WireGuard peer.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:badge-account-horizontal\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"peer-patch\",\n },\n})\n\nexport const identity = defineUnit({\n type: \"wireguard.identity\",\n\n args: {\n ...sharedPeerArgs,\n\n /**\n * The port to listen on.\n *\n * Used by the implementation of the identity and to calculate the endpoint of the peer.\n *\n * @schema\n */\n listenPort: {\n ...Type.Optional(Type.Number()),\n description: `The port to listen on.\n\n Used by the implementation of the identity and to calculate the endpoint of the peer.`,\n},\n\n /**\n * The endpoint of the WireGuard peer.\n *\n * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.\n *\n * Will take priority over all calculated endpoints and `l4Endpoint` input.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoint of the WireGuard peer.\n\n If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.\n\n Will take priority over all calculated endpoints and \\`l4Endpoint\\` input.`,\n},\n },\n\n secrets: {\n /**\n * The private key of the WireGuard identity.\n *\n * If not provided, the key will be generated automatically.\n *\n * @schema\n */\n privateKey: {\n ...Type.Optional(Type.String()),\n description: `The private key of the WireGuard identity.\n\n If not provided, the key will be generated automatically.`,\n},\n\n /**\n * The part of the pre-shared of the WireGuard identity.\n *\n * Will be generated automatically if not provided.\n *\n * @schema\n */\n presharedKeyPart: {\n ...Type.Optional(Type.String()),\n description: `The part of the pre-shared of the WireGuard identity.\n\n Will be generated automatically if not provided.`,\n},\n },\n\n inputs: sharedPeerInputs,\n\n outputs: {\n identity: identityEntity,\n ...sharedPeerOutputs,\n },\n\n meta: {\n description: \"The WireGuard identity with the public key.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:account\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"identity\",\n },\n})\n\nexport const node = defineUnit({\n type: \"wireguard.node\",\n\n args: {\n /**\n * The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.\n *\n * By default, the name is `wg-${identity.name}`.\n *\n * @schema\n */\n appName: {\n ...Type.Optional(Type.String()),\n description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.\n\n By default, the name is \\`wg-\\${identity.name}\\`.`,\n},\n\n /**\n * Whether to expose the WireGuard node to the outside world.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the WireGuard node to the outside world.`,\n},\n\n /**\n * The policy to use for exposing the WireGuard node.\n *\n * - `always` - The node will be exposed and the service will be created.\n * - `when-has-endpoint` - The node will be exposed only if the provided idenity has at least one endpoint.\n * - `never` - The node will not be exposed and the service will not be created.\n *\n * * By default, the `when-has-endpoint` policy is used.\n */\n exposePolicy: Type.Default(nodeExposePolicySchema, \"when-has-endpoint\"),\n\n /**\n * The extra specification of the container which runs the WireGuard node.\n *\n * Will override any overlapping fields.\n *\n * @schema\n */\n containerSpec: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The extra specification of the container which runs the WireGuard node.\n\n Will override any overlapping fields.`,\n},\n },\n\n inputs: {\n identity: identityEntity,\n k8sCluster: clusterEntity,\n\n workload: {\n entity: exposableWorkloadEntity,\n required: false,\n },\n\n interface: {\n entity: interfaceEntity,\n required: false,\n },\n\n peers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n interface: {\n entity: interfaceEntity,\n required: false,\n },\n\n peer: {\n entity: peerEntity,\n required: false,\n },\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n meta: {\n description: \"The WireGuard node running on the Kubernetes.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:server\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"node\",\n },\n})\n\nexport const config = defineUnit({\n type: \"wireguard.config\",\n\n args: {\n /**\n * The name of the \"default\" interface where non-tunneled traffic should go.\n *\n * If not provided, the config will not respect `excludedIps`.\n *\n * @schema\n */\n defaultInterface: {\n ...Type.Optional(Type.String()),\n description: `The name of the \"default\" interface where non-tunneled traffic should go.\n\n If not provided, the config will not respect \\`excludedIps\\`.`,\n},\n },\n\n inputs: {\n identity: identityEntity,\n peers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n meta: {\n displayName: \"WireGuard Config\",\n description: \"Just the WireGuard configuration for the identity and peers.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:settings\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"config\",\n },\n})\n\nexport const configBundle = defineUnit({\n type: \"wireguard.config-bundle\",\n\n inputs: {\n identity: identityEntity,\n peers: {\n entity: peerEntity,\n multiple: true,\n },\n sharedPeers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n meta: {\n displayName: \"WireGuard Config Bundle\",\n description: \"The WireGuard configuration bundle for the identity and peers.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:folder-settings-variant\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"config-bundle\",\n },\n})\n","export * from \"./mariadb\"\nexport * from \"./postgresql\"\nexport * from \"./vaultwarden\"\nexport * from \"./mongodb\"\nexport * from \"./network\"\nexport * from \"./dns\"\n// export * from \"./zitadel\"\n// export * from \"./gitea\"\nexport * from \"./traefik\"\nexport * from \"./kubernetes-dashboard\"\nexport * from \"./grocy\"\nexport * from \"./maybe\"\nexport * from \"./deployment\"\nexport * from \"./syncthing\"\nexport * from \"./code-server\"\n\nexport { createArgs, createInputs } from \"./shared\"\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const mariadbEntity = defineEntity({\n type: \"apps.mariadb\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#f06292\",\n },\n})\n\nexport const mariadb = defineUnit({\n type: \"apps.mariadb\",\n\n args: createArgs(\"mariadb\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\"]),\n\n outputs: {\n mariadb: mariadbEntity,\n service: serviceEntity,\n },\n\n meta: {\n displayName: \"MariaDB\",\n description: \"The MariaDB database deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mariadb\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"mariadb/app\"),\n})\n\nextraInputDefinitions.mariadb = {\n entity: mariadbEntity,\n displayName: \"MariaDB\",\n}\n\nexport const mariadbDatabase = defineUnit({\n type: \"apps.mariadb.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"mariadb\"]),\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n meta: {\n displayName: \"MariaDB Database\",\n description:\n \"The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mariadb\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"mariadb/database\"),\n})\n\nexport type MariaDB = Static<typeof mariadbEntity.schema>\n","import type { TString } from \"@sinclair/typebox\"\nimport type { mariadbEntity } from \"./mariadb\"\nimport type { postgresqlEntity } from \"./postgresql\"\nimport type { mongodbEntity } from \"./mongodb\"\nimport { Type } from \"@highstate/contract\"\nimport {\n accessPointEntity,\n clusterEntity,\n persistentVolumeClaimEntity,\n serviceEntity,\n} from \"../k8s\"\nimport { repoEntity } from \"../restic\"\nimport { providerEntity } from \"../dns\"\nimport { l4EndpointEntity } from \"../network\"\n\nconst extraArgsDefinitions = {\n fqdn: {\n schema: Type.String(),\n },\n endpoints: {\n schema: Type.Array(Type.String()),\n required: false,\n },\n external: {\n schema: Type.Boolean(),\n required: false,\n },\n} as const\n\nconst extraSecretsDefinitions = {\n rootPassword: {\n schema: Type.String(),\n required: false,\n },\n backupPassword: {\n schema: Type.String(),\n required: false,\n },\n}\n\ntype LazyExtraInputDefinitions = {\n mariadb: {\n entity: typeof mariadbEntity\n displayName: \"MariaDB\"\n }\n postgresql: {\n entity: typeof postgresqlEntity\n displayName: \"PostgreSQL\"\n }\n mongodb: {\n entity: typeof mongodbEntity\n displayName: \"MongoDB\"\n }\n}\n\nconst eagerExtraInputDefinitions = {\n accessPoint: {\n entity: accessPointEntity,\n },\n resticRepo: {\n entity: repoEntity,\n required: false,\n },\n dnsProviders: {\n entity: providerEntity,\n required: false,\n multiple: true,\n },\n volume: {\n entity: persistentVolumeClaimEntity,\n required: false,\n },\n} as const\n\nexport const extraInputDefinitions = {\n ...eagerExtraInputDefinitions,\n} as typeof eagerExtraInputDefinitions & LazyExtraInputDefinitions\n\ntype ExtraArgsDefinitions = typeof extraArgsDefinitions\ntype ExtraSecretsDefinitions = typeof extraSecretsDefinitions\ntype ExtraArgsName = keyof ExtraArgsDefinitions\ntype ExtraSecretsName = keyof ExtraSecretsDefinitions\n\ntype CreateArgsOptions<R extends readonly ExtraArgsName[], O extends readonly ExtraArgsName[]> = {\n required?: R\n optional?: O\n}\n\ntype CreateSecretsOptions<\n R extends readonly ExtraSecretsName[],\n O extends readonly ExtraSecretsName[],\n> = {\n required?: R\n optional?: O\n}\n\nexport function createArgs<T extends readonly ExtraArgsName[] = []>(\n defaultAppName: string,\n extraArgs?: T,\n): {\n appName: TString & { default: string }\n} & {\n [K in T[number]]: ExtraArgsDefinitions[K]\n}\n\nexport function createArgs<\n R extends readonly ExtraArgsName[] = [],\n O extends readonly ExtraArgsName[] = [],\n>(\n defaultAppName: string,\n extraArgs?: CreateArgsOptions<R, O>,\n): {\n appName: TString & { default: string }\n} & {\n [K in R[number]]: ExtraArgsDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraArgsDefinitions[K] & { required: false }\n}\n\nexport function createArgs<\n R extends readonly ExtraArgsName[] = [],\n O extends readonly ExtraArgsName[] = [],\n>(defaultAppName: string, extraArgs?: readonly ExtraArgsName[] | CreateArgsOptions<R, O>) {\n const base = {\n appName: Type.Default(Type.String(), defaultAppName),\n }\n\n const dynamicArgs: Partial<Record<ExtraArgsName, object>> = {}\n\n if (Array.isArray(extraArgs)) {\n for (const name of extraArgs as readonly ExtraArgsName[]) {\n dynamicArgs[name] = extraArgsDefinitions[name]\n }\n } else {\n const { required, optional } = (extraArgs as CreateArgsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicArgs[name] = {\n ...extraArgsDefinitions[name],\n required: true,\n }\n }\n\n for (const name of optional ?? []) {\n dynamicArgs[name] = {\n ...extraArgsDefinitions[name],\n required: false,\n }\n }\n }\n\n return {\n ...base,\n ...dynamicArgs,\n }\n}\n\nexport function createSecrets<T extends readonly ExtraSecretsName[] = []>(\n extraSecrets?: T,\n): {\n [K in T[number]]: ExtraSecretsDefinitions[K]\n}\n\nexport function createSecrets<\n R extends readonly ExtraSecretsName[] = [],\n O extends readonly ExtraSecretsName[] = [],\n>(\n extraSecrets?: CreateSecretsOptions<R, O>,\n): {\n [K in R[number]]: ExtraSecretsDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraSecretsDefinitions[K] & { required: false }\n}\n\nexport function createSecrets<\n R extends readonly ExtraSecretsName[] = [],\n O extends readonly ExtraSecretsName[] = [],\n>(extraSecrets?: readonly ExtraSecretsName[] | CreateSecretsOptions<R, O>) {\n const dynamicSecrets: Partial<Record<ExtraSecretsName, object>> = {}\n\n if (Array.isArray(extraSecrets)) {\n for (const name of extraSecrets as readonly ExtraSecretsName[]) {\n dynamicSecrets[name] = extraSecretsDefinitions[name]\n }\n } else {\n const { required, optional } = (extraSecrets as CreateSecretsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicSecrets[name] = {\n ...extraSecretsDefinitions[name],\n required: true,\n }\n }\n\n for (const name of optional ?? []) {\n dynamicSecrets[name] = {\n ...extraSecretsDefinitions[name],\n required: false,\n }\n }\n }\n\n return dynamicSecrets as {\n [K in R[number]]: ExtraSecretsDefinitions[K] & { required: true }\n } & {\n [K in O[number]]: ExtraSecretsDefinitions[K] & { required: false }\n }\n}\n\ntype ExtraInputDefinitions = typeof extraInputDefinitions\ntype ExtraInputName = keyof ExtraInputDefinitions\n\ntype CreateInputsOptions<\n R extends readonly ExtraInputName[],\n O extends readonly ExtraInputName[],\n> = {\n required?: R\n optional?: O\n}\n\nexport function createInputs<T extends readonly ExtraInputName[] = []>(\n inputs?: T,\n): {\n k8sCluster: typeof clusterEntity\n} & {\n [K in T[number]]: ExtraInputDefinitions[K]\n}\n\nexport function createInputs<\n R extends readonly ExtraInputName[] = [],\n O extends readonly ExtraInputName[] = [],\n>(\n inputs?: CreateInputsOptions<R, O>,\n): {\n k8sCluster: typeof clusterEntity\n} & {\n [K in R[number]]: ExtraInputDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraInputDefinitions[K] & { required: false }\n}\n\nexport function createInputs<\n R extends readonly ExtraInputName[] = [],\n O extends readonly ExtraInputName[] = [],\n>(inputs?: readonly ExtraInputName[] | CreateInputsOptions<R, O>) {\n const base = {\n k8sCluster: clusterEntity,\n }\n\n const dynamicInputs: Partial<Record<ExtraInputName, object>> = {}\n\n if (Array.isArray(inputs)) {\n for (const name of inputs as readonly ExtraInputName[]) {\n dynamicInputs[name] = extraInputDefinitions[name]\n }\n } else {\n const { required, optional } = (inputs as CreateInputsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicInputs[name] = {\n ...extraInputDefinitions[name],\n required: true,\n }\n }\n for (const name of optional ?? []) {\n dynamicInputs[name] = {\n ...extraInputDefinitions[name],\n required: false,\n }\n }\n }\n\n return {\n ...base,\n ...dynamicInputs,\n }\n}\n\nexport function createSource(path: string) {\n return {\n package: \"@highstate/apps\",\n path,\n }\n}\n\nexport const databaseSchema = Type.Object({\n endpoints: Type.Array(l4EndpointEntity.schema),\n service: Type.Optional(serviceEntity.schema),\n rootPassword: Type.String(),\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\n\nexport const repoEntity = defineEntity({\n type: \"restic.repo\",\n\n schema: Type.Object({\n remoteEndpoints: Type.Array(Type.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),\n\n type: Type.Literal(\"rclone\"),\n rcloneConfig: Type.String(),\n remoteName: Type.String(),\n pathPattern: Type.String(),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const repo = defineUnit({\n type: \"restic.repo\",\n\n args: {\n remoteEndpoints: Type.Default(Type.Array(Type.String()), []),\n\n /**\n * The pattern for the path where backups will be stored for the specific application.\n *\n * Available variables:\n *\n * - `$clusterName`: The name of the Kubernetes cluster where the application is deployed.\n * - `$appName`: The name of the application for which the backups are being created. Corresponds to the `appName` argument of the unit.\n * - `$unitName`: The name of the unit, which deploys the application, provided by the user.\n *\n * By default, the path pattern is `backups/$clusterName/$appName`.\n *\n * @schema\n */\n pathPattern: {\n ...Type.Default(Type.String(), \"backups/$clusterName/$appName\"),\n description: `The pattern for the path where backups will be stored for the specific application.\n\n Available variables:\n\n - \\`$clusterName\\`: The name of the Kubernetes cluster where the application is deployed.\n - \\`$appName\\`: The name of the application for which the backups are being created. Corresponds to the \\`appName\\` argument of the unit.\n - \\`$unitName\\`: The name of the unit, which deploys the application, provided by the user.\n\n By default, the path pattern is \\`backups/$clusterName/$appName\\`.`,\n},\n },\n\n secrets: {\n rcloneConfig: Type.String({ language: \"ini\" }),\n },\n\n inputs: {\n remoteL3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n remoteL4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n repo: repoEntity,\n },\n\n meta: {\n displayName: \"Restic Repo\",\n description: \"Holds the configuration for a Restic repository and its remote storage.\",\n primaryIconColor: \"#e56901\",\n primaryIcon: \"material-symbols:backup\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/restic\",\n path: \"repo\",\n },\n})\n\nexport type Repo = Static<typeof repoEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const postgresqlEntity = defineEntity({\n type: \"apps.postgresql\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#336791\",\n },\n})\n\nexport const postgresql = defineUnit({\n type: \"apps.postgresql\",\n\n args: createArgs(\"postgresql\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\", \"dnsProviders\"]),\n\n outputs: {\n postgresql: postgresqlEntity,\n service: serviceEntity,\n },\n\n meta: {\n displayName: \"PostgreSQL\",\n description: \"The PostgreSQL database deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:postgresql\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"postgresql/app\"),\n})\n\nextraInputDefinitions.postgresql = {\n entity: postgresqlEntity,\n displayName: \"PostgreSQL\",\n}\n\nexport const postgresqlDatabase = defineUnit({\n type: \"apps.postgresql.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"postgresql\"]),\n\n meta: {\n displayName: \"PostgreSQL Database\",\n description:\n \"The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:postgresql\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"postgresql/database\"),\n})\n\nexport type PostgreSQL = Static<typeof postgresqlEntity.schema>\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSource } from \"./shared\"\n\nexport const vaultwarden = defineUnit({\n type: \"apps.vaultwarden\",\n\n args: createArgs(\"vaultwarden\", [\"fqdn\"]),\n\n secrets: {\n mariadbPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"mariadb\"]),\n\n meta: {\n displayName: \"Vaultwarden\",\n description: \"The Vaultwarden password manager deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:vaultwarden\",\n category: \"Security\",\n },\n\n source: createSource(\"vaultwarden\"),\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const mongodbEntity = defineEntity({\n type: \"apps.mongodb\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#13aa52\",\n },\n})\n\nexport const mongodb = defineUnit({\n type: \"apps.mongodb\",\n\n args: createArgs(\"mongodb\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\"]),\n\n outputs: {\n mongodb: mongodbEntity,\n service: serviceEntity,\n },\n\n meta: {\n displayName: \"MongoDB\",\n description: \"The MongoDB instance deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mongodb\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"mongodb/app\"),\n})\n\nextraInputDefinitions.mongodb = {\n entity: mongodbEntity,\n displayName: \"MongoDB\",\n}\n\nexport const mongodbDatabase = defineUnit({\n type: \"apps.mongodb.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"mongodb\"]),\n\n meta: {\n displayName: \"MongoDB Database\",\n description:\n \"The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mongodb\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"mongodb/database\"),\n})\n\nexport type MongoDB = Static<typeof mongodbEntity.schema>\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"../network\"\nimport { createSource } from \"./shared\"\n\nexport const explicitEndpointFilterSchema = Type.StringEnum([\"public\", \"external\", \"internal\"])\n\nexport const endpointFilter = defineUnit({\n type: \"apps.endpoint-filter\",\n\n args: {\n /**\n * The filter to apply to the endpoints.\n *\n * - `public`: Only public endpoints accessible from the internet.\n * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.\n * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.\n */\n filter: Type.Default(explicitEndpointFilterSchema, \"public\"),\n },\n\n inputs: {\n l3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n l3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Endpoint Filter\",\n description: \"Explicitly filter endpoints by their accessibility.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#FF9800\",\n secondaryIcon: \"mdi:filter-outline\",\n category: \"Network\",\n },\n\n source: createSource(\"endpoint-filter\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"../network\"\nimport { providerEntity } from \"../dns\"\nimport { createSource } from \"./shared\"\n\nconst endpointFilterSchema = Type.StringEnum([\"all\", \"public\", \"external\", \"internal\"])\n\nexport const recordSet = defineUnit({\n type: \"apps.dns-record-set\",\n\n args: {\n /**\n * The name of the DNS record.\n *\n * If not provided, will use the name of the unit.\n */\n recordName: Type.Optional(Type.String()),\n\n /**\n * The type of the DNS record.\n *\n * If not specified, will use the default type for the provider.\n */\n type: Type.Optional(Type.String()),\n\n /**\n * The values of the DNS record.\n */\n values: Type.Array(Type.String()),\n\n /**\n * The TTL of the DNS record.\n */\n ttl: Type.Optional(Type.Number()),\n\n /**\n * The priority of the DNS record.\n */\n priority: Type.Optional(Type.Number()),\n\n /**\n * Whether the DNS record is proxied.\n *\n * Available only for public IPs and some DNS providers like Cloudflare.\n */\n proxied: Type.Optional(Type.Boolean()),\n\n /**\n * The filter to apply to the endpoints.\n *\n * - `all`: All endpoints.\n * - `public`: Only public endpoints accessible from the internet (default).\n * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.\n * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.\n */\n endpointFilter: Type.Default(endpointFilterSchema, \"public\"),\n },\n\n inputs: {\n dnsProviders: {\n entity: providerEntity,\n multiple: true,\n },\n l3Endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n /**\n * The single L3 endpoint representing created DNS records.\n */\n l3Endpoint: l3EndpointEntity,\n\n /**\n * Multiple L4 endpoints representing created DNS records for each unique port/protocol combination from the input L4 endpoints.\n */\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"DNS Record Set\",\n description: \"A set of DNS records to be created.\",\n primaryIcon: \"mdi:server\",\n defaultNamePrefix: \"record\",\n category: \"Network\",\n },\n\n source: createSource(\"dns-record-set\"),\n})\n\nexport const sharedArgs = {\n /**\n * The FQDN to register the cluster nodes with.\n *\n * @schema\n */\n fqdn: {\n ...Type.Optional(Type.String()),\n description: `The FQDN to register the cluster nodes with.`,\n},\n}\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { gatewayEntity, serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport { createArgs, createInputs } from \"./shared\"\n\nexport const traefikGateway = defineUnit({\n type: \"apps.traefik-gateway\",\n\n args: {\n ...createArgs(\"traefik\", [\"external\"]),\n className: Type.Optional(Type.String()),\n },\n\n inputs: createInputs(),\n\n outputs: {\n gateway: gatewayEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Traefik Gateway\",\n description: \"A Traefik gateway for routing traffic to services.\",\n primaryIcon: \"simple-icons:traefikproxy\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/apps\",\n path: \"traefik\",\n },\n})\n","import { defineUnit } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSource } from \"./shared\"\n\nexport const kubernetesDashboard = defineUnit({\n type: \"apps.kubernetes-dashboard\",\n\n args: createArgs(\"kubernetes-dashboard\", [\"fqdn\"]),\n inputs: createInputs([\"accessPoint\"]),\n\n meta: {\n displayName: \"Kubernetes Dashboard\",\n description: \"The Kubernetes Dashboard deployed on Kubernetes.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"material-symbols:dashboard\",\n category: \"Kubernetes\",\n },\n\n source: createSource(\"kubernetes-dashboard\"),\n})\n","import { defineUnit } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const grocy = defineUnit({\n type: \"apps.grocy\",\n\n args: createArgs(\"grocy\", [\"fqdn\"]),\n secrets: createSecrets([\"backupPassword\"]),\n inputs: createInputs([\"accessPoint\", \"resticRepo\"]),\n\n meta: {\n displayName: \"Grocy\",\n description:\n \"Grocy is a web-based self-hosted groceries & household management solution for your home.\",\n primaryIcon: \"simple-icons:grocy\",\n category: \"Productivity\",\n },\n\n source: createSource(\"grocy\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const maybe = defineUnit({\n type: \"apps.maybe\",\n\n args: createArgs(\"maybe\", [\"fqdn\"]),\n\n secrets: {\n ...createSecrets([\"backupPassword\"]),\n postgresqlPassword: Type.Optional(Type.String()),\n secretKey: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"postgresql\"]),\n\n meta: {\n displayName: \"Maybe\",\n description: \"The OS for your personal finances.\",\n primaryIcon: \"arcticons:finance-manager\",\n category: \"Finance\",\n },\n\n source: createSource(\"maybe\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { deploymentEntity, serviceEntity, serviceTypeSchema } from \"../k8s\"\nimport { createInputs, createSource } from \"./shared\"\n\nexport const deployment = defineUnit({\n type: \"apps.deployment\",\n\n args: {\n appName: Type.Optional(Type.String()),\n\n fqdn: Type.Optional(Type.String()),\n serviceType: Type.Optional(serviceTypeSchema),\n\n image: Type.Optional(Type.String()),\n port: Type.Optional(Type.Number()),\n replicas: Type.Optional(Type.Number()),\n\n dataPath: Type.Optional(Type.String()),\n\n env: Type.Optional(Type.Record(Type.String(), Type.Any())),\n\n mariadbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n postgresqlEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n mongodbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n\n manifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n serviceManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n httpRouteManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n },\n\n secrets: {\n mariadbPassword: Type.Optional(Type.String()),\n postgresqlPassword: Type.Optional(Type.String()),\n mongodbPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\n \"accessPoint\",\n \"mariadb\",\n \"postgresql\",\n \"mongodb\",\n \"resticRepo\",\n \"dnsProviders\",\n ]),\n\n outputs: {\n deployment: deploymentEntity,\n service: serviceEntity,\n },\n\n meta: {\n displayName: \"Kubernetes Deployment\",\n description: \"A generic Kubernetes deployment with optional service and gateway routes.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:cube-outline\",\n category: \"Kubernetes\",\n },\n\n source: createSource(\"deployment\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { persistentVolumeClaimEntity, serviceEntity } from \"../k8s\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const backupModeSchema = Type.StringEnum([\"state\", \"full\"])\n\nexport const syncthing = defineUnit({\n type: \"apps.syncthing\",\n\n args: {\n ...createArgs(\"syncthing\", [\"fqdn\"]),\n\n /**\n * The FQDN of the Syncthing instance used to sync with other devices.\n *\n * The `fqdn` argument unlike this one points to the gateway and used to\n * access the Syncthing Web UI.\n */\n deviceFqdn: Type.Optional(Type.String()),\n\n /**\n * The backup mode to use for the Syncthing instance.\n *\n * - `state`: Only the state is backed up. When the instance is restored, it will\n * sync files from the other devices automatically.\n * - `full`: A full backup is created including all files.\n *\n * The default is `state`.\n */\n backupMode: Type.Default(backupModeSchema, \"state\"),\n },\n\n secrets: createSecrets([\"backupPassword\"]),\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"dnsProviders\", \"volume\"]),\n\n outputs: {\n service: serviceEntity,\n volume: persistentVolumeClaimEntity,\n },\n\n meta: {\n displayName: \"Syncthing\",\n description: \"The Syncthing instance deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:syncthing\",\n category: \"File Sync\",\n },\n\n source: createSource(\"syncthing\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { persistentVolumeClaimEntity, statefulSetEntity } from \"../k8s\"\nimport { createArgs, createInputs, createSecrets } from \"./shared\"\n\nexport const codeServer = defineUnit({\n type: \"apps.code-server\",\n\n args: createArgs(\"code-server\", [\"fqdn\"]),\n\n secrets: {\n ...createSecrets([\"backupPassword\"]),\n password: Type.Optional(Type.String()),\n sudoPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"dnsProviders\", \"volume\"]),\n\n outputs: {\n statefulSet: statefulSetEntity,\n volume: persistentVolumeClaimEntity,\n },\n\n meta: {\n displayName: \"Code Server\",\n description: \"The Code Server instance deployed on Kubernetes.\",\n primaryIcon: \"material-icon-theme:vscode\",\n category: \"Development\",\n },\n\n source: {\n package: \"@highstate/apps\",\n path: \"code-server\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { providerEntity } from \"./dns\"\n\nexport const connection = defineUnit({\n type: \"cloudflare.connection\",\n\n secrets: {\n apiToken: Type.String(),\n },\n\n outputs: {\n dnsProvider: providerEntity,\n },\n\n meta: {\n displayName: \"Cloudflare Connection\",\n description: \"Creates a new Cloudflare connection for one zone.\",\n primaryIcon: \"simple-icons:cloudflare\",\n category: \"Cloudflare\",\n },\n\n source: {\n package: \"@highstate/cloudflare\",\n path: \"connection\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { clusterInputs, clusterOutputs } from \"./k8s\"\n\nexport const cluster = defineUnit({\n type: \"k3s.cluster\",\n\n args: {\n /**\n * The K3S configuration to pass to each server or agent in the cluster.\n *\n * See: https://docs.k3s.io/installation/configuration\n *\n * @schema\n */\n config: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The K3S configuration to pass to each server or agent in the cluster.\n\n See: https://docs.k3s.io/installation/configuration`,\n},\n\n /**\n * The configuration of the registries to use for the K3S cluster.\n *\n * See: https://docs.k3s.io/installation/private-registry\n *\n * @schema\n */\n registries: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The configuration of the registries to use for the K3S cluster.\n\n See: https://docs.k3s.io/installation/private-registry`,\n},\n },\n\n inputs: clusterInputs,\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"K3s Cluster\",\n description: \"The K3s cluster created on top of the server.\",\n category: \"k3s\",\n primaryIcon: \"devicon:k3s\",\n secondaryIcon: \"devicon:kubernetes\",\n },\n\n source: {\n package: \"@highstate/k3s\",\n path: \"cluster\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { networkEntity, peerEntity } from \"./wireguard\"\nimport { l4EndpointEntity } from \"./network\"\n\nexport const peer = defineUnit({\n type: \"mullvad.peer\",\n\n args: {\n hostname: Type.Optional(Type.String()),\n\n /**\n * Whether to include Mullvad DNS servers in the peer configuration.\n *\n * @schema\n */\n includeDns: {\n ...Type.Default(Type.Boolean(), true),\n description: `Whether to include Mullvad DNS servers in the peer configuration.`,\n},\n },\n\n inputs: {\n /**\n * The network to use for the WireGuard peer.\n *\n * If not provided, the peer will use default network configuration.\n *\n * @schema\n */\n network: {\n ...{\n entity: networkEntity,\n required: false,\n },\n description: `The network to use for the WireGuard peer.\n\n If not provided, the peer will use default network configuration.`,\n},\n },\n\n outputs: {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Mullvad Peer\",\n description: \"The Mullvad WireGuard peer fetched from the Mullvad API.\",\n primaryIcon: \"simple-icons:mullvad\",\n secondaryIcon: \"cib:wireguard\",\n secondaryIconColor: \"#88171a\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/mullvad\",\n path: \"peer\",\n },\n})\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { serverEntity } from \"./common\"\nimport { keyPairEntity } from \"./ssh\"\n\nexport const connectionEntity = defineEntity({\n type: \"timeweb.connection\",\n\n schema: Type.Object({\n name: Type.String(),\n apiToken: Type.String(),\n }),\n})\n\nexport const connection = defineUnit({\n type: \"timeweb.connection\",\n\n secrets: {\n apiToken: Type.String(),\n },\n\n outputs: {\n connection: connectionEntity,\n },\n\n meta: {\n displayName: \"Timeweb Connection\",\n description: \"Creates a new Timeweb connection.\",\n primaryIcon: \"material-symbols:cloud\",\n category: \"Timeweb\",\n },\n\n source: {\n package: \"@highstate/timeweb\",\n path: \"connection\",\n },\n})\n\nexport const virtualMachine = defineUnit({\n type: \"timeweb.virtual-machine\",\n\n args: {\n presetId: Type.Optional(Type.Number()),\n osId: Type.Optional(Type.Number()),\n availabilityZone: Type.String(),\n },\n\n inputs: {\n connection: connectionEntity,\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n },\n\n secrets: {\n sshPrivateKey: Type.Optional(Type.String()),\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"Timeweb Virtual Machine\",\n description: \"Creates a new Timeweb virtual machine.\",\n primaryIcon: \"material-symbols:cloud\",\n secondaryIcon: \"codicon:vm\",\n category: \"Timeweb\",\n },\n\n source: {\n package: \"@highstate/timeweb\",\n path: \"virtual-machine\",\n },\n})\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { fileEntity, serverEntity } from \"./common\"\n\nexport const inlineModuleEntity = defineEntity({\n type: \"nixos.inline-module\",\n\n schema: Type.Object({\n code: Type.String(),\n }),\n\n meta: {\n displayName: \"NixOS Inline Module\",\n description: \"The NixOS module reference.\",\n color: \"#5277c3\",\n },\n})\n\nexport const inlineModule = defineUnit({\n type: \"nixos.inline-module\",\n\n args: {\n code: Type.String({ language: \"nix\" }),\n },\n\n inputs: {\n files: {\n entity: fileEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n module: inlineModuleEntity,\n },\n\n meta: {\n displayName: \"NixOS Inline Module\",\n description: \"Creates a NixOS module from inline code.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"mdi:file-code\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"inline-module\",\n },\n})\n\nexport const flakeEntity = defineEntity({\n type: \"nixos.flake\",\n\n schema: Type.Object({\n url: Type.String(),\n }),\n\n meta: {\n displayName: \"NixOS Flake\",\n description: \"The NixOS flake reference.\",\n color: \"#5277c3\",\n },\n})\n\nexport const remoteFlake = defineUnit({\n type: \"nixos.remote-flake\",\n\n args: {\n url: Type.String(),\n },\n\n outputs: {\n flake: flakeEntity,\n },\n\n meta: {\n displayName: \"NixOS Remote Flake\",\n description: \"References a remote NixOS flake.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"simple-icons:git\",\n secondaryIconColor: \"#f1502f\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"flake\",\n },\n})\n\nexport const inlineFlake = defineUnit({\n type: \"nixos.inline-flake\",\n\n args: {\n code: Type.String({ language: \"nix\" }),\n },\n\n inputs: {\n flakes: {\n entity: flakeEntity,\n required: false,\n multiple: true,\n },\n modules: {\n entity: inlineModuleEntity,\n required: false,\n multiple: true,\n },\n files: {\n entity: fileEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n flake: flakeEntity,\n },\n\n meta: {\n displayName: \"NixOS Inline Flake\",\n description: \"Creates a NixOS flake from inline code.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"mdi:file-code\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"inline-flake\",\n },\n})\n\nexport const system = defineUnit({\n type: \"nixos.system\",\n\n args: {\n system: Type.Optional(Type.String()),\n },\n\n inputs: {\n flake: flakeEntity,\n server: serverEntity,\n modules: {\n entity: inlineModuleEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"NixOS System\",\n description: \"Creates a NixOS system on top of any server.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"codicon:vm\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"system\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { fileEntity, serverEntity } from \"./common\"\n\nexport const secrets = defineUnit({\n type: \"sops.secrets\",\n\n args: {\n secrets: Type.Record(Type.String(), Type.Any()),\n },\n\n inputs: {\n servers: {\n entity: serverEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n file: fileEntity,\n },\n\n meta: {\n displayName: \"SOPS Secrets\",\n description: \"Encrypts secrets using SOPS for the specified servers.\",\n primaryIcon: \"mdi:file-lock\",\n category: \"Secrets\",\n },\n\n source: {\n package: \"@highstate/sops\",\n path: \"secrets\",\n },\n})\n","export * from \"./shared\"\nexport * as phantun from \"./phantun\"\n","import { Type, type Static, type TObject } from \"@highstate/contract\"\nimport { clusterEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\n\nexport const deobfuscatorSpec = {\n args: {\n /**\n * The name of the namespace and deployment to deploy the deobfuscator on.\n *\n * By default, calculated as `deobfs-{type}-{name}`.\n */\n appName: Type.Optional(Type.String()),\n\n /**\n * The L4 endpoint to forward deobfuscated traffic to.\n *\n * Will take precedence over the `targetEndpoint` input.\n *\n * @schema\n */\n targetEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The L4 endpoint to forward deobfuscated traffic to.\n\n Will take precedence over the \\`targetEndpoint\\` input.`,\n},\n\n /**\n * Whether to expose the deobfuscator service by \"NodePort\" or \"LoadBalancer\".\n *\n * By default, the service is not exposed and only accessible from within the cluster.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the deobfuscator service by \"NodePort\" or \"LoadBalancer\".\n\n By default, the service is not exposed and only accessible from within the cluster.`,\n},\n },\n\n inputs: {\n /**\n * The Kubernetes cluster to deploy the deobfuscator on.\n *\n * @schema\n */\n k8sCluster: {\n ...clusterEntity,\n description: `The Kubernetes cluster to deploy the deobfuscator on.`,\n},\n\n /**\n * The L4 endpoints to forward deobfuscated traffic to.\n *\n * Will select the most appropriate endpoint based on the environment.\n *\n * @schema\n */\n targetEndpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints to forward deobfuscated traffic to.\n\n Will select the most appropriate endpoint based on the environment.`,\n},\n },\n\n outputs: {\n /**\n * The L4 endpoints of the deobfuscator accepting obfuscated traffic.\n *\n * @schema\n */\n endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the deobfuscator accepting obfuscated traffic.`,\n},\n },\n} as const\n\nexport const obfuscatorSpec = {\n args: {\n /**\n * The name of the namespace and deployment to deploy the obfuscator on.\n *\n * By default, calculated as `obfs-{type}-{name}`.\n */\n appName: Type.Optional(Type.String()),\n\n /**\n * The endpoint of the deobfuscator to pass obfuscated traffic to.\n *\n * Will take precedence over the `endpoint` input.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoint of the deobfuscator to pass obfuscated traffic to.\n\n Will take precedence over the \\`endpoint\\` input.`,\n},\n\n /**\n * Whether to expose the obfuscator service by \"NodePort\" or \"LoadBalancer\".\n *\n * By default, the service is not exposed and only accessible from within the cluster.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the obfuscator service by \"NodePort\" or \"LoadBalancer\".\n\n By default, the service is not exposed and only accessible from within the cluster.`,\n},\n },\n\n inputs: {\n /**\n * The Kubernetes cluster to deploy the obfuscator on.\n *\n * @schema\n */\n k8sCluster: {\n ...clusterEntity,\n description: `The Kubernetes cluster to deploy the obfuscator on.`,\n},\n\n /**\n * The L4 endpoints of the deobfuscator to pass obfuscated traffic to.\n *\n * Will select the most appropriate endpoint based on the environment.\n *\n * @schema\n */\n endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the deobfuscator to pass obfuscated traffic to.\n\n Will select the most appropriate endpoint based on the environment.`,\n},\n },\n\n outputs: {\n /**\n * The L4 endpoints accepting unobfuscated traffic.\n *\n * @schema\n */\n entryEndpoints: {\n ...{\n entity: l4EndpointEntity,\n multiple: true,\n },\n description: `The L4 endpoints accepting unobfuscated traffic.`,\n},\n },\n} as const\n\nexport type DeobfuscatorArgs = Static<TObject<(typeof deobfuscatorSpec)[\"args\"]>>\nexport type ObfuscatorArgs = Static<TObject<(typeof obfuscatorSpec)[\"args\"]>>\n","import { defineUnit } from \"@highstate/contract\"\nimport { deobfuscatorSpec, obfuscatorSpec } from \"./shared\"\n\nexport const deobfuscator = defineUnit({\n type: \"obfuscators.phantun.deobfuscator\",\n ...deobfuscatorSpec,\n\n meta: {\n displayName: \"Phantun Deobfuscator\",\n description: \"The Phantun Deobfuscator deployed on Kubernetes.\",\n primaryIcon: \"mdi:network-outline\",\n secondaryIcon: \"mdi:hide\",\n category: \"Obfuscators\",\n },\n\n source: {\n package: \"@highstate/obfuscators\",\n path: \"phantun/deobfuscator\",\n },\n})\n\nexport const obfuscator = defineUnit({\n type: \"obfuscators.phantun.obfuscator\",\n ...obfuscatorSpec,\n\n meta: {\n displayName: \"Phantun Obfuscator\",\n description: \"The Phantun Obfuscator deployed on Kubernetes.\",\n primaryIcon: \"mdi:network-outline\",\n secondaryIcon: \"mdi:hide\",\n category: \"Obfuscators\",\n },\n\n source: {\n package: \"@highstate/obfuscators\",\n path: \"phantun/obfuscator\",\n },\n})\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,gBAAAA,eAAc,cAAAC,aAAY,QAAAC,aAAy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AAA,IAMN,YAAY;AAAA,MACd,GAAGC;AAAA,MACH,aAAa;AAAA,IACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASI,WAAW;AAAA,MACb,GAAG;AAAA,QACC,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,MACF,aAAa;AAAA;AAAA;AAAA,IAGf;AAAA,EACE;AAAA,EAEA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMP,gBAAgB;AAAA,MAClB,GAAG;AAAA,QACC,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACF,aAAa;AAAA,IACf;AAAA,EACE;AACF;;;AC3KA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,cAAAC,oBAAkB;AAGpB,IAAM,eAAeC,aAAW;AAAA,EACrC,MAAM;AAAA,EACN,GAAG;AAAA,EAEH,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AAAA,EAEA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CAAC;AAEM,IAAM,aAAaA,aAAW;AAAA,EACnC,MAAM;AAAA,EACN,GAAG;AAAA,EAEH,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AAAA,EAEA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CAAC;","names":["defineEntity","defineUnit","Type","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","defineEntity","Type","Type","defineEntity","Type","defineEntity","Type","defineUnit","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","clusterEntity","defineEntity","defineUnit","Type","Type","defineEntity","clusterEntity","defineUnit","clusterEntity","cniSchema","defineEntity","defineUnit","Type","clusterEntity","defineEntity","Type","cniSchema","defineUnit","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","clusterEntity","createArgs","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","Type","createArgs","inputs","clusterEntity","defineEntity","defineUnit","createArgs","Type","defineEntity","defineUnit","Type","defineEntity","defineUnit","createArgs","Type","defineUnit","Type","defineUnit","createArgs","Type","defineEntity","defineUnit","Type","defineEntity","defineUnit","createArgs","Type","defineUnit","Type","Type","defineUnit","defineUnit","Type","endpointFilterSchema","Type","defineUnit","defineUnit","Type","defineUnit","createArgs","Type","defineUnit","defineUnit","createArgs","defineUnit","defineUnit","createArgs","defineUnit","Type","defineUnit","createArgs","Type","defineUnit","Type","defineUnit","Type","defineUnit","Type","Type","defineUnit","createArgs","defineUnit","Type","defineUnit","createArgs","Type","connection","defineUnit","Type","connection","defineUnit","Type","cluster","defineUnit","Type","cluster","defineUnit","Type","peer","defineUnit","Type","peer","defineUnit","Type","connection","virtualMachine","defineEntity","defineUnit","Type","defineEntity","Type","connection","defineUnit","virtualMachine","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","defineUnit","Type","defineUnit","Type","Type","Type","clusterEntity","defineUnit","defineUnit"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/ssh.ts","../src/network.ts","../src/dns.ts","../src/utils.ts","../src/proxmox.ts","../src/k8s.ts","../src/talos.ts","../src/wireguard.ts","../src/apps/index.ts","../src/apps/mariadb.ts","../src/apps/shared.ts","../src/restic.ts","../src/apps/postgresql.ts","../src/apps/vaultwarden.ts","../src/apps/mongodb.ts","../src/apps/network.ts","../src/apps/dns.ts","../src/apps/traefik.ts","../src/apps/kubernetes-dashboard.ts","../src/apps/grocy.ts","../src/apps/maybe.ts","../src/apps/deployment.ts","../src/apps/syncthing.ts","../src/apps/code-server.ts","../src/cloudflare.ts","../src/k3s.ts","../src/mullvad.ts","../src/timeweb.ts","../src/nixos.ts","../src/sops.ts","../src/obfuscators/index.ts","../src/obfuscators/shared.ts","../src/obfuscators/phantun.ts"],"sourcesContent":["import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { credentialsSchema, keyPairEntity } from \"./ssh\"\nimport { l3EndpointEntity } from \"./network\"\nimport * as dns from \"./dns\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const serverEntity = defineEntity({\n type: \"common.server\",\n\n schema: Type.Object({\n hostname: Type.String(),\n endpoints: Type.Array(l3EndpointEntity.schema),\n ssh: Type.Optional(credentialsSchema),\n }),\n\n meta: {\n color: \"#009688\",\n },\n})\n\nexport const serverOutputs = {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n} as const\n\nexport const existingServer = defineUnit({\n type: \"common.existing-server\",\n\n args: {\n /**\n * The endpoint of the server.\n *\n * Takes precedence over the `endpoint` input.\n */\n endpoint: Type.Optional(Type.String()),\n\n /**\n * The SSH user to use for connecting to the server.\n */\n sshUser: Type.Default(Type.String(), \"root\"),\n\n /**\n * The SSH port to use for connecting to the server.\n */\n sshPort: Type.Default(Type.Number(), 22),\n },\n\n secrets: {\n sshPassword: Type.Optional(Type.String()),\n sshPrivateKey: Type.Optional(Type.String()),\n },\n\n inputs: {\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n endpoint: {\n entity: l3EndpointEntity,\n required: false,\n },\n },\n\n outputs: serverOutputs,\n\n meta: {\n displayName: \"Existing Server\",\n description: \"An existing server that can be used in the configuration.\",\n primaryIcon: \"mdi:server\",\n defaultNamePrefix: \"server\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/existing-server\",\n },\n})\n\nexport const serverPatch = defineUnit({\n type: \"common.server-patch\",\n\n args: {\n /**\n * The endpoints of the server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same server may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the server.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same server may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n },\n\n inputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Server Patch\",\n description: \"Patches some properties of the server.\",\n primaryIcon: \"mdi:server\",\n secondaryIcon: \"fluent:patch-20-filled\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/server-patch\",\n },\n})\n\nexport const serverDns = defineUnit({\n type: \"common.server-dns\",\n\n args: dns.createArgs(),\n\n inputs: {\n server: serverEntity,\n ...dns.inputs,\n },\n\n outputs: {\n server: serverEntity,\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Server DNS\",\n description: \"Creates DNS records for the server and updates endpoints.\",\n primaryIcon: \"mdi:server\",\n secondaryIcon: \"mdi:dns\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/server-dns\",\n },\n})\n\nexport const script = defineUnit({\n type: \"common.script\",\n\n args: {\n script: Type.String({ language: \"shell\" }),\n updateScript: Type.Optional(Type.String({ language: \"shell\" })),\n deleteScript: Type.Optional(Type.String({ language: \"shell\" })),\n },\n\n inputs: {\n server: serverEntity,\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"Shell Script\",\n description: \"Run a shell script on the server.\",\n primaryIcon: \"mdi:bash\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/script\",\n },\n})\n\nexport const fileMetaEntity = defineEntity({\n type: \"common.file-meta\",\n\n schema: Type.Object({\n name: Type.String(),\n size: Type.Number(),\n mode: Type.Number(),\n isBinary: Type.Optional(Type.Boolean()),\n }),\n\n meta: {\n color: \"#FF5722\",\n description: \"Metadata for a file.\",\n },\n})\n\nexport const fileContentEntity = defineEntity({\n type: \"common.file-content\",\n\n schema: Type.Union([\n Type.Object({\n type: Type.Literal(\"inline\"),\n content: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"remote\"),\n url: Type.String(),\n }),\n ]),\n\n meta: {\n color: \"#FF5722\",\n description: \"The content of a file.\",\n },\n})\n\nexport const fileEntity = defineEntity({\n type: \"common.file\",\n\n schema: Type.Object({\n meta: fileMetaEntity.schema,\n content: fileContentEntity.schema,\n }),\n\n meta: {\n color: \"#FF5722\",\n },\n})\n\nexport type Server = Static<typeof serverEntity.schema>\n\nexport type File = Static<typeof fileEntity.schema>\nexport type FileMeta = Static<typeof fileMetaEntity.schema>\nexport type FileContent = Static<typeof fileContentEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { l4EndpointEntity } from \"./network\"\n\nexport const keyTypeSchema = Type.StringEnum([\"ed25519\"])\n\nexport const keyPairEntity = defineEntity({\n type: \"ssh.key-pair\",\n\n schema: Type.Object({\n type: keyTypeSchema,\n fingerprint: Type.String(),\n publicKey: Type.String(),\n privateKey: Type.String(),\n }),\n\n meta: {\n color: \"#2b5797\",\n },\n})\n\nexport const credentialsSchema = Type.Object({\n endpoints: Type.Array(l4EndpointEntity.schema),\n hostKey: Type.String(),\n user: Type.String(),\n password: Type.Optional(Type.String()),\n keyPair: Type.Optional(keyPairEntity.schema),\n})\n\nexport const keyPair = defineUnit({\n type: \"ssh.key-pair\",\n\n secrets: {\n privateKey: Type.Optional(Type.String()),\n },\n\n outputs: {\n keyPair: keyPairEntity,\n },\n\n meta: {\n displayName: \"SSH Key Pair\",\n description: \"Holds the ED25519 SSH key pair and generates the private key if not provided.\",\n category: \"ssh\",\n primaryIcon: \"charm:key\",\n primaryIconColor: \"#ffffff\",\n secondaryIcon: \"mdi:lock\",\n secondaryIconColor: \"#ffffff\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/ssh/key-pair\",\n },\n})\n\nexport type KeyType = Static<typeof keyTypeSchema>\nexport type Credentials = Static<typeof credentialsSchema>\nexport type KeyPair = Static<typeof keyPairEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\n\nexport const endpointVisibilitySchema = Type.StringEnum([\n \"public\", // Reachable from the public internet\n \"external\", // Reachable from outside the system boundary, but not public\n \"internal\", // Reachable only from within the system or cluster\n])\n\nexport const endpointFilterSchema = Type.Array(endpointVisibilitySchema)\n\nexport const l3EndpointEntity = defineEntity({\n type: \"network.l3-endpoint\",\n\n schema: Type.Intersect([\n Type.Object({\n visibility: endpointVisibilitySchema,\n metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n }),\n Type.Union([\n Type.Object({\n type: Type.Literal(\"hostname\"),\n\n /**\n * The hostname of the endpoint in the format of a domain name.\n */\n hostname: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"ipv4\"),\n\n /**\n * The IPv4 address of the endpoint.\n */\n address: Type.String(),\n }),\n Type.Object({\n type: Type.Literal(\"ipv6\"),\n\n /**\n * The IPv6 address of the endpoint.\n */\n address: Type.String(),\n }),\n ]),\n ]),\n\n meta: {\n color: \"#4CAF50\",\n description: \"The L3 endpoint for some service. May be a domain name or an IP address.\",\n },\n})\n\nexport const l4ProtocolSchema = Type.StringEnum([\"tcp\", \"udp\"])\n\nexport const portInfoSchema = Type.Object({\n port: Type.Number(),\n protocol: l4ProtocolSchema,\n})\n\nexport const l4EndpointEntity = defineEntity({\n type: \"network.l4-endpoint\",\n\n schema: Type.Intersect([l3EndpointEntity.schema, portInfoSchema]),\n\n meta: {\n color: \"#2196F3\",\n description: \"The L4 endpoint for some service. Extends an L3 endpoint with a port.\",\n },\n})\n\nexport const l3Endpoint = defineUnit({\n type: \"network.l3-endpoint\",\n\n args: {\n /**\n * The string representation of the endpoint.\n *\n * May be a domain name or an IP address.\n */\n endpoint: Type.String(),\n\n /**\n * The visibility of the endpoint.\n */\n visibility: Type.Default(endpointVisibilitySchema, \"public\"),\n },\n\n outputs: {\n endpoint: l3EndpointEntity,\n },\n\n meta: {\n displayName: \"L3 Endpoint\",\n description: \"An L3 endpoint for some service. May be a domain name or an IP address.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#4CAF50\",\n defaultNamePrefix: \"endpoint\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/network/l3-endpoint\",\n },\n})\n\nexport const l4Endpoint = defineUnit({\n type: \"network.l4-endpoint\",\n\n args: {\n /**\n * The string representation of the endpoint.\n *\n * May be a domain name or an IP address + port/protocol.\n *\n * The possible formats are:\n *\n * - `endpoint:port` (TCP by default)\n * - `tcp://endpoint:port`\n * - `udp://endpoint:port`\n */\n endpoint: Type.String(),\n\n /**\n * The visibility of the endpoint.\n */\n visibility: Type.Default(endpointVisibilitySchema, \"public\"),\n },\n\n outputs: {\n endpoint: l4EndpointEntity,\n },\n\n meta: {\n displayName: \"L4 Endpoint\",\n description: \"An L4 endpoint for some service. Extends an L3 endpoint with a port.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#2196F3\",\n defaultNamePrefix: \"endpoint\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/common\",\n path: \"units/network/l4-endpoint\",\n },\n})\n\n/**\n * The generic visibility of an endpoint.\n *\n * - `public`: Reachable from the public internet.\n * - `external`: Reachable from outside the system boundary (e.g., LAN, VPC), but not public.\n * - `internal`: Reachable only from within the application or infrastructure boundary (e.g., within a cluster).\n */\nexport type EndpointVisibility = Static<typeof endpointVisibilitySchema>\n\n/**\n * Filter values used to select relevant endpoints based on visibility.\n *\n * - `public`: Only endpoints exposed to the public internet.\n * - `private`: Endpoints not publicly accessible (external + internal).\n * - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).\n * - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).\n * - `most`: Select the most widely accessible endpoints, preferring visibility in the following order: `public` > `external` > `internal`.\n * - If any public endpoints exist, all public endpoints are selected.\n * - Otherwise, if any external endpoints exist, all external endpoints are selected.\n * - If neither exist, all internal endpoints are selected.\n */\nexport type EndpointFilter = Static<typeof endpointFilterSchema>\n\nexport type L3Endpoint = Static<typeof l3EndpointEntity.schema>\nexport type L4Endpoint = Static<typeof l4EndpointEntity.schema>\nexport type L4Protocol = Static<typeof l4ProtocolSchema>\nexport type L4PortInfo = Static<typeof portInfoSchema>\n\n/**\n * The L3 or L4 endpoint for some service.\n */\nexport type L34Endpoint = (L3Endpoint & { port?: undefined; protocol?: undefined }) | L4Endpoint\n","import { defineEntity, Type, type Static } from \"@highstate/contract\"\nimport { endpointFilterSchema } from \"./network\"\nimport { arrayPatchModeSchema, prefixKeysWith } from \"./utils\"\n\nexport const providerEntity = defineEntity({\n type: \"dns.provider\",\n\n schema: Type.Object({\n name: Type.String(),\n type: Type.String(),\n data: Type.Record(Type.String(), Type.Unknown()),\n domain: Type.String(),\n }),\n\n meta: {\n color: \"#FF5722\",\n },\n})\n\nexport function createArgs<TPrefix extends string = \"\">(prefix?: TPrefix) {\n return prefixKeysWith(prefix, {\n /**\n * The FQDN to register the existing endpoints with.\n *\n * Will be inserted at the beginning of the resulting endpoint list.\n *\n * Will throw an error if no matching provider is found.\n *\n * @schema\n */\n fqdn: {\n ...Type.Optional(Type.String()),\n description: `The FQDN to register the existing endpoints with.\n\n Will be inserted at the beginning of the resulting endpoint list.\n\n Will throw an error if no matching provider is found.`,\n},\n\n /**\n * The endpoint filter to filter the endpoints before creating the DNS records.\n *\n * Possible values:\n *\n * - `public`: Only endpoints exposed to the public internet.\n * - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).\n * - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).\n *\n * You can select one or more values.\n *\n * If no value is provided, the endpoints will be filtered by the most accessible type:\n *\n * - If any public endpoints exist, all public endpoints are selected;\n * - Otherwise, if any external endpoints exist, all external endpoints are selected;\n * - If neither exist, all internal endpoints are selected.\n *\n * @schema\n */\n endpointFilter: {\n ...Type.Default(endpointFilterSchema, []),\n description: `The endpoint filter to filter the endpoints before creating the DNS records.\n\n Possible values:\n\n - \\`public\\`: Only endpoints exposed to the public internet.\n - \\`external\\`: Reachable from outside the system but not public (e.g., LAN, VPC).\n - \\`internal\\`: Reachable only from within the system boundary (e.g., inside a cluster).\n\n You can select one or more values.\n\n If no value is provided, the endpoints will be filtered by the most accessible type:\n\n - If any public endpoints exist, all public endpoints are selected;\n - Otherwise, if any external endpoints exist, all external endpoints are selected;\n - If neither exist, all internal endpoints are selected.`,\n},\n\n /**\n * The mode to use for patching the existing endpoints.\n *\n * - `prepend`: Prepend the FQDN to the existing endpoints. It will make them prioritized.\n * - `replace`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.\n *\n * The default is `prepend`.\n *\n * @schema\n */\n patchMode: {\n ...Type.Default(arrayPatchModeSchema, \"prepend\"),\n description: `The mode to use for patching the existing endpoints.\n\n - \\`prepend\\`: Prepend the FQDN to the existing endpoints. It will make them prioritized.\n - \\`replace\\`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.\n\n The default is \\`prepend\\`.`,\n},\n })\n}\n\nexport const inputs = {\n /**\n * The DNS providers to use to create the DNS records.\n *\n * If multiple providers match the domain, all of them will be used and multiple DNS records will be created.\n *\n * @schema\n */\n dnsProviders: {\n ...{\n entity: providerEntity,\n multiple: true,\n },\n description: `The DNS providers to use to create the DNS records.\n\n If multiple providers match the domain, all of them will be used and multiple DNS records will be created.`,\n},\n} as const\n\nexport type Provider = Static<typeof providerEntity.schema>\n","import { Type, type Static } from \"@highstate/contract\"\n\ntype PrefixWith<TString extends string, TPrefix extends string> = TPrefix extends \"\"\n ? TString\n : `${TPrefix}${Capitalize<TString>}`\n\nfunction prefixWith<TString extends string, TPrefix extends string>(\n string: TString,\n prefix?: TPrefix,\n): PrefixWith<TString, TPrefix> {\n return (\n prefix ? `${prefix}${string.charAt(0).toUpperCase()}${string.slice(1)}` : string\n ) as PrefixWith<TString, TPrefix>\n}\n\ntype PrefixedKeys<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as PrefixWith<Extract<K, string>, Prefix>]: T[K]\n}\n\nexport function prefixKeysWith<T extends Record<string, unknown>, Prefix extends string>(\n prefix: Prefix | undefined,\n obj: T,\n): PrefixedKeys<T, Prefix> {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [prefixWith(key, prefix), value]),\n ) as PrefixedKeys<T, Prefix>\n}\n\nexport const arrayPatchModeSchema = Type.StringEnum([\"prepend\", \"replace\"])\n\n/**\n * The mode to use when patching some array.\n *\n * - `prepend`: Prepend the values of the new array to the existing array.\n * - `replace`: Replace the existing array with the new array.\n */\nexport type ArrayPatchMode = Static<typeof arrayPatchModeSchema>\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { serverOutputs } from \"./common\"\nimport { keyPairEntity } from \"./ssh\"\n\nexport const clusterEntity = defineEntity({\n type: \"proxmox.cluster\",\n\n schema: Type.Object({\n endpoint: Type.String(),\n insecure: Type.Optional(Type.Boolean()),\n username: Type.Optional(Type.String()),\n\n defaultNodeName: Type.String(),\n defaultDatastoreId: Type.String(),\n\n password: Type.Optional(Type.String()),\n apiToken: Type.Optional(Type.String()),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const imageEntity = defineEntity({\n type: \"proxmox.image\",\n\n schema: Type.Object({\n id: Type.String(),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const connection = defineUnit({\n type: \"proxmox.connection\",\n\n args: {\n endpoint: Type.String(),\n insecure: Type.Optional(Type.Boolean()),\n username: Type.Optional(Type.String()),\n\n defaultNodeName: Type.Optional(Type.String()),\n defaultDatastoreId: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n apiToken: Type.Optional(Type.String()),\n },\n\n outputs: {\n proxmoxCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Proxmox Connection\",\n description: \"The connection to an existing Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"connection\",\n },\n})\n\nexport const image = defineUnit({\n type: \"proxmox.image\",\n\n args: {\n url: Type.String(),\n nodeName: Type.Optional(Type.String()),\n sha256: Type.Optional(Type.String()),\n datastoreId: Type.Optional(Type.String()),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n },\n\n outputs: {\n image: imageEntity,\n },\n\n meta: {\n displayName: \"Proxmox Image\",\n description: \"The image to upload to a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"mage:compact-disk-fill\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"image\",\n },\n})\n\nexport const existingImage = defineUnit({\n type: \"proxmox.existing-image\",\n\n args: {\n id: Type.String(),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n },\n\n outputs: {\n image: imageEntity,\n },\n\n meta: {\n displayName: \"Proxmox Existing Image\",\n description: \"The existing image on a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"mage:compact-disk-fill\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"existing-image\",\n },\n})\n\nexport const virtualMachine = defineUnit({\n type: \"proxmox.virtual-machine\",\n\n args: {\n nodeName: Type.Optional(Type.String()),\n\n cpuType: Type.Optional(Type.String({ default: \"host\" })),\n cores: Type.Optional(Type.Number({ default: 1 })),\n sockets: Type.Optional(Type.Number({ default: 1 })),\n memory: Type.Optional(Type.Number({ default: 512 })),\n\n ipv4: Type.Optional(Type.String()),\n ipv4Gateway: Type.Optional(Type.String()),\n dns: Type.Optional(Type.Array(Type.String())),\n\n datastoreId: Type.Optional(Type.String()),\n diskSize: Type.Optional(Type.Number({ default: 8 })),\n bridge: Type.Optional(Type.String({ default: \"vmbr0\" })),\n\n sshPort: Type.Optional(Type.Number({ default: 22 })),\n sshUser: Type.Optional(Type.String({ default: \"root\" })),\n\n waitForAgent: Type.Optional(Type.Boolean({ default: true })),\n },\n\n secrets: {\n sshPassword: Type.Optional(Type.String()),\n },\n\n inputs: {\n proxmoxCluster: clusterEntity,\n image: imageEntity,\n\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n },\n\n outputs: serverOutputs,\n\n meta: {\n displayName: \"Proxmox Virtual Machine\",\n description: \"The virtual machine on a Proxmox cluster.\",\n category: \"Proxmox\",\n primaryIcon: \"simple-icons:proxmox\",\n primaryIconColor: \"#e56901\",\n secondaryIcon: \"codicon:vm\",\n },\n\n source: {\n package: \"@highstate/proxmox\",\n path: \"virtual-machine\",\n },\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { Literal } from \"@sinclair/typebox\"\nimport * as dns from \"./dns\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\nimport { serverEntity } from \"./common\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const fallbackKubeApiAccessSchema = Type.Object({\n serverIp: Type.String(),\n serverPort: Type.Number(),\n})\n\nexport const tunDevicePolicySchema = Type.Union([\n Type.Object({\n type: Literal(\"host\"),\n }),\n Type.Object({\n type: Literal(\"plugin\"),\n resourceName: Type.String(),\n resourceValue: Type.String(),\n }),\n])\n\nexport const externalServiceTypeSchema = Type.StringEnum([\"NodePort\", \"LoadBalancer\"])\nexport const scheduleOnMastersPolicySchema = Type.StringEnum([\"always\", \"when-no-workers\", \"never\"])\nexport const cniSchema = Type.StringEnum([\"cilium\", \"other\"])\n\nexport const clusterQuirksSchema = Type.Object({\n /**\n * The IP and port of the kube-apiserver available from the cluster.\n *\n * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.\n *\n * @schema\n */\n fallbackKubeApiAccess: {\n ...Type.Optional(fallbackKubeApiAccessSchema),\n description: `The IP and port of the kube-apiserver available from the cluster.\n\n Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.`,\n},\n\n /**\n * Specifies the policy for using the tun device inside containers.\n *\n * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.\n *\n * For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.\n *\n * @schema\n */\n tunDevicePolicy: {\n ...Type.Optional(tunDevicePolicySchema),\n description: `Specifies the policy for using the tun device inside containers.\n\n If not provided, the default policy is \\`host\\` which assumes just mounting /dev/net/tun from the host.\n\n For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.`,\n},\n\n /**\n * The service type to use for external services.\n *\n * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.\n *\n * @schema\n */\n externalServiceType: {\n ...Type.Optional(externalServiceTypeSchema),\n description: `The service type to use for external services.\n\n If not provided, the default service type is \\`NodePort\\` since \\`LoadBalancer\\` may not be available.`,\n},\n})\n\nexport const clusterInfoProperties = {\n /**\n * The unique identifier of the cluster.\n *\n * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.\n *\n * @schema\n */\n id: {\n ...Type.String(),\n description: `The unique identifier of the cluster.\n\n Should be defined as a UUID of the \\`kube-system\\` namespace which is always present in the cluster.`,\n},\n\n /**\n * The name of the cluster.\n *\n * @schema\n */\n name: {\n ...Type.String(),\n description: `The name of the cluster.`,\n},\n\n /**\n * The name of the CNI plugin used by the cluster.\n *\n * Supported values are:\n * - `cilium`\n * - `other`\n *\n * @schema\n */\n cni: {\n ...cniSchema,\n description: `The name of the CNI plugin used by the cluster.\n\n Supported values are:\n - \\`cilium\\`\n - \\`other\\``,\n},\n\n /**\n * The endpoints of the cluster nodes.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Array(l3EndpointEntity.schema),\n description: `The endpoints of the cluster nodes.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The endpoints of the API server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n */\n apiEndpoints: Type.Array(l4EndpointEntity.schema),\n\n /**\n * The external IPs of the cluster nodes allowed to be used for external access.\n *\n * @schema\n */\n externalIps: {\n ...Type.Array(Type.String()),\n description: `The external IPs of the cluster nodes allowed to be used for external access.`,\n},\n\n /**\n * The extra quirks of the cluster to improve compatibility.\n *\n * @schema\n */\n quirks: {\n ...Type.Optional(clusterQuirksSchema),\n description: `The extra quirks of the cluster to improve compatibility.`,\n},\n} as const\n\nexport const serviceTypeSchema = Type.StringEnum([\"NodePort\", \"LoadBalancer\", \"ClusterIP\"])\n\nexport const metadataSchema = Type.Object({\n name: Type.String(),\n namespace: Type.String(),\n labels: Type.Optional(Type.Record(Type.String(), Type.String())),\n annotations: Type.Optional(Type.Record(Type.String(), Type.String())),\n})\n\nexport const resourceSchema = Type.Object({\n clusterId: Type.String(),\n metadata: metadataSchema,\n})\n\nexport const serviceEntity = defineEntity({\n type: \"k8s.service\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.service\"),\n ...resourceSchema.properties,\n endpoints: Type.Array(l4EndpointEntity.schema),\n }),\n\n meta: {\n color: \"#2196F3\",\n },\n})\n\nexport const clusterEntity = defineEntity({\n type: \"k8s.cluster\",\n\n schema: Type.Object({\n ...clusterInfoProperties,\n kubeconfig: Type.String(),\n }),\n\n meta: {\n color: \"#2196F3\",\n },\n})\n\nexport const internalIpsPolicySchema = Type.StringEnum([\"always\", \"public\", \"never\"])\n\nexport const scheduleOnMastersPolicyArgs = {\n /**\n * The policy for scheduling workloads on master nodes.\n *\n * - `always`: always schedule workloads on master nodes regardless of the number of workers;\n * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);\n * - `never`: never schedule workloads on master nodes.\n *\n * @schema\n */\n scheduleOnMastersPolicy: {\n ...Type.Default(scheduleOnMastersPolicySchema, \"when-no-workers\"),\n description: `The policy for scheduling workloads on master nodes.\n\n - \\`always\\`: always schedule workloads on master nodes regardless of the number of workers;\n - \\`when-no-workers\\`: schedule workloads on master nodes only if there are no workers (default);\n - \\`never\\`: never schedule workloads on master nodes.`,\n},\n}\n\nexport const clusterInputs = {\n masters: {\n entity: serverEntity,\n multiple: true,\n },\n workers: {\n entity: serverEntity,\n multiple: true,\n required: false,\n },\n} as const\n\nexport const clusterOutputs = {\n k8sCluster: clusterEntity,\n apiEndpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n} as const\n\nexport const existingCluster = defineUnit({\n type: \"k8s.existing-cluster\",\n\n args: {\n /**\n * The list of external IPs of the cluster nodes allowed to be used for external access.\n *\n * If not provided, will be automatically detected by querying the cluster nodes.\n *\n * @schema\n */\n externalIps: {\n ...Type.Optional(Type.Array(Type.String())),\n description: `The list of external IPs of the cluster nodes allowed to be used for external access.\n\n If not provided, will be automatically detected by querying the cluster nodes.`,\n},\n\n /**\n * The policy for using internal IPs of the nodes as external IPs.\n *\n * - `always`: always use internal IPs as external IPs;\n * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;\n * - `never`: never use internal IPs as external IPs.\n *\n * @schema\n */\n internalIpsPolicy: {\n ...Type.Default(internalIpsPolicySchema, \"public\"),\n description: `The policy for using internal IPs of the nodes as external IPs.\n\n - \\`always\\`: always use internal IPs as external IPs;\n - \\`public\\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;\n - \\`never\\`: never use internal IPs as external IPs.`,\n},\n\n /**\n * The extra quirks of the cluster to improve compatibility.\n *\n * @schema\n */\n quirks: {\n ...Type.Optional(clusterQuirksSchema),\n description: `The extra quirks of the cluster to improve compatibility.`,\n},\n },\n\n secrets: {\n /**\n * The kubeconfig of the cluster to use for connecting to the cluster.\n *\n * Will be available for all components using `cluster` output of this unit.\n *\n * @schema\n */\n kubeconfig: {\n ...Type.Record(Type.String(), Type.Any()),\n description: `The kubeconfig of the cluster to use for connecting to the cluster.\n\n Will be available for all components using \\`cluster\\` output of this unit.`,\n},\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Existing Cluster\",\n description: \"An existing Kubernetes cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/existing-cluster\",\n },\n})\n\nexport const clusterPatch = defineUnit({\n type: \"k8s.cluster-patch\",\n\n args: {\n /**\n * The endpoints of the API server.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n apiEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the API server.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the API endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n apiEndpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n /**\n * The endpoints of the cluster nodes.\n *\n * The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n *\n * The same node may also be represented by multiple entries (e.g. a node with private and public IP).\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the cluster nodes.\n\n The entry may represent real node endpoint or virtual endpoint (like a load balancer).\n\n The same node may also be represented by multiple entries (e.g. a node with private and public IP).`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n apiEndpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Cluster Patch\",\n description: \"Patches some properties of the cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"fluent:patch-20-filled\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cluster-patch\",\n },\n})\n\nexport const clusterDns = defineUnit({\n type: \"cluster-dns\",\n\n args: {\n ...dns.createArgs(),\n ...dns.createArgs(\"api\"),\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n ...dns.inputs,\n },\n\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"Cluster DNS\",\n description: \"Creates DNS records for the cluster and updates endpoints.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:dns\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cluster-dns\",\n },\n})\n\nexport const gatewayEntity = defineEntity({\n type: \"k8s.gateway\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n gatewayClassName: Type.String(),\n httpListenerPort: Type.Number(),\n httpsListenerPort: Type.Number(),\n endpoints: Type.Array(l3EndpointEntity.schema),\n }),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const tlsIssuerEntity = defineEntity({\n type: \"k8s.tls-issuer\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n clusterIssuerName: Type.String(),\n }),\n\n meta: {\n color: \"#f06292\",\n },\n})\n\nexport const accessPointEntity = defineEntity({\n type: \"k8s.access-point\",\n\n schema: Type.Object({\n clusterId: Type.String(),\n gateway: gatewayEntity.schema,\n tlsIssuer: tlsIssuerEntity.schema,\n dnsProviders: Type.Array(dns.providerEntity.schema),\n }),\n\n meta: {\n color: \"#F57F17\",\n },\n})\n\nexport const accessPoint = defineUnit({\n type: \"k8s.access-point\",\n\n inputs: {\n gateway: gatewayEntity,\n tlsIssuer: tlsIssuerEntity,\n dnsProviders: {\n entity: dns.providerEntity,\n multiple: true,\n },\n },\n\n outputs: {\n accessPoint: accessPointEntity,\n },\n\n meta: {\n displayName: \"Access Point\",\n description: \"An access point which can be used to connect to services.\",\n primaryIcon: \"mdi:access-point\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/access-point\",\n },\n})\n\nexport const certManager = defineUnit({\n type: \"k8s.cert-manager\",\n\n inputs: {\n k8sCluster: clusterEntity,\n },\n\n outputs: {\n k8sCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Cert Manager\",\n description: \"A certificate manager for managing TLS certificates.\",\n primaryIcon: \"simple-icons:letsencrypt\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/cert-manager\",\n },\n})\n\nexport const dns01TlsIssuer = defineUnit({\n type: \"k8s.dns01-issuer\",\n\n args: {\n /**\n * The top-level domains to filter the DNS01 challenge for.\n *\n * If not provided, will use all domains passed to the DNS providers.\n *\n * @schema\n */\n domains: {\n ...Type.Optional(Type.Array(Type.String())),\n description: `The top-level domains to filter the DNS01 challenge for.\n\n If not provided, will use all domains passed to the DNS providers.`,\n},\n },\n\n inputs: {\n k8sCluster: clusterEntity,\n dnsProviders: {\n entity: dns.providerEntity,\n multiple: true,\n },\n },\n\n outputs: {\n tlsIssuer: tlsIssuerEntity,\n },\n\n meta: {\n displayName: \"DNS01 Issuer\",\n description: \"A TLS issuer for issuing certificate using DNS01 challenge.\",\n primaryIcon: \"mdi:certificate\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/dns01-issuer\",\n },\n})\n\nexport const deploymentEntity = defineEntity({\n type: \"k8s.deployment\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.deployment\"),\n ...resourceSchema.properties,\n service: Type.Optional(serviceEntity.schema),\n }),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const statefulSetEntity = defineEntity({\n type: \"k8s.stateful-set\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.stateful-set\"),\n ...resourceSchema.properties,\n service: serviceEntity.schema,\n }),\n\n meta: {\n color: \"#FFC107\",\n },\n})\n\nexport const exposableWorkloadEntity = defineEntity({\n type: \"k8s.exposable-workload\",\n\n schema: Type.Union([deploymentEntity.schema, statefulSetEntity.schema]),\n\n meta: {\n color: \"#4CAF50\",\n },\n})\n\nexport const persistentVolumeClaimEntity = defineEntity({\n type: \"k8s.persistent-volume-claim\",\n\n schema: Type.Object({\n type: Type.Literal(\"k8s.persistent-volume-claim\"),\n ...resourceSchema.properties,\n }),\n\n meta: {\n color: \"#FFC107\",\n },\n})\n\nexport const interfaceEntity = defineEntity({\n type: \"k8s.interface\",\n\n schema: Type.Object({\n name: Type.String(),\n workload: exposableWorkloadEntity.schema,\n }),\n\n meta: {\n color: \"#2196F3\",\n description:\n \"The interface in a network space of pod kernel which can accept or transmit packets.\",\n },\n})\n\nexport const gatewayApi = defineUnit({\n type: \"k8s.gateway-api\",\n\n inputs: {\n k8sCluster: clusterEntity,\n },\n\n outputs: {\n k8sCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Gateway API\",\n description: \"Installs the Gateway API CRDs to the cluster.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:api\",\n secondaryIconColor: \"#4CAF50\",\n category: \"Kubernetes\",\n },\n\n source: {\n package: \"@highstate/k8s\",\n path: \"units/gateway-api\",\n },\n})\n\nexport type CNI = Static<typeof cniSchema>\nexport type Cluster = Static<typeof clusterEntity.schema>\n\nexport type Gateway = Static<typeof gatewayEntity.schema>\nexport type TlsIssuer = Static<typeof tlsIssuerEntity.schema>\nexport type AccessPoint = Static<typeof accessPointEntity.schema>\n\nexport type Metadata = Static<typeof metadataSchema>\nexport type Resource = Static<typeof resourceSchema>\n\nexport type ServiceType = Static<typeof serviceTypeSchema>\nexport type Service = Static<typeof serviceEntity.schema>\n\nexport type Deployment = Static<typeof deploymentEntity.schema>\nexport type ExposableWorkload = Static<typeof exposableWorkloadEntity.schema>\n\nexport type PersistentVolumeClaim = Static<typeof persistentVolumeClaimEntity.schema>\nexport type StatefulSet = Static<typeof statefulSetEntity.schema>\n\nexport type Interface = Static<typeof interfaceEntity.schema>\nexport type InternalIpsPolicy = Static<typeof internalIpsPolicySchema>\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { clusterInputs, clusterOutputs, scheduleOnMastersPolicyArgs } from \"./k8s\"\n\nexport const clusterEntity = defineEntity({\n type: \"talos.cluster\",\n\n schema: Type.Object({\n clientConfiguration: Type.String(),\n machineSecrets: Type.String(),\n }),\n\n meta: {\n color: \"#2d2d2d\",\n },\n})\n\nexport const cniSchema = Type.StringEnum([\"none\", \"cilium\", \"flannel\"])\nexport const csiSchema = Type.StringEnum([\"none\", \"local-path-provisioner\"])\n\nexport const cluster = defineUnit({\n type: \"talos.cluster\",\n\n args: {\n ...scheduleOnMastersPolicyArgs,\n\n /**\n * The name of the cluster.\n *\n * By default, the name of the instance is used.\n *\n * @schema\n */\n clusterName: {\n ...Type.Optional(Type.String()),\n description: `The name of the cluster.\n\n By default, the name of the instance is used.`,\n},\n\n /**\n * The CNI plugin to use.\n *\n * The following options are available:\n * - \"cilium\" (default)\n * - \"flannel\" (built-in in Talos)\n * - \"none\" (disable CNI, must be installed manually)\n *\n * The \"cilium\" CNI plugin is recommended to cover advanced network policies like FQDNs.\n *\n * @schema\n */\n cni: {\n ...Type.Default(cniSchema, \"cilium\"),\n description: `The CNI plugin to use.\n\n The following options are available:\n - \"cilium\" (default)\n - \"flannel\" (built-in in Talos)\n - \"none\" (disable CNI, must be installed manually)\n\n The \"cilium\" CNI plugin is recommended to cover advanced network policies like FQDNs.`,\n},\n\n /**\n * The CSI plugin to use.\n *\n * The following options are available:\n * - \"local-path-provisioner\" (default)\n * - \"none\" (disable CSI, must be installed manually if needed)\n *\n * @schema\n */\n csi: {\n ...Type.Default(csiSchema, \"local-path-provisioner\"),\n description: `The CSI plugin to use.\n\n The following options are available:\n - \"local-path-provisioner\" (default)\n - \"none\" (disable CSI, must be installed manually if needed)`,\n},\n\n /**\n * The shared configuration patch.\n * It will be applied to all nodes.\n *\n * @schema\n */\n sharedConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The shared configuration patch.\n It will be applied to all nodes.`,\n},\n\n /**\n * The master configuration patch.\n * It will be applied to all master nodes.\n *\n * @schema\n */\n masterConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The master configuration patch.\n It will be applied to all master nodes.`,\n},\n\n /**\n * The worker configuration patch.\n * It will be applied to all worker nodes.\n *\n * @schema\n */\n workerConfigPatch: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The worker configuration patch.\n It will be applied to all worker nodes.`,\n},\n\n /**\n * Whether to enable the Tun device plugin.\n *\n * There is the only option for Talos to get tun device in containers.\n *\n * By default, this option is set to true.\n */\n enableTunDevicePlugin: Type.Default(Type.Boolean(), true),\n },\n\n inputs: clusterInputs,\n\n outputs: {\n ...clusterOutputs,\n talosCluster: clusterEntity,\n },\n\n meta: {\n displayName: \"Talos Cluster\",\n description: \"A Kubernetes cluster managed by Talos.\",\n category: \"Talos\",\n color: \"#2d2d2d\",\n primaryIcon: \"simple-icons:talos\",\n secondaryIcon: \"devicon:kubernetes\",\n },\n\n source: {\n package: \"@highstate/talos\",\n path: \"cluster\",\n },\n})\n","import { defineEntity, defineUnit, Type, type Static, type TObject } from \"@highstate/contract\"\nimport { omit } from \"remeda\"\nimport { clusterEntity, interfaceEntity, exposableWorkloadEntity } from \"./k8s\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\nimport { arrayPatchModeSchema } from \"./utils\"\n\nexport const backendSchema = Type.StringEnum([\"wireguard\", \"amneziawg\"])\n\nexport type Backend = Static<typeof backendSchema>\n\nexport const networkEntity = defineEntity({\n type: \"wireguard.network\",\n\n schema: Type.Object({\n backend: backendSchema,\n ipv6: Type.Boolean(),\n }),\n})\n\nexport const nodeExposePolicySchema = Type.StringEnum([\"always\", \"when-has-endpoint\", \"never\"])\n\nexport const peerEntity = defineEntity({\n type: \"wireguard.peer\",\n\n schema: Type.Object({\n name: Type.String(),\n network: Type.Optional(networkEntity.schema),\n publicKey: Type.String(),\n address: Type.Optional(Type.String()),\n allowedIps: Type.Array(Type.String()),\n endpoints: Type.Array(l4EndpointEntity.schema),\n allowedEndpoints: Type.Array(Type.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),\n\n /**\n * The pre-shared key of the WireGuard peer.\n *\n * If one of two peers has `presharedKey` set, the other peer must have `presharedKey` set too and they must be equal.\n *\n * Will be ignored if both peers have `presharedKeyPart` set.\n */\n presharedKey: Type.Optional(Type.String()),\n\n /**\n * The pre-shared key part of the WireGuard peer.\n *\n * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as XOR of the two parts.\n */\n presharedKeyPart: Type.Optional(Type.String()),\n\n excludedIps: Type.Array(Type.String()),\n dns: Type.Array(Type.String()),\n listenPort: Type.Optional(Type.Number()),\n }),\n\n meta: {\n color: \"#673AB7\",\n },\n})\n\nexport const identityEntity = defineEntity({\n type: \"wireguard.identity\",\n\n schema: Type.Object({\n peer: peerEntity.schema,\n privateKey: Type.String(),\n }),\n\n meta: {\n color: \"#F44336\",\n },\n})\n\nexport type Network = Static<typeof networkEntity.schema>\nexport type Identity = Static<typeof identityEntity.schema>\nexport type Peer = Static<typeof peerEntity.schema>\nexport type NodeExposePolicy = Static<typeof nodeExposePolicySchema>\n\n/**\n * The network hols the shared configuration for the WireGuard identities, peers and nodes.\n */\nexport const network = defineUnit({\n type: \"wireguard.network\",\n\n args: {\n /**\n * The backend to use for the WireGuard network.\n *\n * Possible values are:\n * 1. `wireguard` - The default backend.\n * 2. `amneziawg` - The censorship-resistant fork of WireGuard.\n *\n * By default, the `wireguard` backend is used.\n *\n * @schema\n */\n backend: {\n ...Type.Default(backendSchema, \"wireguard\"),\n description: `The backend to use for the WireGuard network.\n\n Possible values are:\n 1. \\`wireguard\\` - The default backend.\n 2. \\`amneziawg\\` - The censorship-resistant fork of WireGuard.\n\n By default, the \\`wireguard\\` backend is used.`,\n},\n\n /**\n * The option to enable IPv6 support in the network.\n *\n * By default, IPv6 support is disabled.\n *\n * @schema\n */\n ipv6: {\n ...Type.Default(Type.Boolean(), false),\n description: `The option to enable IPv6 support in the network.\n\n By default, IPv6 support is disabled.`,\n},\n },\n\n outputs: {\n network: networkEntity,\n },\n\n meta: {\n description: \"The WireGuard network with some shared configuration.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:local-area-network-connect\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"network\",\n },\n})\n\nconst sharedPeerArgs = {\n /**\n * The name of the WireGuard peer.\n *\n * If not provided, the peer will be named after the unit.\n *\n * @schema\n */\n peerName: {\n ...Type.Optional(Type.String()),\n description: `The name of the WireGuard peer.\n\n If not provided, the peer will be named after the unit.`,\n},\n\n /**\n * The address of the WireGuard interface.\n *\n * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.\n *\n * @schema\n */\n address: {\n ...Type.Optional(Type.String()),\n description: `The address of the WireGuard interface.\n\n The address may be any IPv4 or IPv6 address. CIDR notation is also supported.`,\n},\n\n /**\n * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.\n *\n * Will be merged with the `allowedIps` if provided.\n *\n * @schema\n */\n exitNode: {\n ...Type.Default(Type.Boolean(), false),\n description: `The convenience option to set \\`allowedIps\\` to \\`0.0.0.0/0, ::/0\\`.\n\n Will be merged with the \\`allowedIps\\` if provided.`,\n},\n\n /**\n * The list of IP ranges to exclude from the tunnel.\n *\n * Implementation notes:\n *\n * - This list will not be used to generate the allowed IPs for the peer.\n * - Instead, the node will setup extra direct routes to these IPs via default gateway.\n * - This allows to use `0.0.0.0/0, ::/0` in the `allowedIps` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.\n *\n * @schema\n */\n excludedIps: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The list of IP ranges to exclude from the tunnel.\n\n Implementation notes:\n\n - This list will not be used to generate the allowed IPs for the peer.\n - Instead, the node will setup extra direct routes to these IPs via default gateway.\n - This allows to use \\`0.0.0.0/0, ::/0\\` in the \\`allowedIps\\` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.`,\n},\n\n /**\n * The convenience option to exclude private IPs from the tunnel.\n *\n * For IPv4, the private IPs are:\n *\n * - `10.0.0.0/8`\n * - `172.16.0.0/12`\n * - `192.168.0.0/16`\n *\n * For IPv6, the private IPs are:\n *\n * - `fc00::/7`\n * - `fe80::/10`\n *\n * Will be merged with `excludedIps` if provided.\n *\n * @schema\n */\n excludePrivateIps: {\n ...Type.Default(Type.Boolean(), false),\n description: `The convenience option to exclude private IPs from the tunnel.\n\n For IPv4, the private IPs are:\n\n - \\`10.0.0.0/8\\`\n - \\`172.16.0.0/12\\`\n - \\`192.168.0.0/16\\`\n\n For IPv6, the private IPs are:\n\n - \\`fc00::/7\\`\n - \\`fe80::/10\\`\n\n Will be merged with \\`excludedIps\\` if provided.`,\n},\n\n /**\n * The endpoints of the WireGuard peer.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the WireGuard peer.`,\n},\n\n /**\n * The allowed endpoints of the WireGuard peer.\n *\n * The non `hostname` endpoints will be added to the `allowedIps` of the peer.\n *\n * @schema\n */\n allowedEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The allowed endpoints of the WireGuard peer.\n\n The non \\`hostname\\` endpoints will be added to the \\`allowedIps\\` of the peer.`,\n},\n\n /**\n * The DNS servers that should be used by the interface connected to the WireGuard peer.\n *\n * If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).\n *\n * @schema\n */\n dns: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The DNS servers that should be used by the interface connected to the WireGuard peer.\n\n If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).`,\n},\n\n /**\n * The convenience option to include the DNS servers to the allowed IPs.\n *\n * By default, is `true`.\n *\n * @schema\n */\n includeDns: {\n ...Type.Default(Type.Boolean(), true),\n description: `The convenience option to include the DNS servers to the allowed IPs.\n\n By default, is \\`true\\`.`,\n},\n\n /**\n * The port to listen on.\n *\n * @schema\n */\n listenPort: {\n ...Type.Optional(Type.Number()),\n description: `The port to listen on.`,\n},\n}\n\nconst sharedPeerInputs = {\n /**\n * The network to use for the WireGuard identity.\n *\n * If not provided, the identity will use default network configuration.\n *\n * @schema\n */\n network: {\n ...{\n entity: networkEntity,\n required: false,\n },\n description: `The network to use for the WireGuard identity.\n\n If not provided, the identity will use default network configuration.`,\n},\n\n /**\n * The L3 endpoints of the identity.\n *\n * Will produce L4 endpoints for each of the provided L3 endpoints.\n *\n * @schema\n */\n l3Endpoints: {\n ...{\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L3 endpoints of the identity.\n\n Will produce L4 endpoints for each of the provided L3 endpoints.`,\n},\n\n /**\n * The L4 endpoints of the identity.\n *\n * Will take priority over all calculated endpoints if provided.\n *\n * @schema\n */\n l4Endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the identity.\n\n Will take priority over all calculated endpoints if provided.`,\n},\n\n /**\n * The L3 endpoints to add to the allowed IPs of the identity.\n *\n * `hostname` endpoints will be ignored.\n *\n * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n * the corresponding network policy will be created.\n *\n * @schema\n */\n allowedL3Endpoints: {\n ...{\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L3 endpoints to add to the allowed IPs of the identity.\n\n \\`hostname\\` endpoints will be ignored.\n\n If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n the corresponding network policy will be created.`,\n},\n\n /**\n * The L4 endpoints to add to the allowed IPs of the identity.\n *\n * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n * the corresponding network policy will be created.\n *\n * @schema\n */\n allowedL4Endpoints: {\n ...{\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n description: `The L4 endpoints to add to the allowed IPs of the identity.\n\n If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,\n the corresponding network policy will be created.`,\n},\n} as const\n\nconst sharedPeerOutputs = {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n} as const\n\nexport type SharedPeerArgs = Static<TObject<typeof sharedPeerArgs>>\n\nexport const peer = defineUnit({\n type: \"wireguard.peer\",\n\n args: {\n ...sharedPeerArgs,\n\n /**\n * The public key of the WireGuard peer.\n *\n * @schema\n */\n publicKey: {\n ...Type.String(),\n description: `The public key of the WireGuard peer.`,\n},\n },\n\n secrets: {\n /**\n * The pre-shared key which should be used for the peer.\n *\n * @schema\n */\n presharedKey: {\n ...Type.Optional(Type.String()),\n description: `The pre-shared key which should be used for the peer.`,\n},\n },\n\n inputs: sharedPeerInputs,\n outputs: sharedPeerOutputs,\n\n meta: {\n description: \"The WireGuard peer with the public key.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:badge-account-horizontal\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"peer\",\n },\n})\n\nexport const peerPatch = defineUnit({\n type: \"wireguard.peer-patch\",\n\n args: {\n /**\n * The endpoints of the WireGuard peer.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoints of the WireGuard peer.`,\n},\n\n /**\n * The mode to use for patching the endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n endpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n /**\n * The allowed endpoints of the WireGuard peer.\n *\n * The non `hostname` endpoints will be added to the `allowedIps` of the peer.\n *\n * @schema\n */\n allowedEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The allowed endpoints of the WireGuard peer.\n\n The non \\`hostname\\` endpoints will be added to the \\`allowedIps\\` of the peer.`,\n},\n\n /**\n * The mode to use for patching the allowed endpoints.\n *\n * - `prepend`: prepend the new endpoints to the existing ones (default);\n * - `replace`: replace the existing endpoints with the new ones.\n */\n allowedEndpointsPatchMode: Type.Default(arrayPatchModeSchema, \"prepend\"),\n\n ...omit(sharedPeerArgs, [\"endpoints\", \"allowedEndpoints\"]),\n },\n\n inputs: {\n peer: peerEntity,\n ...sharedPeerInputs,\n },\n\n outputs: {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"WireGuard Peer Patch\",\n description: \"Patches some properties of the WireGuard peer.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:badge-account-horizontal\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"peer-patch\",\n },\n})\n\nexport const identity = defineUnit({\n type: \"wireguard.identity\",\n\n args: {\n ...sharedPeerArgs,\n\n /**\n * The port to listen on.\n *\n * Used by the implementation of the identity and to calculate the endpoint of the peer.\n *\n * @schema\n */\n listenPort: {\n ...Type.Optional(Type.Number()),\n description: `The port to listen on.\n\n Used by the implementation of the identity and to calculate the endpoint of the peer.`,\n},\n\n /**\n * The endpoint of the WireGuard peer.\n *\n * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.\n *\n * Will take priority over all calculated endpoints and `l4Endpoint` input.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoint of the WireGuard peer.\n\n If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.\n\n Will take priority over all calculated endpoints and \\`l4Endpoint\\` input.`,\n},\n },\n\n secrets: {\n /**\n * The private key of the WireGuard identity.\n *\n * If not provided, the key will be generated automatically.\n *\n * @schema\n */\n privateKey: {\n ...Type.Optional(Type.String()),\n description: `The private key of the WireGuard identity.\n\n If not provided, the key will be generated automatically.`,\n},\n\n /**\n * The part of the pre-shared of the WireGuard identity.\n *\n * Will be generated automatically if not provided.\n *\n * @schema\n */\n presharedKeyPart: {\n ...Type.Optional(Type.String()),\n description: `The part of the pre-shared of the WireGuard identity.\n\n Will be generated automatically if not provided.`,\n},\n },\n\n inputs: sharedPeerInputs,\n\n outputs: {\n identity: identityEntity,\n ...sharedPeerOutputs,\n },\n\n meta: {\n description: \"The WireGuard identity with the public key.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:account\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"identity\",\n },\n})\n\nexport const node = defineUnit({\n type: \"wireguard.node\",\n\n args: {\n /**\n * The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.\n *\n * By default, the name is `wg-${identity.name}`.\n *\n * @schema\n */\n appName: {\n ...Type.Optional(Type.String()),\n description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.\n\n By default, the name is \\`wg-\\${identity.name}\\`.`,\n},\n\n /**\n * Whether to expose the WireGuard node to the outside world.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the WireGuard node to the outside world.`,\n},\n\n /**\n * The policy to use for exposing the WireGuard node.\n *\n * - `always` - The node will be exposed and the service will be created.\n * - `when-has-endpoint` - The node will be exposed only if the provided idenity has at least one endpoint.\n * - `never` - The node will not be exposed and the service will not be created.\n *\n * * By default, the `when-has-endpoint` policy is used.\n */\n exposePolicy: Type.Default(nodeExposePolicySchema, \"when-has-endpoint\"),\n\n /**\n * The extra specification of the container which runs the WireGuard node.\n *\n * Will override any overlapping fields.\n *\n * @schema\n */\n containerSpec: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The extra specification of the container which runs the WireGuard node.\n\n Will override any overlapping fields.`,\n},\n },\n\n inputs: {\n identity: identityEntity,\n k8sCluster: clusterEntity,\n\n workload: {\n entity: exposableWorkloadEntity,\n required: false,\n },\n\n interface: {\n entity: interfaceEntity,\n required: false,\n },\n\n peers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n interface: {\n entity: interfaceEntity,\n required: false,\n },\n\n peer: {\n entity: peerEntity,\n required: false,\n },\n\n endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n meta: {\n description: \"The WireGuard node running on the Kubernetes.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:server\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"node\",\n },\n})\n\nexport const config = defineUnit({\n type: \"wireguard.config\",\n\n args: {\n /**\n * The name of the \"default\" interface where non-tunneled traffic should go.\n *\n * If not provided, the config will not respect `excludedIps`.\n *\n * @schema\n */\n defaultInterface: {\n ...Type.Optional(Type.String()),\n description: `The name of the \"default\" interface where non-tunneled traffic should go.\n\n If not provided, the config will not respect \\`excludedIps\\`.`,\n},\n },\n\n inputs: {\n identity: identityEntity,\n peers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n meta: {\n displayName: \"WireGuard Config\",\n description: \"Just the WireGuard configuration for the identity and peers.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:settings\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"config\",\n },\n})\n\nexport const configBundle = defineUnit({\n type: \"wireguard.config-bundle\",\n\n inputs: {\n identity: identityEntity,\n peers: {\n entity: peerEntity,\n multiple: true,\n },\n sharedPeers: {\n entity: peerEntity,\n multiple: true,\n required: false,\n },\n },\n\n meta: {\n displayName: \"WireGuard Config Bundle\",\n description: \"The WireGuard configuration bundle for the identity and peers.\",\n primaryIcon: \"simple-icons:wireguard\",\n primaryIconColor: \"#88171a\",\n secondaryIcon: \"mdi:folder-settings-variant\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/wireguard\",\n path: \"config-bundle\",\n },\n})\n","export * from \"./mariadb\"\nexport * from \"./postgresql\"\nexport * from \"./vaultwarden\"\nexport * from \"./mongodb\"\nexport * from \"./network\"\nexport * from \"./dns\"\n// export * from \"./zitadel\"\n// export * from \"./gitea\"\nexport * from \"./traefik\"\nexport * from \"./kubernetes-dashboard\"\nexport * from \"./grocy\"\nexport * from \"./maybe\"\nexport * from \"./deployment\"\nexport * from \"./syncthing\"\nexport * from \"./code-server\"\n\nexport { createArgs, createInputs } from \"./shared\"\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const mariadbEntity = defineEntity({\n type: \"apps.mariadb\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#f06292\",\n },\n})\n\nexport const mariadb = defineUnit({\n type: \"apps.mariadb\",\n\n args: createArgs(\"mariadb\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\"]),\n\n outputs: {\n mariadb: mariadbEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"MariaDB\",\n description: \"The MariaDB database deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mariadb\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"mariadb/app\"),\n})\n\nextraInputDefinitions.mariadb = {\n entity: mariadbEntity,\n displayName: \"MariaDB\",\n}\n\nexport const mariadbDatabase = defineUnit({\n type: \"apps.mariadb.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"mariadb\"]),\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n meta: {\n displayName: \"MariaDB Database\",\n description:\n \"The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mariadb\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"mariadb/database\"),\n})\n\nexport type MariaDB = Static<typeof mariadbEntity.schema>\n","import type { TString } from \"@sinclair/typebox\"\nimport type { mariadbEntity } from \"./mariadb\"\nimport type { postgresqlEntity } from \"./postgresql\"\nimport type { mongodbEntity } from \"./mongodb\"\nimport { Type } from \"@highstate/contract\"\nimport {\n accessPointEntity,\n clusterEntity,\n persistentVolumeClaimEntity,\n serviceEntity,\n} from \"../k8s\"\nimport { repoEntity } from \"../restic\"\nimport { providerEntity } from \"../dns\"\nimport { l4EndpointEntity } from \"../network\"\n\nconst extraArgsDefinitions = {\n fqdn: {\n schema: Type.String(),\n },\n endpoints: {\n schema: Type.Array(Type.String()),\n required: false,\n },\n external: {\n schema: Type.Boolean(),\n required: false,\n },\n} as const\n\nconst extraSecretsDefinitions = {\n rootPassword: {\n schema: Type.String(),\n required: false,\n },\n backupPassword: {\n schema: Type.String(),\n required: false,\n },\n}\n\ntype LazyExtraInputDefinitions = {\n mariadb: {\n entity: typeof mariadbEntity\n displayName: \"MariaDB\"\n }\n postgresql: {\n entity: typeof postgresqlEntity\n displayName: \"PostgreSQL\"\n }\n mongodb: {\n entity: typeof mongodbEntity\n displayName: \"MongoDB\"\n }\n}\n\nconst eagerExtraInputDefinitions = {\n accessPoint: {\n entity: accessPointEntity,\n },\n resticRepo: {\n entity: repoEntity,\n required: false,\n },\n dnsProviders: {\n entity: providerEntity,\n required: false,\n multiple: true,\n },\n volume: {\n entity: persistentVolumeClaimEntity,\n required: false,\n },\n} as const\n\nexport const extraInputDefinitions = {\n ...eagerExtraInputDefinitions,\n} as typeof eagerExtraInputDefinitions & LazyExtraInputDefinitions\n\ntype ExtraArgsDefinitions = typeof extraArgsDefinitions\ntype ExtraSecretsDefinitions = typeof extraSecretsDefinitions\ntype ExtraArgsName = keyof ExtraArgsDefinitions\ntype ExtraSecretsName = keyof ExtraSecretsDefinitions\n\ntype CreateArgsOptions<R extends readonly ExtraArgsName[], O extends readonly ExtraArgsName[]> = {\n required?: R\n optional?: O\n}\n\ntype CreateSecretsOptions<\n R extends readonly ExtraSecretsName[],\n O extends readonly ExtraSecretsName[],\n> = {\n required?: R\n optional?: O\n}\n\nexport function createArgs<T extends readonly ExtraArgsName[] = []>(\n defaultAppName: string,\n extraArgs?: T,\n): {\n appName: TString & { default: string }\n} & {\n [K in T[number]]: ExtraArgsDefinitions[K]\n}\n\nexport function createArgs<\n R extends readonly ExtraArgsName[] = [],\n O extends readonly ExtraArgsName[] = [],\n>(\n defaultAppName: string,\n extraArgs?: CreateArgsOptions<R, O>,\n): {\n appName: TString & { default: string }\n} & {\n [K in R[number]]: ExtraArgsDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraArgsDefinitions[K] & { required: false }\n}\n\nexport function createArgs<\n R extends readonly ExtraArgsName[] = [],\n O extends readonly ExtraArgsName[] = [],\n>(defaultAppName: string, extraArgs?: readonly ExtraArgsName[] | CreateArgsOptions<R, O>) {\n const base = {\n appName: Type.Default(Type.String(), defaultAppName),\n }\n\n const dynamicArgs: Partial<Record<ExtraArgsName, object>> = {}\n\n if (Array.isArray(extraArgs)) {\n for (const name of extraArgs as readonly ExtraArgsName[]) {\n dynamicArgs[name] = extraArgsDefinitions[name]\n }\n } else {\n const { required, optional } = (extraArgs as CreateArgsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicArgs[name] = {\n ...extraArgsDefinitions[name],\n required: true,\n }\n }\n\n for (const name of optional ?? []) {\n dynamicArgs[name] = {\n ...extraArgsDefinitions[name],\n required: false,\n }\n }\n }\n\n return {\n ...base,\n ...dynamicArgs,\n }\n}\n\nexport function createSecrets<T extends readonly ExtraSecretsName[] = []>(\n extraSecrets?: T,\n): {\n [K in T[number]]: ExtraSecretsDefinitions[K]\n}\n\nexport function createSecrets<\n R extends readonly ExtraSecretsName[] = [],\n O extends readonly ExtraSecretsName[] = [],\n>(\n extraSecrets?: CreateSecretsOptions<R, O>,\n): {\n [K in R[number]]: ExtraSecretsDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraSecretsDefinitions[K] & { required: false }\n}\n\nexport function createSecrets<\n R extends readonly ExtraSecretsName[] = [],\n O extends readonly ExtraSecretsName[] = [],\n>(extraSecrets?: readonly ExtraSecretsName[] | CreateSecretsOptions<R, O>) {\n const dynamicSecrets: Partial<Record<ExtraSecretsName, object>> = {}\n\n if (Array.isArray(extraSecrets)) {\n for (const name of extraSecrets as readonly ExtraSecretsName[]) {\n dynamicSecrets[name] = extraSecretsDefinitions[name]\n }\n } else {\n const { required, optional } = (extraSecrets as CreateSecretsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicSecrets[name] = {\n ...extraSecretsDefinitions[name],\n required: true,\n }\n }\n\n for (const name of optional ?? []) {\n dynamicSecrets[name] = {\n ...extraSecretsDefinitions[name],\n required: false,\n }\n }\n }\n\n return dynamicSecrets as {\n [K in R[number]]: ExtraSecretsDefinitions[K] & { required: true }\n } & {\n [K in O[number]]: ExtraSecretsDefinitions[K] & { required: false }\n }\n}\n\ntype ExtraInputDefinitions = typeof extraInputDefinitions\ntype ExtraInputName = keyof ExtraInputDefinitions\n\ntype CreateInputsOptions<\n R extends readonly ExtraInputName[],\n O extends readonly ExtraInputName[],\n> = {\n required?: R\n optional?: O\n}\n\nexport function createInputs<T extends readonly ExtraInputName[] = []>(\n inputs?: T,\n): {\n k8sCluster: typeof clusterEntity\n} & {\n [K in T[number]]: ExtraInputDefinitions[K]\n}\n\nexport function createInputs<\n R extends readonly ExtraInputName[] = [],\n O extends readonly ExtraInputName[] = [],\n>(\n inputs?: CreateInputsOptions<R, O>,\n): {\n k8sCluster: typeof clusterEntity\n} & {\n [K in R[number]]: ExtraInputDefinitions[K] & { required: true }\n} & {\n [K in O[number]]: ExtraInputDefinitions[K] & { required: false }\n}\n\nexport function createInputs<\n R extends readonly ExtraInputName[] = [],\n O extends readonly ExtraInputName[] = [],\n>(inputs?: readonly ExtraInputName[] | CreateInputsOptions<R, O>) {\n const base = {\n k8sCluster: clusterEntity,\n }\n\n const dynamicInputs: Partial<Record<ExtraInputName, object>> = {}\n\n if (Array.isArray(inputs)) {\n for (const name of inputs as readonly ExtraInputName[]) {\n dynamicInputs[name] = extraInputDefinitions[name]\n }\n } else {\n const { required, optional } = (inputs as CreateInputsOptions<R, O>) ?? {}\n\n for (const name of required ?? []) {\n dynamicInputs[name] = {\n ...extraInputDefinitions[name],\n required: true,\n }\n }\n for (const name of optional ?? []) {\n dynamicInputs[name] = {\n ...extraInputDefinitions[name],\n required: false,\n }\n }\n }\n\n return {\n ...base,\n ...dynamicInputs,\n }\n}\n\nexport function createSource(path: string) {\n return {\n package: \"@highstate/apps\",\n path,\n }\n}\n\nexport const databaseSchema = Type.Object({\n endpoints: Type.Array(l4EndpointEntity.schema),\n service: Type.Optional(serviceEntity.schema),\n rootPassword: Type.String(),\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"./network\"\n\nexport const repoEntity = defineEntity({\n type: \"restic.repo\",\n\n schema: Type.Object({\n remoteEndpoints: Type.Array(Type.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),\n\n type: Type.Literal(\"rclone\"),\n rcloneConfig: Type.String(),\n remoteName: Type.String(),\n pathPattern: Type.String(),\n }),\n\n meta: {\n color: \"#e56901\",\n },\n})\n\nexport const repo = defineUnit({\n type: \"restic.repo\",\n\n args: {\n remoteEndpoints: Type.Default(Type.Array(Type.String()), []),\n\n /**\n * The pattern for the path where backups will be stored for the specific application.\n *\n * Available variables:\n *\n * - `$clusterName`: The name of the Kubernetes cluster where the application is deployed.\n * - `$appName`: The name of the application for which the backups are being created. Corresponds to the `appName` argument of the unit.\n * - `$unitName`: The name of the unit, which deploys the application, provided by the user.\n *\n * By default, the path pattern is `backups/$clusterName/$appName`.\n *\n * @schema\n */\n pathPattern: {\n ...Type.Default(Type.String(), \"backups/$clusterName/$appName\"),\n description: `The pattern for the path where backups will be stored for the specific application.\n\n Available variables:\n\n - \\`$clusterName\\`: The name of the Kubernetes cluster where the application is deployed.\n - \\`$appName\\`: The name of the application for which the backups are being created. Corresponds to the \\`appName\\` argument of the unit.\n - \\`$unitName\\`: The name of the unit, which deploys the application, provided by the user.\n\n By default, the path pattern is \\`backups/$clusterName/$appName\\`.`,\n},\n },\n\n secrets: {\n rcloneConfig: Type.String({ language: \"ini\" }),\n },\n\n inputs: {\n remoteL3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n remoteL4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n repo: repoEntity,\n },\n\n meta: {\n displayName: \"Restic Repo\",\n description: \"Holds the configuration for a Restic repository and its remote storage.\",\n primaryIconColor: \"#e56901\",\n primaryIcon: \"material-symbols:backup\",\n category: \"Infrastructure\",\n },\n\n source: {\n package: \"@highstate/restic\",\n path: \"repo\",\n },\n})\n\nexport type Repo = Static<typeof repoEntity.schema>\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const postgresqlEntity = defineEntity({\n type: \"apps.postgresql\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#336791\",\n },\n})\n\nexport const postgresql = defineUnit({\n type: \"apps.postgresql\",\n\n args: createArgs(\"postgresql\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\", \"dnsProviders\"]),\n\n outputs: {\n postgresql: postgresqlEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"PostgreSQL\",\n description: \"The PostgreSQL database deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:postgresql\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"postgresql/app\"),\n})\n\nextraInputDefinitions.postgresql = {\n entity: postgresqlEntity,\n displayName: \"PostgreSQL\",\n}\n\nexport const postgresqlDatabase = defineUnit({\n type: \"apps.postgresql.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"postgresql\"]),\n\n meta: {\n displayName: \"PostgreSQL Database\",\n description:\n \"The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:postgresql\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"postgresql/database\"),\n})\n\nexport type PostgreSQL = Static<typeof postgresqlEntity.schema>\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSource } from \"./shared\"\n\nexport const vaultwarden = defineUnit({\n type: \"apps.vaultwarden\",\n\n args: createArgs(\"vaultwarden\", [\"fqdn\"]),\n\n secrets: {\n mariadbPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"mariadb\"]),\n\n meta: {\n displayName: \"Vaultwarden\",\n description: \"The Vaultwarden password manager deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:vaultwarden\",\n category: \"Security\",\n },\n\n source: createSource(\"vaultwarden\"),\n})\n","import { defineEntity, defineUnit, Type, type Static } from \"@highstate/contract\"\nimport { serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport {\n createArgs,\n createInputs,\n createSecrets,\n createSource,\n databaseSchema,\n extraInputDefinitions,\n} from \"./shared\"\n\nexport const mongodbEntity = defineEntity({\n type: \"apps.mongodb\",\n\n schema: databaseSchema,\n\n meta: {\n color: \"#13aa52\",\n },\n})\n\nexport const mongodb = defineUnit({\n type: \"apps.mongodb\",\n\n args: createArgs(\"mongodb\", [\"external\"]),\n secrets: createSecrets([\"rootPassword\", \"backupPassword\"]),\n inputs: createInputs([\"resticRepo\"]),\n\n outputs: {\n mongodb: mongodbEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"MongoDB\",\n description: \"The MongoDB instance deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mongodb\",\n secondaryIcon: \"mdi:database\",\n category: \"Databases\",\n },\n\n source: createSource(\"mongodb/app\"),\n})\n\nextraInputDefinitions.mongodb = {\n entity: mongodbEntity,\n displayName: \"MongoDB\",\n}\n\nexport const mongodbDatabase = defineUnit({\n type: \"apps.mongodb.database\",\n\n args: {\n database: Type.Optional(Type.String()),\n username: Type.Optional(Type.String()),\n },\n\n secrets: {\n password: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"mongodb\"]),\n\n meta: {\n displayName: \"MongoDB Database\",\n description:\n \"The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:mongodb\",\n secondaryIcon: \"mdi:database-plus\",\n category: \"Databases\",\n },\n\n source: createSource(\"mongodb/database\"),\n})\n\nexport type MongoDB = Static<typeof mongodbEntity.schema>\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"../network\"\nimport { createSource } from \"./shared\"\n\nexport const explicitEndpointFilterSchema = Type.StringEnum([\"public\", \"external\", \"internal\"])\n\nexport const endpointFilter = defineUnit({\n type: \"apps.endpoint-filter\",\n\n args: {\n /**\n * The filter to apply to the endpoints.\n *\n * - `public`: Only public endpoints accessible from the internet.\n * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.\n * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.\n */\n filter: Type.Default(explicitEndpointFilterSchema, \"public\"),\n },\n\n inputs: {\n l3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n required: false,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n required: false,\n },\n },\n\n outputs: {\n l3Endpoints: {\n entity: l3EndpointEntity,\n multiple: true,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Endpoint Filter\",\n description: \"Explicitly filter endpoints by their accessibility.\",\n primaryIcon: \"mdi:network-outline\",\n primaryIconColor: \"#FF9800\",\n secondaryIcon: \"mdi:filter-outline\",\n category: \"Network\",\n },\n\n source: createSource(\"endpoint-filter\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { l3EndpointEntity, l4EndpointEntity } from \"../network\"\nimport { providerEntity } from \"../dns\"\nimport { createSource } from \"./shared\"\n\nconst endpointFilterSchema = Type.StringEnum([\"all\", \"public\", \"external\", \"internal\"])\n\nexport const recordSet = defineUnit({\n type: \"apps.dns-record-set\",\n\n args: {\n /**\n * The name of the DNS record.\n *\n * If not provided, will use the name of the unit.\n */\n recordName: Type.Optional(Type.String()),\n\n /**\n * The type of the DNS record.\n *\n * If not specified, will use the default type for the provider.\n */\n type: Type.Optional(Type.String()),\n\n /**\n * The values of the DNS record.\n */\n values: Type.Array(Type.String()),\n\n /**\n * The TTL of the DNS record.\n */\n ttl: Type.Optional(Type.Number()),\n\n /**\n * The priority of the DNS record.\n */\n priority: Type.Optional(Type.Number()),\n\n /**\n * Whether the DNS record is proxied.\n *\n * Available only for public IPs and some DNS providers like Cloudflare.\n */\n proxied: Type.Optional(Type.Boolean()),\n\n /**\n * The filter to apply to the endpoints.\n *\n * - `all`: All endpoints.\n * - `public`: Only public endpoints accessible from the internet (default).\n * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.\n * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.\n */\n endpointFilter: Type.Default(endpointFilterSchema, \"public\"),\n },\n\n inputs: {\n dnsProviders: {\n entity: providerEntity,\n multiple: true,\n },\n l3Endpoints: {\n entity: l3EndpointEntity,\n required: false,\n multiple: true,\n },\n l4Endpoints: {\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n /**\n * The single L3 endpoint representing created DNS records.\n */\n l3Endpoint: l3EndpointEntity,\n\n /**\n * Multiple L4 endpoints representing created DNS records for each unique port/protocol combination from the input L4 endpoints.\n */\n l4Endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"DNS Record Set\",\n description: \"A set of DNS records to be created.\",\n primaryIcon: \"mdi:server\",\n defaultNamePrefix: \"record\",\n category: \"Network\",\n },\n\n source: createSource(\"dns-record-set\"),\n})\n\nexport const sharedArgs = {\n /**\n * The FQDN to register the cluster nodes with.\n *\n * @schema\n */\n fqdn: {\n ...Type.Optional(Type.String()),\n description: `The FQDN to register the cluster nodes with.`,\n},\n}\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { gatewayEntity, serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport { createArgs, createInputs } from \"./shared\"\n\nexport const traefikGateway = defineUnit({\n type: \"apps.traefik-gateway\",\n\n args: {\n ...createArgs(\"traefik\", [\"external\"]),\n className: Type.Optional(Type.String()),\n },\n\n inputs: createInputs(),\n\n outputs: {\n gateway: gatewayEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Traefik Gateway\",\n description: \"A Traefik gateway for routing traffic to services.\",\n primaryIcon: \"simple-icons:traefikproxy\",\n category: \"Network\",\n },\n\n source: {\n package: \"@highstate/apps\",\n path: \"traefik\",\n },\n})\n","import { defineUnit } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSource } from \"./shared\"\n\nexport const kubernetesDashboard = defineUnit({\n type: \"apps.kubernetes-dashboard\",\n\n args: createArgs(\"kubernetes-dashboard\", [\"fqdn\"]),\n inputs: createInputs([\"accessPoint\"]),\n\n meta: {\n displayName: \"Kubernetes Dashboard\",\n description: \"The Kubernetes Dashboard deployed on Kubernetes.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"material-symbols:dashboard\",\n category: \"Kubernetes\",\n },\n\n source: createSource(\"kubernetes-dashboard\"),\n})\n","import { defineUnit } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const grocy = defineUnit({\n type: \"apps.grocy\",\n\n args: createArgs(\"grocy\", [\"fqdn\"]),\n secrets: createSecrets([\"backupPassword\"]),\n inputs: createInputs([\"accessPoint\", \"resticRepo\"]),\n\n meta: {\n displayName: \"Grocy\",\n description:\n \"Grocy is a web-based self-hosted groceries & household management solution for your home.\",\n primaryIcon: \"simple-icons:grocy\",\n category: \"Productivity\",\n },\n\n source: createSource(\"grocy\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const maybe = defineUnit({\n type: \"apps.maybe\",\n\n args: createArgs(\"maybe\", [\"fqdn\"]),\n\n secrets: {\n ...createSecrets([\"backupPassword\"]),\n postgresqlPassword: Type.Optional(Type.String()),\n secretKey: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"postgresql\"]),\n\n meta: {\n displayName: \"Maybe\",\n description: \"The OS for your personal finances.\",\n primaryIcon: \"arcticons:finance-manager\",\n category: \"Finance\",\n },\n\n source: createSource(\"maybe\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { deploymentEntity, serviceEntity, serviceTypeSchema } from \"../k8s\"\nimport { createInputs, createSource } from \"./shared\"\n\nexport const deployment = defineUnit({\n type: \"apps.deployment\",\n\n args: {\n appName: Type.Optional(Type.String()),\n\n fqdn: Type.Optional(Type.String()),\n serviceType: Type.Optional(serviceTypeSchema),\n\n image: Type.Optional(Type.String()),\n port: Type.Optional(Type.Number()),\n replicas: Type.Optional(Type.Number()),\n\n dataPath: Type.Optional(Type.String()),\n\n env: Type.Optional(Type.Record(Type.String(), Type.Any())),\n\n mariadbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n postgresqlEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n mongodbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),\n\n manifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n serviceManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n httpRouteManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),\n },\n\n secrets: {\n mariadbPassword: Type.Optional(Type.String()),\n postgresqlPassword: Type.Optional(Type.String()),\n mongodbPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\n \"accessPoint\",\n \"mariadb\",\n \"postgresql\",\n \"mongodb\",\n \"resticRepo\",\n \"dnsProviders\",\n ]),\n\n outputs: {\n deployment: deploymentEntity,\n service: serviceEntity,\n },\n\n meta: {\n displayName: \"Kubernetes Deployment\",\n description: \"A generic Kubernetes deployment with optional service and gateway routes.\",\n primaryIcon: \"devicon:kubernetes\",\n secondaryIcon: \"mdi:cube-outline\",\n category: \"Kubernetes\",\n },\n\n source: createSource(\"deployment\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { persistentVolumeClaimEntity, serviceEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\nimport { createArgs, createInputs, createSecrets, createSource } from \"./shared\"\n\nexport const backupModeSchema = Type.StringEnum([\"state\", \"full\"])\n\nexport const syncthing = defineUnit({\n type: \"apps.syncthing\",\n\n args: {\n ...createArgs(\"syncthing\", [\"fqdn\", \"external\"]),\n\n /**\n * The FQDN of the Syncthing instance used to sync with other devices.\n *\n * The `fqdn` argument unlike this one points to the gateway and used to\n * access the Syncthing Web UI.\n */\n deviceFqdn: Type.Optional(Type.String()),\n\n /**\n * The backup mode to use for the Syncthing instance.\n *\n * - `state`: Only the state is backed up. When the instance is restored, it will\n * sync files from the other devices automatically.\n * - `full`: A full backup is created including all files.\n *\n * The default is `state`.\n */\n backupMode: Type.Default(backupModeSchema, \"state\"),\n },\n\n secrets: createSecrets([\"backupPassword\"]),\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"volume\"]),\n\n outputs: {\n volume: persistentVolumeClaimEntity,\n service: serviceEntity,\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Syncthing\",\n description: \"The Syncthing instance deployed on Kubernetes.\",\n primaryIcon: \"simple-icons:syncthing\",\n category: \"File Sync\",\n },\n\n source: createSource(\"syncthing\"),\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { persistentVolumeClaimEntity, statefulSetEntity } from \"../k8s\"\nimport { createArgs, createInputs, createSecrets } from \"./shared\"\n\nexport const codeServer = defineUnit({\n type: \"apps.code-server\",\n\n args: createArgs(\"code-server\", [\"fqdn\"]),\n\n secrets: {\n ...createSecrets([\"backupPassword\"]),\n password: Type.Optional(Type.String()),\n sudoPassword: Type.Optional(Type.String()),\n },\n\n inputs: createInputs([\"accessPoint\", \"resticRepo\", \"dnsProviders\", \"volume\"]),\n\n outputs: {\n statefulSet: statefulSetEntity,\n volume: persistentVolumeClaimEntity,\n },\n\n meta: {\n displayName: \"Code Server\",\n description: \"The Code Server instance deployed on Kubernetes.\",\n primaryIcon: \"material-icon-theme:vscode\",\n category: \"Development\",\n },\n\n source: {\n package: \"@highstate/apps\",\n path: \"code-server\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { providerEntity } from \"./dns\"\n\nexport const connection = defineUnit({\n type: \"cloudflare.connection\",\n\n secrets: {\n apiToken: Type.String(),\n },\n\n outputs: {\n dnsProvider: providerEntity,\n },\n\n meta: {\n displayName: \"Cloudflare Connection\",\n description: \"Creates a new Cloudflare connection for one zone.\",\n primaryIcon: \"simple-icons:cloudflare\",\n category: \"Cloudflare\",\n },\n\n source: {\n package: \"@highstate/cloudflare\",\n path: \"connection\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { clusterInputs, clusterOutputs } from \"./k8s\"\n\nexport const cluster = defineUnit({\n type: \"k3s.cluster\",\n\n args: {\n /**\n * The K3S configuration to pass to each server or agent in the cluster.\n *\n * See: https://docs.k3s.io/installation/configuration\n *\n * @schema\n */\n config: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The K3S configuration to pass to each server or agent in the cluster.\n\n See: https://docs.k3s.io/installation/configuration`,\n},\n\n /**\n * The configuration of the registries to use for the K3S cluster.\n *\n * See: https://docs.k3s.io/installation/private-registry\n *\n * @schema\n */\n registries: {\n ...Type.Optional(Type.Record(Type.String(), Type.Any())),\n description: `The configuration of the registries to use for the K3S cluster.\n\n See: https://docs.k3s.io/installation/private-registry`,\n},\n },\n\n inputs: clusterInputs,\n outputs: clusterOutputs,\n\n meta: {\n displayName: \"K3s Cluster\",\n description: \"The K3s cluster created on top of the server.\",\n category: \"k3s\",\n primaryIcon: \"devicon:k3s\",\n secondaryIcon: \"devicon:kubernetes\",\n },\n\n source: {\n package: \"@highstate/k3s\",\n path: \"cluster\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { networkEntity, peerEntity } from \"./wireguard\"\nimport { l4EndpointEntity } from \"./network\"\n\nexport const peer = defineUnit({\n type: \"mullvad.peer\",\n\n args: {\n hostname: Type.Optional(Type.String()),\n\n /**\n * Whether to include Mullvad DNS servers in the peer configuration.\n *\n * @schema\n */\n includeDns: {\n ...Type.Default(Type.Boolean(), true),\n description: `Whether to include Mullvad DNS servers in the peer configuration.`,\n},\n },\n\n inputs: {\n /**\n * The network to use for the WireGuard peer.\n *\n * If not provided, the peer will use default network configuration.\n *\n * @schema\n */\n network: {\n ...{\n entity: networkEntity,\n required: false,\n },\n description: `The network to use for the WireGuard peer.\n\n If not provided, the peer will use default network configuration.`,\n},\n },\n\n outputs: {\n peer: peerEntity,\n\n endpoints: {\n entity: l4EndpointEntity,\n multiple: true,\n },\n },\n\n meta: {\n displayName: \"Mullvad Peer\",\n description: \"The Mullvad WireGuard peer fetched from the Mullvad API.\",\n primaryIcon: \"simple-icons:mullvad\",\n secondaryIcon: \"cib:wireguard\",\n secondaryIconColor: \"#88171a\",\n category: \"VPN\",\n },\n\n source: {\n package: \"@highstate/mullvad\",\n path: \"peer\",\n },\n})\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { serverEntity } from \"./common\"\nimport { keyPairEntity } from \"./ssh\"\n\nexport const connectionEntity = defineEntity({\n type: \"timeweb.connection\",\n\n schema: Type.Object({\n name: Type.String(),\n apiToken: Type.String(),\n }),\n})\n\nexport const connection = defineUnit({\n type: \"timeweb.connection\",\n\n secrets: {\n apiToken: Type.String(),\n },\n\n outputs: {\n connection: connectionEntity,\n },\n\n meta: {\n displayName: \"Timeweb Connection\",\n description: \"Creates a new Timeweb connection.\",\n primaryIcon: \"material-symbols:cloud\",\n category: \"Timeweb\",\n },\n\n source: {\n package: \"@highstate/timeweb\",\n path: \"connection\",\n },\n})\n\nexport const virtualMachine = defineUnit({\n type: \"timeweb.virtual-machine\",\n\n args: {\n presetId: Type.Optional(Type.Number()),\n osId: Type.Optional(Type.Number()),\n availabilityZone: Type.String(),\n },\n\n inputs: {\n connection: connectionEntity,\n sshKeyPair: {\n entity: keyPairEntity,\n required: false,\n },\n },\n\n secrets: {\n sshPrivateKey: Type.Optional(Type.String()),\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"Timeweb Virtual Machine\",\n description: \"Creates a new Timeweb virtual machine.\",\n primaryIcon: \"material-symbols:cloud\",\n secondaryIcon: \"codicon:vm\",\n category: \"Timeweb\",\n },\n\n source: {\n package: \"@highstate/timeweb\",\n path: \"virtual-machine\",\n },\n})\n","import { defineEntity, defineUnit, Type } from \"@highstate/contract\"\nimport { fileEntity, serverEntity } from \"./common\"\n\nexport const inlineModuleEntity = defineEntity({\n type: \"nixos.inline-module\",\n\n schema: Type.Object({\n code: Type.String(),\n }),\n\n meta: {\n displayName: \"NixOS Inline Module\",\n description: \"The NixOS module reference.\",\n color: \"#5277c3\",\n },\n})\n\nexport const inlineModule = defineUnit({\n type: \"nixos.inline-module\",\n\n args: {\n code: Type.String({ language: \"nix\" }),\n },\n\n inputs: {\n files: {\n entity: fileEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n module: inlineModuleEntity,\n },\n\n meta: {\n displayName: \"NixOS Inline Module\",\n description: \"Creates a NixOS module from inline code.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"mdi:file-code\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"inline-module\",\n },\n})\n\nexport const flakeEntity = defineEntity({\n type: \"nixos.flake\",\n\n schema: Type.Object({\n url: Type.String(),\n }),\n\n meta: {\n displayName: \"NixOS Flake\",\n description: \"The NixOS flake reference.\",\n color: \"#5277c3\",\n },\n})\n\nexport const remoteFlake = defineUnit({\n type: \"nixos.remote-flake\",\n\n args: {\n url: Type.String(),\n },\n\n outputs: {\n flake: flakeEntity,\n },\n\n meta: {\n displayName: \"NixOS Remote Flake\",\n description: \"References a remote NixOS flake.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"simple-icons:git\",\n secondaryIconColor: \"#f1502f\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"flake\",\n },\n})\n\nexport const inlineFlake = defineUnit({\n type: \"nixos.inline-flake\",\n\n args: {\n code: Type.String({ language: \"nix\" }),\n },\n\n inputs: {\n flakes: {\n entity: flakeEntity,\n required: false,\n multiple: true,\n },\n modules: {\n entity: inlineModuleEntity,\n required: false,\n multiple: true,\n },\n files: {\n entity: fileEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n flake: flakeEntity,\n },\n\n meta: {\n displayName: \"NixOS Inline Flake\",\n description: \"Creates a NixOS flake from inline code.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"mdi:file-code\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"inline-flake\",\n },\n})\n\nexport const system = defineUnit({\n type: \"nixos.system\",\n\n args: {\n system: Type.Optional(Type.String()),\n },\n\n inputs: {\n flake: flakeEntity,\n server: serverEntity,\n modules: {\n entity: inlineModuleEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n server: serverEntity,\n },\n\n meta: {\n displayName: \"NixOS System\",\n description: \"Creates a NixOS system on top of any server.\",\n primaryIcon: \"simple-icons:nixos\",\n primaryIconColor: \"#7ebae4\",\n secondaryIcon: \"codicon:vm\",\n category: \"NixOS\",\n },\n\n source: {\n package: \"@highstate/nixos\",\n path: \"system\",\n },\n})\n","import { defineUnit, Type } from \"@highstate/contract\"\nimport { fileEntity, serverEntity } from \"./common\"\n\nexport const secrets = defineUnit({\n type: \"sops.secrets\",\n\n args: {\n secrets: Type.Record(Type.String(), Type.Any()),\n },\n\n inputs: {\n servers: {\n entity: serverEntity,\n required: false,\n multiple: true,\n },\n },\n\n outputs: {\n file: fileEntity,\n },\n\n meta: {\n displayName: \"SOPS Secrets\",\n description: \"Encrypts secrets using SOPS for the specified servers.\",\n primaryIcon: \"mdi:file-lock\",\n category: \"Secrets\",\n },\n\n source: {\n package: \"@highstate/sops\",\n path: \"secrets\",\n },\n})\n","export * from \"./shared\"\nexport * as phantun from \"./phantun\"\n","import { Type, type Static, type TObject } from \"@highstate/contract\"\nimport { clusterEntity } from \"../k8s\"\nimport { l4EndpointEntity } from \"../network\"\n\nexport const deobfuscatorSpec = {\n args: {\n /**\n * The name of the namespace and deployment to deploy the deobfuscator on.\n *\n * By default, calculated as `deobfs-{type}-{name}`.\n */\n appName: Type.Optional(Type.String()),\n\n /**\n * The L4 endpoint to forward deobfuscated traffic to.\n *\n * Will take precedence over the `targetEndpoint` input.\n *\n * @schema\n */\n targetEndpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The L4 endpoint to forward deobfuscated traffic to.\n\n Will take precedence over the \\`targetEndpoint\\` input.`,\n},\n\n /**\n * Whether to expose the deobfuscator service by \"NodePort\" or \"LoadBalancer\".\n *\n * By default, the service is not exposed and only accessible from within the cluster.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the deobfuscator service by \"NodePort\" or \"LoadBalancer\".\n\n By default, the service is not exposed and only accessible from within the cluster.`,\n},\n },\n\n inputs: {\n /**\n * The Kubernetes cluster to deploy the deobfuscator on.\n *\n * @schema\n */\n k8sCluster: {\n ...clusterEntity,\n description: `The Kubernetes cluster to deploy the deobfuscator on.`,\n},\n\n /**\n * The L4 endpoints to forward deobfuscated traffic to.\n *\n * Will select the most appropriate endpoint based on the environment.\n *\n * @schema\n */\n targetEndpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints to forward deobfuscated traffic to.\n\n Will select the most appropriate endpoint based on the environment.`,\n},\n },\n\n outputs: {\n /**\n * The L4 endpoints of the deobfuscator accepting obfuscated traffic.\n *\n * @schema\n */\n endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the deobfuscator accepting obfuscated traffic.`,\n},\n },\n} as const\n\nexport const obfuscatorSpec = {\n args: {\n /**\n * The name of the namespace and deployment to deploy the obfuscator on.\n *\n * By default, calculated as `obfs-{type}-{name}`.\n */\n appName: Type.Optional(Type.String()),\n\n /**\n * The endpoint of the deobfuscator to pass obfuscated traffic to.\n *\n * Will take precedence over the `endpoint` input.\n *\n * @schema\n */\n endpoints: {\n ...Type.Default(Type.Array(Type.String()), []),\n description: `The endpoint of the deobfuscator to pass obfuscated traffic to.\n\n Will take precedence over the \\`endpoint\\` input.`,\n},\n\n /**\n * Whether to expose the obfuscator service by \"NodePort\" or \"LoadBalancer\".\n *\n * By default, the service is not exposed and only accessible from within the cluster.\n *\n * @schema\n */\n external: {\n ...Type.Default(Type.Boolean(), false),\n description: `Whether to expose the obfuscator service by \"NodePort\" or \"LoadBalancer\".\n\n By default, the service is not exposed and only accessible from within the cluster.`,\n},\n },\n\n inputs: {\n /**\n * The Kubernetes cluster to deploy the obfuscator on.\n *\n * @schema\n */\n k8sCluster: {\n ...clusterEntity,\n description: `The Kubernetes cluster to deploy the obfuscator on.`,\n},\n\n /**\n * The L4 endpoints of the deobfuscator to pass obfuscated traffic to.\n *\n * Will select the most appropriate endpoint based on the environment.\n *\n * @schema\n */\n endpoints: {\n ...{\n entity: l4EndpointEntity,\n required: false,\n multiple: true,\n },\n description: `The L4 endpoints of the deobfuscator to pass obfuscated traffic to.\n\n Will select the most appropriate endpoint based on the environment.`,\n},\n },\n\n outputs: {\n /**\n * The L4 endpoints accepting unobfuscated traffic.\n *\n * @schema\n */\n entryEndpoints: {\n ...{\n entity: l4EndpointEntity,\n multiple: true,\n },\n description: `The L4 endpoints accepting unobfuscated traffic.`,\n},\n },\n} as const\n\nexport type DeobfuscatorArgs = Static<TObject<(typeof deobfuscatorSpec)[\"args\"]>>\nexport type ObfuscatorArgs = Static<TObject<(typeof obfuscatorSpec)[\"args\"]>>\n","import { defineUnit } from \"@highstate/contract\"\nimport { deobfuscatorSpec, obfuscatorSpec } from \"./shared\"\n\nexport const deobfuscator = defineUnit({\n type: \"obfuscators.phantun.deobfuscator\",\n ...deobfuscatorSpec,\n\n meta: {\n displayName: \"Phantun Deobfuscator\",\n description: \"The Phantun Deobfuscator deployed on Kubernetes.\",\n primaryIcon: \"mdi:network-outline\",\n secondaryIcon: \"mdi:hide\",\n category: \"Obfuscators\",\n },\n\n source: {\n package: \"@highstate/obfuscators\",\n path: \"phantun/deobfuscator\",\n },\n})\n\nexport const obfuscator = defineUnit({\n type: \"obfuscators.phantun.obfuscator\",\n ...obfuscatorSpec,\n\n meta: {\n displayName: \"Phantun Obfuscator\",\n description: \"The Phantun Obfuscator deployed on Kubernetes.\",\n primaryIcon: \"mdi:network-outline\",\n secondaryIcon: \"mdi:hide\",\n category: \"Obfuscators\",\n },\n\n source: {\n package: \"@highstate/obfuscators\",\n path: \"phantun/obfuscator\",\n },\n})\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,gBAAAA,eAAc,cAAAC,aAAY,QAAAC,aAAyB;;;ACA5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,gBAAAC,eAAc,cAAAC,aAAY,QAAAC,aAAyB;;;ACA5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,cAAc,YAAY,YAAyB;AAErD,IAAM,2BAA2B,KAAK,WAAW;AAAA,EACtD;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF,CAAC;AAEM,IAAM,uBAAuB,KAAK,MAAM,wBAAwB;AAEhE,IAAM,mBAAmB,aAAa;AAAA,EAC3C,MAAM;AAAA,EAEN,QAAQ,KAAK,UAAU;AAAA,IACrB,KAAK,OAAO;AAAA,MACV,YAAY;AAAA,MACZ,UAAU,KAAK,SAAS,KAAK,OAAO,KAAK,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;AAAA,IACpE,CAAC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;AAAA,IAMP,gBAAgB;AAAA,MAClB,GAAG;AAAA,QACC,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACF,aAAa;AAAA,IACf;AAAA,EACE;AACF;;;AC3KA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,cAAAC,oBAAkB;AAGpB,IAAM,eAAeC,aAAW;AAAA,EACrC,MAAM;AAAA,EACN,GAAG;AAAA,EAEH,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AAAA,EAEA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CAAC;AAEM,IAAM,aAAaA,aAAW;AAAA,EACnC,MAAM;AAAA,EACN,GAAG;AAAA,EAEH,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AAAA,EAEA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CAAC;","names":["defineEntity","defineUnit","Type","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","defineEntity","Type","Type","defineEntity","Type","defineEntity","Type","defineUnit","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","clusterEntity","defineEntity","defineUnit","Type","Type","defineEntity","clusterEntity","defineUnit","clusterEntity","cniSchema","defineEntity","defineUnit","Type","clusterEntity","defineEntity","Type","cniSchema","defineUnit","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","clusterEntity","createArgs","defineEntity","defineUnit","Type","Type","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","Type","createArgs","inputs","clusterEntity","defineEntity","defineUnit","createArgs","Type","defineEntity","defineUnit","Type","defineEntity","defineUnit","createArgs","Type","defineUnit","Type","defineUnit","createArgs","Type","defineEntity","defineUnit","Type","defineEntity","defineUnit","createArgs","Type","defineUnit","Type","Type","defineUnit","defineUnit","Type","endpointFilterSchema","Type","defineUnit","defineUnit","Type","defineUnit","createArgs","Type","defineUnit","defineUnit","createArgs","defineUnit","defineUnit","createArgs","defineUnit","Type","defineUnit","createArgs","Type","defineUnit","Type","defineUnit","Type","defineUnit","Type","Type","defineUnit","createArgs","defineUnit","Type","defineUnit","createArgs","Type","connection","defineUnit","Type","connection","defineUnit","Type","cluster","defineUnit","Type","cluster","defineUnit","Type","peer","defineUnit","Type","peer","defineUnit","Type","connection","virtualMachine","defineEntity","defineUnit","Type","defineEntity","Type","connection","defineUnit","virtualMachine","defineEntity","defineUnit","Type","defineEntity","Type","defineUnit","defineUnit","Type","defineUnit","Type","Type","Type","clusterEntity","defineUnit","defineUnit"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/library",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -19,12 +19,12 @@
19
19
  "build": "highstate build --library"
20
20
  },
21
21
  "dependencies": {
22
- "@highstate/contract": "^0.9.9",
22
+ "@highstate/contract": "^0.9.10",
23
23
  "@sinclair/typebox": "^0.34.11",
24
24
  "remeda": "^2.21.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@highstate/cli": "^0.9.9"
27
+ "@highstate/cli": "^0.9.10"
28
28
  },
29
- "gitHead": "1c04a713fa1bb7c0231e5e6d0537709097bb0e8e"
29
+ "gitHead": "aacf8837fdf40f2bb2f83d4c11b35a358e26ec33"
30
30
  }
@@ -1,5 +1,6 @@
1
1
  import { defineEntity, defineUnit, Type, type Static } from "@highstate/contract"
2
2
  import { serviceEntity } from "../k8s"
3
+ import { l4EndpointEntity } from "../network"
3
4
  import {
4
5
  createArgs,
5
6
  createInputs,
@@ -29,6 +30,10 @@ export const mariadb = defineUnit({
29
30
  outputs: {
30
31
  mariadb: mariadbEntity,
31
32
  service: serviceEntity,
33
+ endpoints: {
34
+ entity: l4EndpointEntity,
35
+ multiple: true,
36
+ },
32
37
  },
33
38
 
34
39
  meta: {
@@ -1,5 +1,6 @@
1
1
  import { defineEntity, defineUnit, Type, type Static } from "@highstate/contract"
2
2
  import { serviceEntity } from "../k8s"
3
+ import { l4EndpointEntity } from "../network"
3
4
  import {
4
5
  createArgs,
5
6
  createInputs,
@@ -29,6 +30,10 @@ export const mongodb = defineUnit({
29
30
  outputs: {
30
31
  mongodb: mongodbEntity,
31
32
  service: serviceEntity,
33
+ endpoints: {
34
+ entity: l4EndpointEntity,
35
+ multiple: true,
36
+ },
32
37
  },
33
38
 
34
39
  meta: {
@@ -1,5 +1,6 @@
1
1
  import { defineEntity, defineUnit, Type, type Static } from "@highstate/contract"
2
2
  import { serviceEntity } from "../k8s"
3
+ import { l4EndpointEntity } from "../network"
3
4
  import {
4
5
  createArgs,
5
6
  createInputs,
@@ -29,6 +30,10 @@ export const postgresql = defineUnit({
29
30
  outputs: {
30
31
  postgresql: postgresqlEntity,
31
32
  service: serviceEntity,
33
+ endpoints: {
34
+ entity: l4EndpointEntity,
35
+ multiple: true,
36
+ },
32
37
  },
33
38
 
34
39
  meta: {
@@ -1,5 +1,6 @@
1
1
  import { defineUnit, Type } from "@highstate/contract"
2
2
  import { persistentVolumeClaimEntity, serviceEntity } from "../k8s"
3
+ import { l4EndpointEntity } from "../network"
3
4
  import { createArgs, createInputs, createSecrets, createSource } from "./shared"
4
5
 
5
6
  export const backupModeSchema = Type.StringEnum(["state", "full"])
@@ -8,7 +9,7 @@ export const syncthing = defineUnit({
8
9
  type: "apps.syncthing",
9
10
 
10
11
  args: {
11
- ...createArgs("syncthing", ["fqdn"]),
12
+ ...createArgs("syncthing", ["fqdn", "external"]),
12
13
 
13
14
  /**
14
15
  * The FQDN of the Syncthing instance used to sync with other devices.
@@ -31,11 +32,15 @@ export const syncthing = defineUnit({
31
32
  },
32
33
 
33
34
  secrets: createSecrets(["backupPassword"]),
34
- inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
35
+ inputs: createInputs(["accessPoint", "resticRepo", "volume"]),
35
36
 
36
37
  outputs: {
37
- service: serviceEntity,
38
38
  volume: persistentVolumeClaimEntity,
39
+ service: serviceEntity,
40
+ endpoints: {
41
+ entity: l4EndpointEntity,
42
+ multiple: true,
43
+ },
39
44
  },
40
45
 
41
46
  meta: {
@@ -1,5 +0,0 @@
1
- {
2
- "sourceHashes": {
3
- "./dist/index.js": "9fb7ea19212615395be0f4cd2df53dc8de479f4e969b82eb646f57925be20ea0"
4
- }
5
- }