@highstate/library 0.9.18 → 0.9.20
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/highstate.library.msgpack +0 -0
- package/dist/index.js +3684 -3126
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/common/access-point.ts +105 -0
- package/src/{files.ts → common/files.ts} +10 -8
- package/src/common/index.ts +3 -0
- package/src/{common.ts → common/server.ts} +69 -38
- package/src/databases/index.ts +4 -0
- package/src/databases/mariadb.ts +37 -0
- package/src/databases/mongodb.ts +37 -0
- package/src/databases/postgresql.ts +37 -0
- package/src/databases/shared.ts +61 -0
- package/src/distributions/ubuntu.ts +6 -4
- package/src/dns.ts +110 -12
- package/src/git.ts +7 -3
- package/src/impl-ref.ts +26 -0
- package/src/index.ts +14 -15
- package/src/k3s.ts +7 -5
- package/src/k8s/apps/code-server.ts +48 -0
- package/src/k8s/apps/gitea.ts +25 -0
- package/src/k8s/apps/grocy.ts +39 -0
- package/src/k8s/apps/hubble.ts +30 -0
- package/src/{apps → k8s/apps}/index.ts +16 -13
- package/src/k8s/apps/kubernetes-dashboard.ts +28 -0
- package/src/k8s/apps/mariadb.ts +83 -0
- package/src/k8s/apps/maybe.ts +39 -0
- package/src/k8s/apps/mongodb.ts +84 -0
- package/src/k8s/apps/postgresql.ts +86 -0
- package/src/k8s/apps/shared.ts +149 -0
- package/src/{apps → k8s/apps}/syncthing.ts +27 -9
- package/src/k8s/apps/traefik.ts +40 -0
- package/src/k8s/apps/vaultwarden.ts +31 -0
- package/src/k8s/apps/workload.ts +214 -0
- package/src/k8s/apps/zitadel.ts +26 -0
- package/src/k8s/cert-manager.ts +80 -0
- package/src/k8s/cilium.ts +64 -0
- package/src/k8s/gateway.ts +70 -0
- package/src/k8s/index.ts +9 -0
- package/src/{obfuscators → k8s/obfuscators}/phantun.ts +10 -6
- package/src/{obfuscators → k8s/obfuscators}/shared.ts +11 -5
- package/src/k8s/resources.ts +111 -0
- package/src/k8s/service.ts +65 -0
- package/src/{k8s.ts → k8s/shared.ts} +35 -329
- package/src/k8s/workload.ts +77 -0
- package/src/network.ts +208 -22
- package/src/nixos.ts +23 -8
- package/src/proxmox.ts +62 -75
- package/src/restic.ts +15 -6
- package/src/sops.ts +16 -5
- package/src/ssh.ts +107 -9
- package/src/talos.ts +6 -4
- package/src/third-party/cloudflare.ts +59 -0
- package/src/third-party/index.ts +4 -0
- package/src/{mullvad.ts → third-party/mullvad.ts} +6 -4
- package/src/third-party/timeweb.ts +99 -0
- package/src/third-party/yandex.ts +211 -0
- package/src/utils.ts +24 -3
- package/src/wireguard.ts +171 -48
- package/src/apps/code-server.ts +0 -34
- package/src/apps/deployment.ts +0 -60
- package/src/apps/dns.ts +0 -107
- package/src/apps/gitea.ts +0 -18
- package/src/apps/grocy.ts +0 -20
- package/src/apps/hubble.ts +0 -20
- package/src/apps/kubernetes-dashboard.ts +0 -19
- package/src/apps/mariadb.ts +0 -81
- package/src/apps/maybe.ts +0 -25
- package/src/apps/mongodb.ts +0 -81
- package/src/apps/network.ts +0 -55
- package/src/apps/postgresql.ts +0 -81
- package/src/apps/shared.ts +0 -289
- package/src/apps/test.ts +0 -19
- package/src/apps/traefik.ts +0 -36
- package/src/apps/vaultwarden.ts +0 -23
- package/src/apps/zitadel.ts +0 -21
- package/src/cloudflare.ts +0 -26
- package/src/timeweb.ts +0 -75
- package/src/{obfuscators → k8s/obfuscators}/index.ts +1 -1
package/src/dns.ts
CHANGED
@@ -1,15 +1,28 @@
|
|
1
|
-
import { defineEntity, z } from "@highstate/contract"
|
2
|
-
import {
|
1
|
+
import { defineEntity, defineUnit, z } from "@highstate/contract"
|
2
|
+
import { implementationReferenceSchema } from "./impl-ref"
|
3
|
+
import { endpointFilterSchema, l3EndpointEntity, l4EndpointEntity } from "./network"
|
3
4
|
import { arrayPatchModeSchema, prefixKeysWith } from "./utils"
|
4
5
|
|
5
6
|
export const providerEntity = defineEntity({
|
6
|
-
type: "dns.provider",
|
7
|
+
type: "dns.provider.v1",
|
7
8
|
|
8
9
|
schema: z.object({
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
/**
|
11
|
+
* The ID of the DNS provider unique within the system.
|
12
|
+
*/
|
13
|
+
id: z.string(),
|
14
|
+
|
15
|
+
/**
|
16
|
+
* The domain apex for which the DNS records will be created.
|
17
|
+
*
|
18
|
+
* If the provider manages multiple domains, the separate provider entity should be created for each domain.
|
19
|
+
*/
|
12
20
|
domain: z.string(),
|
21
|
+
|
22
|
+
/**
|
23
|
+
* The reference to the implementation of the DNS provider.
|
24
|
+
*/
|
25
|
+
implRef: implementationReferenceSchema,
|
13
26
|
}),
|
14
27
|
|
15
28
|
meta: {
|
@@ -17,6 +30,91 @@ export const providerEntity = defineEntity({
|
|
17
30
|
},
|
18
31
|
})
|
19
32
|
|
33
|
+
export const recordSet = defineUnit({
|
34
|
+
type: "dns.record-set.v1",
|
35
|
+
|
36
|
+
args: {
|
37
|
+
...createArgs(),
|
38
|
+
|
39
|
+
/**
|
40
|
+
* The values of the DNS record.
|
41
|
+
*/
|
42
|
+
values: z.string().array().default([]),
|
43
|
+
|
44
|
+
/**
|
45
|
+
* The TTL of the DNS record.
|
46
|
+
*/
|
47
|
+
ttl: z.number().optional(),
|
48
|
+
|
49
|
+
/**
|
50
|
+
* The priority of the DNS record.
|
51
|
+
*/
|
52
|
+
priority: z.number().optional(),
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Whether the DNS record is proxied.
|
56
|
+
*
|
57
|
+
* Available only for public IPs and some DNS providers like Cloudflare.
|
58
|
+
*/
|
59
|
+
proxied: z.boolean().default(false),
|
60
|
+
},
|
61
|
+
|
62
|
+
inputs: {
|
63
|
+
/**
|
64
|
+
* The DNS providers to use to create the DNS records.
|
65
|
+
*
|
66
|
+
* For each provider, a separate DNS record will be created.
|
67
|
+
*/
|
68
|
+
dnsProviders: {
|
69
|
+
entity: providerEntity,
|
70
|
+
multiple: true,
|
71
|
+
},
|
72
|
+
|
73
|
+
/**
|
74
|
+
* The L3 endpoints to use as values of the DNS records.
|
75
|
+
*/
|
76
|
+
l3Endpoints: {
|
77
|
+
entity: l3EndpointEntity,
|
78
|
+
required: false,
|
79
|
+
multiple: true,
|
80
|
+
},
|
81
|
+
|
82
|
+
/**
|
83
|
+
* The L4 endpoints to use as values of the DNS records.
|
84
|
+
*/
|
85
|
+
l4Endpoints: {
|
86
|
+
entity: l4EndpointEntity,
|
87
|
+
required: false,
|
88
|
+
multiple: true,
|
89
|
+
},
|
90
|
+
},
|
91
|
+
|
92
|
+
outputs: {
|
93
|
+
l3Endpoints: {
|
94
|
+
entity: l3EndpointEntity,
|
95
|
+
multiple: true,
|
96
|
+
},
|
97
|
+
|
98
|
+
l4Endpoints: {
|
99
|
+
entity: l4EndpointEntity,
|
100
|
+
multiple: true,
|
101
|
+
},
|
102
|
+
},
|
103
|
+
|
104
|
+
meta: {
|
105
|
+
title: "DNS Record Set",
|
106
|
+
description: "A set of DNS records to be created.",
|
107
|
+
icon: "mdi:server",
|
108
|
+
defaultNamePrefix: "record",
|
109
|
+
category: "Network",
|
110
|
+
},
|
111
|
+
|
112
|
+
source: {
|
113
|
+
package: "@highstate/common",
|
114
|
+
path: "units/dns/record-set",
|
115
|
+
},
|
116
|
+
})
|
117
|
+
|
20
118
|
export function createArgs<TPrefix extends string = "">(prefix?: TPrefix) {
|
21
119
|
return prefixKeysWith(prefix, {
|
22
120
|
/**
|
@@ -33,17 +131,17 @@ export function createArgs<TPrefix extends string = "">(prefix?: TPrefix) {
|
|
33
131
|
*
|
34
132
|
* Possible values:
|
35
133
|
*
|
36
|
-
* - `public`:
|
37
|
-
* - `external`:
|
38
|
-
* - `internal`:
|
134
|
+
* - `public`: only endpoints exposed to the public internet;
|
135
|
+
* - `external`: reachable from outside the system but not public (e.g., LAN, VPC);
|
136
|
+
* - `internal`: reachable only from within the system boundary (e.g., inside a cluster).
|
39
137
|
*
|
40
138
|
* You can select one or more values.
|
41
139
|
*
|
42
140
|
* If no value is provided, the endpoints will be filtered by the most accessible type:
|
43
141
|
*
|
44
|
-
* -
|
45
|
-
* -
|
46
|
-
* -
|
142
|
+
* - if any public endpoints exist, all public endpoints are selected;
|
143
|
+
* - otherwise, if any external endpoints exist, all external endpoints are selected;
|
144
|
+
* - if neither exist, all internal endpoints are selected.
|
47
145
|
*/
|
48
146
|
endpointFilter: endpointFilterSchema.default([]),
|
49
147
|
|
package/src/git.ts
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
import { defineUnit, z } from "@highstate/contract"
|
2
|
+
import { folderEntity } from "./common/files"
|
2
3
|
import { l7EndpointEntity } from "./network"
|
3
|
-
import { folderEntity } from "./files"
|
4
4
|
|
5
|
+
/**
|
6
|
+
* References a remote Git repository.
|
7
|
+
*
|
8
|
+
* The repository will be cloned or fetched from the specified URL and the content will be packed into a folder.
|
9
|
+
*/
|
5
10
|
export const remoteRepository = defineUnit({
|
6
|
-
type: "git.remote-repository",
|
11
|
+
type: "git.remote-repository.v1",
|
7
12
|
|
8
13
|
args: {
|
9
14
|
/**
|
@@ -45,7 +50,6 @@ export const remoteRepository = defineUnit({
|
|
45
50
|
|
46
51
|
meta: {
|
47
52
|
title: "Git Remote Repository",
|
48
|
-
description: "References a remote Git repository.",
|
49
53
|
icon: "simple-icons:git",
|
50
54
|
iconColor: "#f1502f",
|
51
55
|
category: "Git",
|
package/src/impl-ref.ts
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
import { z } from "@highstate/contract"
|
2
|
+
|
3
|
+
/**
|
4
|
+
* The schema which represents some generic reference to an implementation of some functionality.
|
5
|
+
*
|
6
|
+
* The implementation is dynamically loaded from the provided package and can be used to create resources or perform actions.
|
7
|
+
*
|
8
|
+
* It can be used for:
|
9
|
+
*
|
10
|
+
* - creating DNS records for different providers;
|
11
|
+
* - creating access points for different gateways in different environments;
|
12
|
+
* - creating network policies for different CNIs.
|
13
|
+
*/
|
14
|
+
export const implementationReferenceSchema = z.object({
|
15
|
+
/**
|
16
|
+
* The name of the package which contains the implementation.
|
17
|
+
*/
|
18
|
+
package: z.string(),
|
19
|
+
|
20
|
+
/**
|
21
|
+
* The implementation specific data.
|
22
|
+
*/
|
23
|
+
data: z.record(z.string(), z.unknown()),
|
24
|
+
})
|
25
|
+
|
26
|
+
export type ImplementationReference = z.infer<typeof implementationReferenceSchema>
|
package/src/index.ts
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
import { noop } from "./abbreviations"
|
2
|
+
|
2
3
|
noop()
|
3
4
|
|
4
5
|
export * as common from "./common"
|
5
|
-
export * as
|
6
|
-
export * as
|
7
|
-
export * as k8s from "./k8s"
|
8
|
-
export * as talos from "./talos"
|
9
|
-
export * as wireguard from "./wireguard"
|
10
|
-
export * as apps from "./apps"
|
11
|
-
export * as cloudflare from "./cloudflare"
|
12
|
-
export * as k3s from "./k3s"
|
13
|
-
export * as restic from "./restic"
|
14
|
-
export * as mullvad from "./mullvad"
|
6
|
+
export * as databases from "./databases"
|
7
|
+
export * as distributions from "./distributions"
|
15
8
|
export * as dns from "./dns"
|
16
|
-
export * as
|
9
|
+
export * as git from "./git"
|
10
|
+
export * from "./impl-ref"
|
11
|
+
export * as k3s from "./k3s"
|
12
|
+
export * as k8s from "./k8s"
|
13
|
+
export * as network from "./network"
|
17
14
|
export * as nixos from "./nixos"
|
15
|
+
export * as proxmox from "./proxmox"
|
16
|
+
export * as restic from "./restic"
|
18
17
|
export * as sops from "./sops"
|
19
|
-
export * as
|
20
|
-
export * as
|
21
|
-
export *
|
22
|
-
export * as git from "./git"
|
18
|
+
export * as ssh from "./ssh"
|
19
|
+
export * as talos from "./talos"
|
20
|
+
export * from "./third-party"
|
23
21
|
export * from "./utils"
|
22
|
+
export * as wireguard from "./wireguard"
|
package/src/k3s.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineUnit, z } from "@highstate/contract"
|
2
|
-
import { clusterInputs, clusterOutputs } from "./k8s"
|
2
|
+
import { clusterInputs, clusterOutputs } from "./k8s/shared"
|
3
3
|
|
4
4
|
export const packagedComponents = [
|
5
5
|
"coredns",
|
@@ -22,8 +22,11 @@ export const componentSchema = z.enum([...packagedComponents, ...internalCompone
|
|
22
22
|
|
23
23
|
export const cniSchema = z.enum(["none", "flannel"])
|
24
24
|
|
25
|
+
/**
|
26
|
+
* The K3s cluster created on top of the server.
|
27
|
+
*/
|
25
28
|
export const cluster = defineUnit({
|
26
|
-
type: "k3s.cluster",
|
29
|
+
type: "k3s.cluster.v1",
|
27
30
|
|
28
31
|
args: {
|
29
32
|
/**
|
@@ -44,14 +47,14 @@ export const cluster = defineUnit({
|
|
44
47
|
*
|
45
48
|
* See: https://docs.k3s.io/installation/configuration
|
46
49
|
*/
|
47
|
-
config: z.record(z.string(), z.
|
50
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
48
51
|
|
49
52
|
/**
|
50
53
|
* The configuration of the registries to use for the K3S cluster.
|
51
54
|
*
|
52
55
|
* See: https://docs.k3s.io/installation/private-registry
|
53
56
|
*/
|
54
|
-
registries: z.record(z.string(), z.
|
57
|
+
registries: z.record(z.string(), z.unknown()).optional(),
|
55
58
|
},
|
56
59
|
|
57
60
|
inputs: clusterInputs,
|
@@ -59,7 +62,6 @@ export const cluster = defineUnit({
|
|
59
62
|
|
60
63
|
meta: {
|
61
64
|
title: "K3s Cluster",
|
62
|
-
description: "The K3s cluster created on top of the server.",
|
63
65
|
category: "k3s",
|
64
66
|
icon: "devicon:k3s",
|
65
67
|
secondaryIcon: "devicon:kubernetes",
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import { persistentVolumeClaimEntity } from "../resources"
|
4
|
+
import { statefulSetEntity } from "../workload"
|
5
|
+
import {
|
6
|
+
appName,
|
7
|
+
optionalSharedInputs,
|
8
|
+
sharedArgs,
|
9
|
+
sharedInputs,
|
10
|
+
sharedSecrets,
|
11
|
+
source,
|
12
|
+
} from "./shared"
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The Code Server instance deployed on Kubernetes.
|
16
|
+
*/
|
17
|
+
export const codeServer = defineUnit({
|
18
|
+
type: "k8s.apps.code-server.v1",
|
19
|
+
|
20
|
+
args: {
|
21
|
+
...appName("code-server"),
|
22
|
+
...pick(sharedArgs, ["fqdn"]),
|
23
|
+
},
|
24
|
+
|
25
|
+
secrets: {
|
26
|
+
...pick(sharedSecrets, ["backupPassword"]),
|
27
|
+
password: z.string().optional(),
|
28
|
+
sudoPassword: z.string().optional(),
|
29
|
+
},
|
30
|
+
|
31
|
+
inputs: {
|
32
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
33
|
+
...pick(optionalSharedInputs, ["resticRepo", "dnsProviders", "volume"]),
|
34
|
+
},
|
35
|
+
|
36
|
+
outputs: {
|
37
|
+
statefulSet: statefulSetEntity,
|
38
|
+
volume: persistentVolumeClaimEntity,
|
39
|
+
},
|
40
|
+
|
41
|
+
meta: {
|
42
|
+
title: "Code Server",
|
43
|
+
icon: "material-icon-theme:vscode",
|
44
|
+
category: "Development",
|
45
|
+
},
|
46
|
+
|
47
|
+
source: source("code-server"),
|
48
|
+
})
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import { appName, sharedInputs, source } from "./shared"
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The Gitea Git server deployed on Kubernetes.
|
7
|
+
*/
|
8
|
+
export const gitea = defineUnit({
|
9
|
+
type: "k8s.apps.gitea.v1",
|
10
|
+
|
11
|
+
args: {
|
12
|
+
...appName("gitea"),
|
13
|
+
},
|
14
|
+
inputs: {
|
15
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint", "mariadb"]),
|
16
|
+
},
|
17
|
+
|
18
|
+
meta: {
|
19
|
+
title: "Gitea",
|
20
|
+
icon: "simple-icons:gitea",
|
21
|
+
category: "Development",
|
22
|
+
},
|
23
|
+
|
24
|
+
source: source("gitea"),
|
25
|
+
})
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import {
|
4
|
+
appName,
|
5
|
+
optionalSharedInputs,
|
6
|
+
sharedArgs,
|
7
|
+
sharedInputs,
|
8
|
+
sharedSecrets,
|
9
|
+
source,
|
10
|
+
} from "./shared"
|
11
|
+
|
12
|
+
/**
|
13
|
+
* The Grocy application deployed on Kubernetes.
|
14
|
+
*
|
15
|
+
* Grocy is a web-based self-hosted groceries & household management solution for your home.
|
16
|
+
*/
|
17
|
+
export const grocy = defineUnit({
|
18
|
+
type: "k8s.apps.grocy.v1",
|
19
|
+
|
20
|
+
args: {
|
21
|
+
...appName("grocy"),
|
22
|
+
...pick(sharedArgs, ["fqdn"]),
|
23
|
+
},
|
24
|
+
secrets: {
|
25
|
+
...pick(sharedSecrets, ["backupPassword"]),
|
26
|
+
},
|
27
|
+
inputs: {
|
28
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
29
|
+
...pick(optionalSharedInputs, ["resticRepo"]),
|
30
|
+
},
|
31
|
+
|
32
|
+
meta: {
|
33
|
+
title: "Grocy",
|
34
|
+
icon: "simple-icons:grocy",
|
35
|
+
category: "Productivity",
|
36
|
+
},
|
37
|
+
|
38
|
+
source: source("grocy"),
|
39
|
+
})
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Exposes Hubble UI to the user.
|
7
|
+
*
|
8
|
+
* It must be already installed in the cluster as part of the Cilium.
|
9
|
+
*/
|
10
|
+
export const hubble = defineUnit({
|
11
|
+
type: "k8s.apps.hubble.v1",
|
12
|
+
|
13
|
+
args: {
|
14
|
+
...appName("hubble"),
|
15
|
+
...pick(sharedArgs, ["fqdn"]),
|
16
|
+
},
|
17
|
+
|
18
|
+
inputs: {
|
19
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
20
|
+
},
|
21
|
+
|
22
|
+
meta: {
|
23
|
+
title: "Hubble",
|
24
|
+
icon: "mdi:eye",
|
25
|
+
secondaryIcon: "simple-icons:cilium",
|
26
|
+
category: "Observability",
|
27
|
+
},
|
28
|
+
|
29
|
+
source: source("hubble"),
|
30
|
+
})
|
@@ -1,18 +1,21 @@
|
|
1
|
+
export * from "./code-server"
|
2
|
+
export * from "./grocy"
|
3
|
+
export * from "./hubble"
|
4
|
+
export * from "./kubernetes-dashboard"
|
1
5
|
export * from "./mariadb"
|
2
|
-
export * from "./
|
3
|
-
export * from "./vaultwarden"
|
6
|
+
export * from "./maybe"
|
4
7
|
export * from "./mongodb"
|
5
|
-
export * from "./
|
6
|
-
export
|
8
|
+
export * from "./postgresql"
|
9
|
+
export {
|
10
|
+
appName,
|
11
|
+
optionalSharedArgs,
|
12
|
+
optionalSharedInputs,
|
13
|
+
sharedArgs,
|
14
|
+
sharedInputs,
|
15
|
+
} from "./shared"
|
16
|
+
export * from "./syncthing"
|
7
17
|
// export * from "./zitadel"
|
8
18
|
// export * from "./gitea"
|
9
19
|
export * from "./traefik"
|
10
|
-
export * from "./
|
11
|
-
export * from "./
|
12
|
-
export * from "./maybe"
|
13
|
-
export * from "./deployment"
|
14
|
-
export * from "./syncthing"
|
15
|
-
export * from "./code-server"
|
16
|
-
export * from "./hubble"
|
17
|
-
|
18
|
-
export { createArgs, createInputs } from "./shared"
|
20
|
+
export * from "./vaultwarden"
|
21
|
+
export * from "./workload"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The Kubernetes Dashboard deployed on Kubernetes.
|
7
|
+
*/
|
8
|
+
export const kubernetesDashboard = defineUnit({
|
9
|
+
type: "k8s.apps.kubernetes-dashboard.v1",
|
10
|
+
|
11
|
+
args: {
|
12
|
+
...appName("kubernetes-dashboard"),
|
13
|
+
...pick(sharedArgs, ["fqdn"]),
|
14
|
+
},
|
15
|
+
|
16
|
+
inputs: {
|
17
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
18
|
+
},
|
19
|
+
|
20
|
+
meta: {
|
21
|
+
title: "Kubernetes Dashboard",
|
22
|
+
icon: "devicon:kubernetes",
|
23
|
+
secondaryIcon: "material-symbols:dashboard",
|
24
|
+
category: "Kubernetes",
|
25
|
+
},
|
26
|
+
|
27
|
+
source: source("kubernetes-dashboard"),
|
28
|
+
})
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import * as databases from "../../databases"
|
4
|
+
import { l4EndpointEntity } from "../../network"
|
5
|
+
import { serviceEntity } from "../service"
|
6
|
+
import {
|
7
|
+
appName,
|
8
|
+
optionalSharedInputs,
|
9
|
+
sharedArgs,
|
10
|
+
sharedDatabaseArgs,
|
11
|
+
sharedDatabaseSecrets,
|
12
|
+
sharedInputs,
|
13
|
+
sharedSecrets,
|
14
|
+
source,
|
15
|
+
} from "./shared"
|
16
|
+
|
17
|
+
/**
|
18
|
+
* The MariaDB database deployed on Kubernetes.
|
19
|
+
*/
|
20
|
+
export const mariadb = defineUnit({
|
21
|
+
type: "k8s.apps.mariadb.v1",
|
22
|
+
args: {
|
23
|
+
...appName("mariadb"),
|
24
|
+
...pick(sharedArgs, ["external"]),
|
25
|
+
},
|
26
|
+
|
27
|
+
secrets: {
|
28
|
+
...pick(sharedSecrets, ["rootPassword", "backupPassword"]),
|
29
|
+
},
|
30
|
+
|
31
|
+
inputs: {
|
32
|
+
...pick(sharedInputs, ["k8sCluster"]),
|
33
|
+
...pick(optionalSharedInputs, ["resticRepo"]),
|
34
|
+
},
|
35
|
+
|
36
|
+
outputs: {
|
37
|
+
mariadb: databases.mariadbEntity,
|
38
|
+
service: serviceEntity,
|
39
|
+
endpoints: {
|
40
|
+
entity: l4EndpointEntity,
|
41
|
+
multiple: true,
|
42
|
+
},
|
43
|
+
},
|
44
|
+
|
45
|
+
meta: {
|
46
|
+
title: "MariaDB",
|
47
|
+
icon: "simple-icons:mariadb",
|
48
|
+
secondaryIcon: "mdi:database",
|
49
|
+
category: "Databases",
|
50
|
+
},
|
51
|
+
|
52
|
+
source: source("mariadb/app"),
|
53
|
+
})
|
54
|
+
|
55
|
+
/**
|
56
|
+
* The virtual MariaDB database created on the MariaDB instance.
|
57
|
+
*
|
58
|
+
* Requires a Kubernetes cluster to place init jobs and secrets.
|
59
|
+
*/
|
60
|
+
export const mariadbDatabase = defineUnit({
|
61
|
+
type: "k8s.apps.mariadb.database.v1",
|
62
|
+
|
63
|
+
args: sharedDatabaseArgs,
|
64
|
+
secrets: sharedDatabaseSecrets,
|
65
|
+
|
66
|
+
inputs: {
|
67
|
+
...pick(sharedInputs, ["k8sCluster", "mariadb"]),
|
68
|
+
...pick(optionalSharedInputs, ["namespace"]),
|
69
|
+
},
|
70
|
+
|
71
|
+
outputs: {
|
72
|
+
mariadb: databases.mariadbEntity,
|
73
|
+
},
|
74
|
+
|
75
|
+
meta: {
|
76
|
+
title: "MariaDB Database",
|
77
|
+
icon: "simple-icons:mariadb",
|
78
|
+
secondaryIcon: "mdi:database-plus",
|
79
|
+
category: "Databases",
|
80
|
+
},
|
81
|
+
|
82
|
+
source: source("mariadb/database"),
|
83
|
+
})
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
2
|
+
import { pick } from "remeda"
|
3
|
+
import {
|
4
|
+
appName,
|
5
|
+
optionalSharedInputs,
|
6
|
+
sharedArgs,
|
7
|
+
sharedInputs,
|
8
|
+
sharedSecrets,
|
9
|
+
source,
|
10
|
+
} from "./shared"
|
11
|
+
|
12
|
+
export const maybe = defineUnit({
|
13
|
+
type: "k8s.apps.maybe.v1",
|
14
|
+
|
15
|
+
args: {
|
16
|
+
...appName("maybe"),
|
17
|
+
...pick(sharedArgs, ["fqdn"]),
|
18
|
+
},
|
19
|
+
|
20
|
+
secrets: {
|
21
|
+
...pick(sharedSecrets, ["backupPassword"]),
|
22
|
+
postgresqlPassword: z.string().optional(),
|
23
|
+
secretKey: z.string().optional(),
|
24
|
+
},
|
25
|
+
|
26
|
+
inputs: {
|
27
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint", "postgresql"]),
|
28
|
+
...pick(optionalSharedInputs, ["resticRepo"]),
|
29
|
+
},
|
30
|
+
|
31
|
+
meta: {
|
32
|
+
title: "Maybe",
|
33
|
+
description: "The OS for your personal finances.",
|
34
|
+
icon: "arcticons:finance-manager",
|
35
|
+
category: "Finance",
|
36
|
+
},
|
37
|
+
|
38
|
+
source: source("maybe"),
|
39
|
+
})
|