@highstate/library 0.19.1 → 0.21.1
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 +2836 -3440
- package/package.json +12 -12
- package/src/abbreviations.ts +3 -0
- package/src/common/access-point.ts +19 -4
- package/src/common/files.ts +24 -17
- package/src/common/server.ts +19 -6
- package/src/databases/etcd.ts +141 -39
- package/src/databases/index.ts +8 -7
- package/src/databases/influxdb3.ts +103 -0
- package/src/databases/minio.ts +157 -0
- package/src/databases/mongodb.ts +122 -41
- package/src/databases/mysql.ts +172 -0
- package/src/databases/postgresql.ts +133 -40
- package/src/databases/redis.ts +118 -44
- package/src/databases/s3.ts +48 -127
- package/src/dns.ts +11 -7
- package/src/index.ts +3 -1
- package/src/k3s.ts +7 -0
- package/src/k8s/apps/etcd.ts +3 -3
- package/src/k8s/apps/gitea.ts +1 -1
- package/src/k8s/apps/grafana.ts +48 -0
- package/src/k8s/apps/index.ts +4 -2
- package/src/k8s/apps/mariadb.ts +7 -38
- package/src/k8s/apps/matrix-stack.ts +62 -0
- package/src/k8s/apps/minio.ts +38 -45
- package/src/k8s/apps/mongodb.ts +6 -38
- package/src/k8s/apps/portal.ts +27 -0
- package/src/k8s/apps/postgresql.ts +7 -41
- package/src/k8s/apps/refluxdb.ts +49 -0
- package/src/k8s/apps/remnawave.ts +15 -2
- package/src/k8s/apps/shared.ts +16 -15
- package/src/k8s/apps/traefik.ts +5 -0
- package/src/k8s/apps/valkey.ts +5 -5
- package/src/k8s/apps/vaultwarden.ts +2 -6
- package/src/k8s/apps/workload.ts +14 -11
- package/src/k8s/cert-manager.ts +22 -0
- package/src/k8s/cilium.ts +17 -2
- package/src/k8s/resources.ts +41 -9
- package/src/k8s/service.ts +6 -2
- package/src/k8s/shared.ts +49 -18
- package/src/k8s/workload.ts +59 -43
- package/src/network/address-space.ts +30 -7
- package/src/network/address.ts +13 -2
- package/src/network/endpoint-container.ts +235 -0
- package/src/network/endpoint-schema.ts +8 -0
- package/src/network/endpoint.ts +20 -39
- package/src/network/index.ts +1 -1
- package/src/network/subnet.ts +4 -2
- package/src/proxmox.ts +24 -7
- package/src/restic.ts +8 -2
- package/src/ssh.ts +52 -30
- package/src/talos.ts +8 -2
- package/src/third-party/cloudflare.ts +4 -4
- package/src/third-party/timeweb.ts +17 -3
- package/src/third-party/yandex.ts +198 -88
- package/src/tls.ts +22 -0
- package/src/utils.ts +16 -1
- package/src/wireguard.ts +362 -120
- package/LICENSE +0 -21
- package/dist/index.js.map +0 -1
- package/src/databases/mariadb.ts +0 -91
- package/src/databases/shared.ts +0 -67
- package/src/k8s/apps/kubernetes-dashboard.ts +0 -28
- package/src/k8s/apps/maybe.ts +0 -39
- package/src/network/dynamic-endpoint.ts +0 -43
package/src/dns.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineEntity,
|
|
3
|
+
defineUnit,
|
|
4
|
+
type EntityInput,
|
|
5
|
+
type EntityValue,
|
|
6
|
+
z,
|
|
7
|
+
} from "@highstate/contract"
|
|
2
8
|
import { mapValues, pick } from "remeda"
|
|
3
9
|
import { serverEntity } from "./common/server"
|
|
4
10
|
import { implementationReferenceSchema } from "./impl-ref"
|
|
@@ -8,11 +14,6 @@ export const providerEntity = defineEntity({
|
|
|
8
14
|
type: "dns.provider.v1",
|
|
9
15
|
|
|
10
16
|
schema: z.object({
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the DNS provider unique within the system.
|
|
13
|
-
*/
|
|
14
|
-
id: z.string(),
|
|
15
|
-
|
|
16
17
|
/**
|
|
17
18
|
* The zones managed by the DNS provider.
|
|
18
19
|
*/
|
|
@@ -26,6 +27,9 @@ export const providerEntity = defineEntity({
|
|
|
26
27
|
|
|
27
28
|
meta: {
|
|
28
29
|
color: "#FF5722",
|
|
30
|
+
title: "DNS Provider",
|
|
31
|
+
icon: "mdi:dns",
|
|
32
|
+
iconColor: "#FF5722",
|
|
29
33
|
},
|
|
30
34
|
})
|
|
31
35
|
|
|
@@ -179,5 +183,5 @@ export const inputs = {
|
|
|
179
183
|
},
|
|
180
184
|
} as const
|
|
181
185
|
|
|
182
|
-
export type Provider =
|
|
186
|
+
export type Provider = EntityValue<typeof providerEntity>
|
|
183
187
|
export type ProviderInput = EntityInput<typeof providerEntity>
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { noop } from "./abbreviations"
|
|
|
3
3
|
noop()
|
|
4
4
|
|
|
5
5
|
export * as common from "./common"
|
|
6
|
-
export *
|
|
6
|
+
export * from "./databases"
|
|
7
7
|
export * as distributions from "./distributions"
|
|
8
8
|
export * as dns from "./dns"
|
|
9
9
|
export * as git from "./git"
|
|
@@ -20,3 +20,5 @@ export * as talos from "./talos"
|
|
|
20
20
|
export * from "./third-party"
|
|
21
21
|
export * from "./utils"
|
|
22
22
|
export * as wireguard from "./wireguard"
|
|
23
|
+
|
|
24
|
+
// hi234
|
package/src/k3s.ts
CHANGED
|
@@ -63,6 +63,13 @@ export const cluster = defineUnit({
|
|
|
63
63
|
*/
|
|
64
64
|
agentConfig: z.record(z.string(), z.unknown()).optional(),
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The map of configuration per each node in the cluster, where the key is the hostname of the node.
|
|
68
|
+
*
|
|
69
|
+
* Note: if multiple nodes have the same hostname, the configuration will be applied to all of them.
|
|
70
|
+
*/
|
|
71
|
+
nodeConfig: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
|
72
|
+
|
|
66
73
|
/**
|
|
67
74
|
* The configuration of the registries to use for the K3S cluster.
|
|
68
75
|
*
|
package/src/k8s/apps/etcd.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
|
-
import
|
|
3
|
+
import { connectionEntity } from "../../databases/etcd"
|
|
4
4
|
import {
|
|
5
5
|
appName,
|
|
6
6
|
optionalSharedInputs,
|
|
@@ -31,7 +31,7 @@ export const etcd = defineUnit({
|
|
|
31
31
|
},
|
|
32
32
|
|
|
33
33
|
outputs: {
|
|
34
|
-
|
|
34
|
+
connection: connectionEntity,
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
meta: {
|
|
@@ -42,5 +42,5 @@ export const etcd = defineUnit({
|
|
|
42
42
|
category: "Databases",
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
source: source("etcd
|
|
45
|
+
source: source("etcd"),
|
|
46
46
|
})
|
package/src/k8s/apps/gitea.ts
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import { serviceEntity } from "../service"
|
|
4
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Grafana deployed on Kubernetes.
|
|
8
|
+
*/
|
|
9
|
+
export const grafana = defineUnit({
|
|
10
|
+
type: "k8s.apps.grafana.v1",
|
|
11
|
+
|
|
12
|
+
args: {
|
|
13
|
+
...appName("grafana"),
|
|
14
|
+
...pick(sharedArgs, ["fqdn"]),
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The list of plugins to install on Grafana.
|
|
18
|
+
*
|
|
19
|
+
* See https://grafana.com/grafana/plugins for available plugins and their names.
|
|
20
|
+
*/
|
|
21
|
+
plugins: z.string().array().default([]),
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
secrets: {
|
|
25
|
+
/**
|
|
26
|
+
* The admin password used for Grafana.
|
|
27
|
+
*
|
|
28
|
+
* If not provided, a random password will be generated.
|
|
29
|
+
*/
|
|
30
|
+
adminPassword: z.string().optional(),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
inputs: {
|
|
34
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
outputs: {
|
|
38
|
+
service: serviceEntity,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
meta: {
|
|
42
|
+
title: "Grafana",
|
|
43
|
+
icon: "simple-icons:grafana",
|
|
44
|
+
category: "Observability",
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
source: source("grafana"),
|
|
48
|
+
})
|
package/src/k8s/apps/index.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export * from "./code-server"
|
|
2
2
|
export * from "./etcd"
|
|
3
|
+
export * from "./grafana"
|
|
3
4
|
export * from "./grocy"
|
|
4
5
|
export * from "./hubble"
|
|
5
|
-
export * from "./kubernetes-dashboard"
|
|
6
6
|
export * from "./mariadb"
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./matrix-stack"
|
|
8
8
|
export * from "./minio"
|
|
9
9
|
export * from "./mongodb"
|
|
10
|
+
export * from "./portal"
|
|
10
11
|
export * from "./postgresql"
|
|
12
|
+
export * from "./refluxdb"
|
|
11
13
|
export * from "./remnawave"
|
|
12
14
|
export {
|
|
13
15
|
appName,
|
package/src/k8s/apps/mariadb.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { connectionEntity } from "../../databases/mysql"
|
|
4
|
+
import { statefulSetEntity } from "../workload"
|
|
5
5
|
import {
|
|
6
6
|
appName,
|
|
7
7
|
optionalSharedInputs,
|
|
8
8
|
sharedArgs,
|
|
9
|
-
sharedDatabaseArgs,
|
|
10
|
-
sharedDatabaseSecrets,
|
|
11
9
|
sharedInputs,
|
|
12
10
|
sharedSecrets,
|
|
13
11
|
source,
|
|
@@ -18,13 +16,14 @@ import {
|
|
|
18
16
|
*/
|
|
19
17
|
export const mariadb = defineUnit({
|
|
20
18
|
type: "k8s.apps.mariadb.v1",
|
|
19
|
+
|
|
21
20
|
args: {
|
|
22
21
|
...appName("mariadb"),
|
|
23
22
|
...pick(sharedArgs, ["external"]),
|
|
24
23
|
},
|
|
25
24
|
|
|
26
25
|
secrets: {
|
|
27
|
-
...pick(sharedSecrets, ["
|
|
26
|
+
...pick(sharedSecrets, ["adminPassword", "backupKey"]),
|
|
28
27
|
},
|
|
29
28
|
|
|
30
29
|
inputs: {
|
|
@@ -33,8 +32,8 @@ export const mariadb = defineUnit({
|
|
|
33
32
|
},
|
|
34
33
|
|
|
35
34
|
outputs: {
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
connection: connectionEntity,
|
|
36
|
+
statefulSet: statefulSetEntity,
|
|
38
37
|
},
|
|
39
38
|
|
|
40
39
|
meta: {
|
|
@@ -44,35 +43,5 @@ export const mariadb = defineUnit({
|
|
|
44
43
|
category: "Databases",
|
|
45
44
|
},
|
|
46
45
|
|
|
47
|
-
source: source("mariadb
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The virtual MariaDB database created on the MariaDB instance.
|
|
52
|
-
*
|
|
53
|
-
* Requires a Kubernetes cluster to place init jobs and secrets.
|
|
54
|
-
*/
|
|
55
|
-
export const mariadbDatabase = defineUnit({
|
|
56
|
-
type: "k8s.apps.mariadb.database.v1",
|
|
57
|
-
|
|
58
|
-
args: sharedDatabaseArgs,
|
|
59
|
-
secrets: sharedDatabaseSecrets,
|
|
60
|
-
|
|
61
|
-
inputs: {
|
|
62
|
-
...pick(sharedInputs, ["k8sCluster", "mariadb"]),
|
|
63
|
-
...pick(optionalSharedInputs, ["namespace"]),
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
outputs: {
|
|
67
|
-
mariadb: databases.mariadbEntity,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
meta: {
|
|
71
|
-
title: "MariaDB Database",
|
|
72
|
-
icon: "simple-icons:mariadb",
|
|
73
|
-
secondaryIcon: "mdi:database-plus",
|
|
74
|
-
category: "Databases",
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
source: source("mariadb/database"),
|
|
46
|
+
source: source("mariadb"),
|
|
78
47
|
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import { postgresql } from "../../databases"
|
|
4
|
+
import { appName, sharedInputs, source } from "./shared"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Matrix stack deployed on Kubernetes.
|
|
8
|
+
*/
|
|
9
|
+
export const matrixStack = defineUnit({
|
|
10
|
+
type: "k8s.apps.matrix-stack.v1",
|
|
11
|
+
|
|
12
|
+
args: {
|
|
13
|
+
...appName("matrix-stack"),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The base domain for the Matrix stack services.
|
|
17
|
+
*
|
|
18
|
+
* Subdomains for Matrix services are generated automatically.
|
|
19
|
+
* This value cannot be changed after the first deployment.
|
|
20
|
+
*/
|
|
21
|
+
fqdn: z.string(),
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Whether to enable cinny web client deployment.
|
|
25
|
+
*
|
|
26
|
+
* The FQDN will be generated as `cinny.${fqdn}`.
|
|
27
|
+
*/
|
|
28
|
+
enableCinny: z.boolean().default(false),
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The list of remote Matrix domains that are allowed for federation.
|
|
32
|
+
*
|
|
33
|
+
* Leave empty to allow federation with all domains.
|
|
34
|
+
*/
|
|
35
|
+
federationDomainWhitelist: z.array(z.string()).default([]),
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
inputs: {
|
|
39
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The PostgreSQL connection for the Synapse server.
|
|
43
|
+
*/
|
|
44
|
+
synapsePostgresql: postgresql.connectionEntity,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The PostgreSQL connection for the Matrix Authentication Service.
|
|
48
|
+
*/
|
|
49
|
+
masPostgresql: postgresql.connectionEntity,
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
secrets: {},
|
|
53
|
+
|
|
54
|
+
meta: {
|
|
55
|
+
title: "Matrix Stack",
|
|
56
|
+
icon: "simple-icons:matrix",
|
|
57
|
+
secondaryIcon: "simple-icons:element",
|
|
58
|
+
category: "Communication",
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
source: source("matrix-stack"),
|
|
62
|
+
})
|
package/src/k8s/apps/minio.ts
CHANGED
|
@@ -1,68 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* The key that protects Restic backups.
|
|
15
|
-
*/
|
|
16
|
-
backupKey: z.string().optional(),
|
|
17
|
-
})
|
|
3
|
+
import { connectionEntity } from "../../databases/minio"
|
|
4
|
+
import { deploymentEntity } from "../workload"
|
|
5
|
+
import {
|
|
6
|
+
appName,
|
|
7
|
+
optionalSharedArgs,
|
|
8
|
+
optionalSharedInputs,
|
|
9
|
+
sharedArgs,
|
|
10
|
+
sharedInputs,
|
|
11
|
+
sharedSecrets,
|
|
12
|
+
source,
|
|
13
|
+
} from "./shared"
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
16
|
* The MinIO object storage deployed on Kubernetes.
|
|
21
17
|
*/
|
|
22
18
|
export const minio = defineUnit({
|
|
23
19
|
type: "k8s.apps.minio.v1",
|
|
20
|
+
|
|
24
21
|
args: {
|
|
25
22
|
...appName("minio"),
|
|
23
|
+
...pick(optionalSharedArgs, ["fqdn"]),
|
|
26
24
|
...pick(sharedArgs, ["external"]),
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
26
|
+
/**
|
|
27
|
+
* The FQDN of the MinIO console.
|
|
28
|
+
*
|
|
29
|
+
* If not provided, the console will not be exposed and only the S3 API will be available.
|
|
30
|
+
*/
|
|
31
|
+
consoleFqdn: z.string().optional(),
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The name of the region to associate with the MinIO deployment.
|
|
35
|
+
*
|
|
36
|
+
* Defaults to "us-east-1".
|
|
37
|
+
*/
|
|
38
|
+
region: z.string().default("us-east-1"),
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Each entry can optionally include a bucket policy: none, download, upload, or public.
|
|
51
|
-
`,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
40
|
+
/**
|
|
41
|
+
* Whether to use the [fork](https://github.com/huncrys/minio-console) of MinIO Console instead of the built-in console.
|
|
42
|
+
* The fork contains admin features that were removed from the original console.
|
|
43
|
+
*/
|
|
44
|
+
useConsoleFork: z.boolean().default(false),
|
|
54
45
|
},
|
|
55
46
|
|
|
56
|
-
secrets:
|
|
47
|
+
secrets: {
|
|
48
|
+
...pick(sharedSecrets, ["adminPassword", "backupKey"]),
|
|
49
|
+
},
|
|
57
50
|
|
|
58
51
|
inputs: {
|
|
59
52
|
...pick(sharedInputs, ["k8sCluster"]),
|
|
60
|
-
...pick(optionalSharedInputs, ["resticRepo"]),
|
|
53
|
+
...pick(optionalSharedInputs, ["accessPoint", "resticRepo"]),
|
|
61
54
|
},
|
|
62
55
|
|
|
63
56
|
outputs: {
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
connection: connectionEntity,
|
|
58
|
+
deployment: deploymentEntity,
|
|
66
59
|
},
|
|
67
60
|
|
|
68
61
|
meta: {
|
|
@@ -72,5 +65,5 @@ export const minio = defineUnit({
|
|
|
72
65
|
category: "Databases",
|
|
73
66
|
},
|
|
74
67
|
|
|
75
|
-
source: source("minio
|
|
68
|
+
source: source("minio"),
|
|
76
69
|
})
|
package/src/k8s/apps/mongodb.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { connectionEntity } from "../../databases/mongodb"
|
|
4
|
+
import { statefulSetEntity } from "../workload"
|
|
5
5
|
import {
|
|
6
6
|
appName,
|
|
7
7
|
optionalSharedInputs,
|
|
8
8
|
sharedArgs,
|
|
9
|
-
sharedDatabaseArgs,
|
|
10
|
-
sharedDatabaseSecrets,
|
|
11
9
|
sharedInputs,
|
|
12
10
|
sharedSecrets,
|
|
13
11
|
source,
|
|
@@ -25,7 +23,7 @@ export const mongodb = defineUnit({
|
|
|
25
23
|
},
|
|
26
24
|
|
|
27
25
|
secrets: {
|
|
28
|
-
...pick(sharedSecrets, ["
|
|
26
|
+
...pick(sharedSecrets, ["adminPassword", "backupKey"]),
|
|
29
27
|
},
|
|
30
28
|
|
|
31
29
|
inputs: {
|
|
@@ -34,8 +32,8 @@ export const mongodb = defineUnit({
|
|
|
34
32
|
},
|
|
35
33
|
|
|
36
34
|
outputs: {
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
connection: connectionEntity,
|
|
36
|
+
statefulSet: statefulSetEntity,
|
|
39
37
|
},
|
|
40
38
|
|
|
41
39
|
meta: {
|
|
@@ -45,35 +43,5 @@ export const mongodb = defineUnit({
|
|
|
45
43
|
category: "Databases",
|
|
46
44
|
},
|
|
47
45
|
|
|
48
|
-
source: source("mongodb
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The virtual MongoDB database created on the MongoDB instance.
|
|
53
|
-
*
|
|
54
|
-
* Requires a Kubernetes cluster to place init jobs and secrets.
|
|
55
|
-
*/
|
|
56
|
-
export const mongodbDatabase = defineUnit({
|
|
57
|
-
type: "k8s.apps.mongodb.database.v1",
|
|
58
|
-
|
|
59
|
-
args: sharedDatabaseArgs,
|
|
60
|
-
secrets: sharedDatabaseSecrets,
|
|
61
|
-
|
|
62
|
-
inputs: {
|
|
63
|
-
...pick(sharedInputs, ["k8sCluster", "mongodb"]),
|
|
64
|
-
...pick(optionalSharedInputs, ["namespace"]),
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
outputs: {
|
|
68
|
-
mongodb: databases.mongodbEntity,
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
meta: {
|
|
72
|
-
title: "MongoDB Database",
|
|
73
|
-
icon: "simple-icons:mongodb",
|
|
74
|
-
secondaryIcon: "mdi:database-plus",
|
|
75
|
-
category: "Databases",
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
source: source("mongodb/database"),
|
|
46
|
+
source: source("mongodb"),
|
|
79
47
|
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineUnit } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Portal application deployed on Kubernetes.
|
|
7
|
+
*/
|
|
8
|
+
export const portal = defineUnit({
|
|
9
|
+
type: "k8s.apps.portal.v1",
|
|
10
|
+
|
|
11
|
+
args: {
|
|
12
|
+
...appName("portal"),
|
|
13
|
+
...pick(sharedArgs, ["fqdn"]),
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
inputs: {
|
|
17
|
+
...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
meta: {
|
|
21
|
+
title: "Portal",
|
|
22
|
+
icon: "mdi:application-outline",
|
|
23
|
+
category: "Services",
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
source: source("portal"),
|
|
27
|
+
})
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineUnit } from "@highstate/contract"
|
|
2
2
|
import { pick } from "remeda"
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { connectionEntity } from "../../databases/postgresql"
|
|
4
|
+
import { statefulSetEntity } from "../workload"
|
|
5
5
|
import {
|
|
6
6
|
appName,
|
|
7
7
|
optionalSharedInputs,
|
|
8
8
|
sharedArgs,
|
|
9
|
-
sharedDatabaseArgs,
|
|
10
|
-
sharedDatabaseSecrets,
|
|
11
9
|
sharedInputs,
|
|
12
10
|
sharedSecrets,
|
|
13
11
|
source,
|
|
@@ -21,11 +19,11 @@ export const postgresql = defineUnit({
|
|
|
21
19
|
|
|
22
20
|
args: {
|
|
23
21
|
...appName("postgresql"),
|
|
24
|
-
...pick(sharedArgs, ["external"]),
|
|
22
|
+
...pick(sharedArgs, ["namespace", "external"]),
|
|
25
23
|
},
|
|
26
24
|
|
|
27
25
|
secrets: {
|
|
28
|
-
...pick(sharedSecrets, ["
|
|
26
|
+
...pick(sharedSecrets, ["adminPassword", "backupKey"]),
|
|
29
27
|
},
|
|
30
28
|
|
|
31
29
|
inputs: {
|
|
@@ -34,8 +32,8 @@ export const postgresql = defineUnit({
|
|
|
34
32
|
},
|
|
35
33
|
|
|
36
34
|
outputs: {
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
connection: connectionEntity,
|
|
36
|
+
statefulSet: statefulSetEntity,
|
|
39
37
|
},
|
|
40
38
|
|
|
41
39
|
meta: {
|
|
@@ -45,37 +43,5 @@ export const postgresql = defineUnit({
|
|
|
45
43
|
category: "Databases",
|
|
46
44
|
},
|
|
47
45
|
|
|
48
|
-
source: source("postgresql
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The virtual PostgreSQL database created on the PostgreSQL instance.
|
|
53
|
-
*
|
|
54
|
-
* The provided database must be authorized to create databases and users.
|
|
55
|
-
*
|
|
56
|
-
* Requires a Kubernetes cluster to place init jobs and secrets.
|
|
57
|
-
*/
|
|
58
|
-
export const postgresqlDatabase = defineUnit({
|
|
59
|
-
type: "k8s.apps.postgresql.database.v1",
|
|
60
|
-
|
|
61
|
-
args: sharedDatabaseArgs,
|
|
62
|
-
secrets: sharedDatabaseSecrets,
|
|
63
|
-
|
|
64
|
-
inputs: {
|
|
65
|
-
...pick(sharedInputs, ["k8sCluster", "postgresql"]),
|
|
66
|
-
...pick(optionalSharedInputs, ["namespace"]),
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
outputs: {
|
|
70
|
-
postgresql: databases.postgresqlEntity,
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
meta: {
|
|
74
|
-
title: "PostgreSQL Database",
|
|
75
|
-
icon: "simple-icons:postgresql",
|
|
76
|
-
secondaryIcon: "mdi:database-plus",
|
|
77
|
-
category: "Databases",
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
source: source("postgresql/database"),
|
|
46
|
+
source: source("postgresql"),
|
|
81
47
|
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineUnit, z } from "@highstate/contract"
|
|
2
|
+
import { pick } from "remeda"
|
|
3
|
+
import { influxdb3, s3 } from "../../databases"
|
|
4
|
+
import { deploymentEntity } from "../workload"
|
|
5
|
+
import { appName, sharedArgs, sharedInputs, source } from "./shared"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The RefluxDB instance deployed on Kubernetes.
|
|
9
|
+
*/
|
|
10
|
+
export const refluxdb = defineUnit({
|
|
11
|
+
type: "k8s.apps.refluxdb.v1",
|
|
12
|
+
|
|
13
|
+
args: {
|
|
14
|
+
...appName("refluxdb"),
|
|
15
|
+
...pick(sharedArgs, ["external"]),
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the node.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to "local1".
|
|
21
|
+
*/
|
|
22
|
+
nodeId: z.string().default("local1"),
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
secrets: {
|
|
26
|
+
/**
|
|
27
|
+
* The operator token of the RefluxDB instance.
|
|
28
|
+
*/
|
|
29
|
+
operatorToken: z.string().optional(),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
inputs: {
|
|
33
|
+
...pick(sharedInputs, ["k8sCluster"]),
|
|
34
|
+
s3Bucket: s3.bucketEntity,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
outputs: {
|
|
38
|
+
connection: influxdb3.connectionEntity,
|
|
39
|
+
deployment: deploymentEntity,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
meta: {
|
|
43
|
+
title: "RefluxDB (InfluxDB 3)",
|
|
44
|
+
icon: "simple-icons:influxdb",
|
|
45
|
+
category: "Databases",
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
source: source("refluxdb"),
|
|
49
|
+
})
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineEntity,
|
|
3
|
+
defineUnit,
|
|
4
|
+
type EntityInput,
|
|
5
|
+
type EntityValue,
|
|
6
|
+
z,
|
|
7
|
+
} from "@highstate/contract"
|
|
2
8
|
import { pick } from "remeda"
|
|
3
9
|
import { optionalSharedInputs, sharedInputs, source } from "./shared"
|
|
4
10
|
|
|
@@ -11,6 +17,13 @@ export const remnawaveEntity = defineEntity({
|
|
|
11
17
|
*/
|
|
12
18
|
instanceId: z.string(),
|
|
13
19
|
}),
|
|
20
|
+
|
|
21
|
+
meta: {
|
|
22
|
+
color: "#0066cc",
|
|
23
|
+
title: "Remnawave",
|
|
24
|
+
icon: "mdi:waveform",
|
|
25
|
+
iconColor: "#0066cc",
|
|
26
|
+
},
|
|
14
27
|
})
|
|
15
28
|
|
|
16
29
|
/**
|
|
@@ -65,5 +78,5 @@ export const node = defineUnit({
|
|
|
65
78
|
source: source("remnawave/node"),
|
|
66
79
|
})
|
|
67
80
|
|
|
68
|
-
export type Remnawave =
|
|
81
|
+
export type Remnawave = EntityValue<typeof remnawaveEntity>
|
|
69
82
|
export type RemnawaveInput = EntityInput<typeof remnawaveEntity>
|