@rocket.chat/houston 0.27.0-next.3 → 2.1.8
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/LICENSE +1 -1
- package/README.md +108 -15
- package/bin/houston +62 -0
- package/data/docs/ARCHITECTURE.md +387 -0
- package/data/docs/automation.md +107 -0
- package/data/docs/e2ee.md +76 -0
- package/data/docs/eks.md +258 -0
- package/data/docs/gui.md +282 -0
- package/data/docs/guide.md +669 -0
- package/data/docs/kubernetes.md +138 -0
- package/data/docs/troubleshooting.md +193 -0
- package/data/docs/upgrading.md +84 -0
- package/data/docs/voice.md +253 -0
- package/data/iam/engineer-policy.json +11 -0
- package/data/iam/engineer-rbac.yaml +42 -0
- package/data/iam/operator-policy.json +211 -0
- package/data/loadtest/badbot.js +22 -0
- package/data/loadtest/common.js +168 -0
- package/data/loadtest/custom.js +20 -0
- package/data/loadtest/journey.js +58 -0
- package/data/loadtest/login.js +18 -0
- package/data/loadtest/messages.js +13 -0
- package/data/loadtest/mixed.js +39 -0
- package/data/loadtest/read.js +12 -0
- package/data/loadtest/webhook.js +20 -0
- package/data/monitoring/houston-logs.json +98 -0
- package/data/monitoring/k6-loadtest.json +610 -0
- package/data/monitoring/mongodb-exporter.json +3007 -0
- package/data/monitoring/node-exporter-full.json +16114 -0
- package/data/monitoring/rocketchat-metrics.json +6471 -0
- package/data/presets/airgapped.yaml +16 -0
- package/data/presets/default.yaml +9 -0
- package/data/seed/avatar-0.png +0 -0
- package/data/seed/avatar-1.png +0 -0
- package/data/seed/avatar-2.png +0 -0
- package/data/seed/avatar-3.png +0 -0
- package/data/seed/avatar-4.png +0 -0
- package/data/seed/avatar-5.png +0 -0
- package/data/seed/avatar-6.png +0 -0
- package/data/seed/avatar-7.png +0 -0
- package/data/seed/seed-metrics.csv +3 -0
- package/data/seed/seed-preview.png +0 -0
- package/data/seed/seed-report.pdf +32 -0
- package/data/seed/seed-runbook.txt +3 -0
- package/data/skill/SKILL.md +399 -0
- package/data/versions.yaml +55 -0
- package/data/voice/freeswitch/drachtio.xml +52 -0
- package/data/voice/freeswitch/public.xml +87 -0
- package/data/webui/app.css +2003 -0
- package/data/webui/index.html +678 -0
- package/data/webui/js/api.js +561 -0
- package/data/webui/js/boot.js +44 -0
- package/data/webui/js/clusters-tail.js +1377 -0
- package/data/webui/js/clusters.js +896 -0
- package/data/webui/js/create.js +276 -0
- package/data/webui/js/detail.js +507 -0
- package/data/webui/js/jobs.js +636 -0
- package/data/webui/js/logs.js +634 -0
- package/data/webui/js/main.js +14 -0
- package/data/webui/js/options.js +408 -0
- package/data/webui/js/people.js +438 -0
- package/data/webui/js/perf.js +303 -0
- package/data/webui/js/render.js +438 -0
- package/data/webui/js/shared.js +3 -0
- package/data/webui/js/state.js +583 -0
- package/data/webui/js/theme.js +123 -0
- package/data/webui/js/util.js +584 -0
- package/dist/cli/app.js +593 -0
- package/dist/cli/capabilities.js +76 -0
- package/dist/cli/cell-widths.js +495 -0
- package/dist/cli/entry.js +10 -0
- package/dist/cli/error-panel.js +492 -0
- package/dist/cli/handlers/actor.js +84 -0
- package/dist/cli/handlers/https.js +614 -0
- package/dist/cli/handlers/prompt.js +299 -0
- package/dist/cli/handlers/users.js +226 -0
- package/dist/cli/handlers.js +3678 -0
- package/dist/cli/help.js +183 -0
- package/dist/cli/index.js +15 -0
- package/dist/cli/perf.js +810 -0
- package/dist/cli/render.js +254 -0
- package/dist/cli/serve.js +858 -0
- package/dist/cli/spec-data.js +2593 -0
- package/dist/cli/spec-types.js +8 -0
- package/dist/cli/usage-error.js +520 -0
- package/dist/cli/wire.js +70 -0
- package/dist/core/audit.js +346 -0
- package/dist/core/backup-compat.js +85 -0
- package/dist/core/backup.js +1639 -0
- package/dist/core/cluster.js +1398 -0
- package/dist/core/configimport.js +344 -0
- package/dist/core/data.js +267 -0
- package/dist/core/database-of.js +82 -0
- package/dist/core/diagnose.js +159 -0
- package/dist/core/doctor.js +1518 -0
- package/dist/core/edge/acme.js +338 -0
- package/dist/core/edge/engine.js +500 -0
- package/dist/core/edge/networks.js +174 -0
- package/dist/core/edge/paths.js +107 -0
- package/dist/core/edge/routes.js +251 -0
- package/dist/core/edge/routeyml.js +195 -0
- package/dist/core/edge/runtime.js +493 -0
- package/dist/core/edge/spec.js +305 -0
- package/dist/core/edge/types.js +202 -0
- package/dist/core/eks-docs.js +135 -0
- package/dist/core/eks.js +2240 -0
- package/dist/core/envvars.js +562 -0
- package/dist/core/eventlog.js +541 -0
- package/dist/core/firstrun.js +153 -0
- package/dist/core/journal.js +691 -0
- package/dist/core/kube/ask.js +231 -0
- package/dist/core/kube/capabilities.js +269 -0
- package/dist/core/kube/certmanager.js +452 -0
- package/dist/core/kube/chart.js +413 -0
- package/dist/core/kube/cluster.js +196 -0
- package/dist/core/kube/context.js +545 -0
- package/dist/core/kube/endpoints.js +448 -0
- package/dist/core/kube/exec.js +195 -0
- package/dist/core/kube/forward.js +732 -0
- package/dist/core/kube/grafana-ingress.js +110 -0
- package/dist/core/kube/ingress.js +218 -0
- package/dist/core/kube/manifests.js +361 -0
- package/dist/core/kube/monitoring.js +768 -0
- package/dist/core/kube/names.js +237 -0
- package/dist/core/kube/namespace.js +678 -0
- package/dist/core/kube/operator.js +941 -0
- package/dist/core/kube/probe.js +202 -0
- package/dist/core/kube/reachability.js +163 -0
- package/dist/core/kube/release.js +439 -0
- package/dist/core/kube/replicaset.js +180 -0
- package/dist/core/kube/scale.js +398 -0
- package/dist/core/kube/status.js +633 -0
- package/dist/core/kube/tools.js +238 -0
- package/dist/core/kube/transfer.js +173 -0
- package/dist/core/kube/workspace.js +423 -0
- package/dist/core/lifecycle/admin.js +64 -0
- package/dist/core/lifecycle/create-docker.js +1533 -0
- package/dist/core/lifecycle/create-k8s.js +939 -0
- package/dist/core/lifecycle/destroy.js +339 -0
- package/dist/core/lifecycle/inspect.js +635 -0
- package/dist/core/lifecycle/naming.js +298 -0
- package/dist/core/lifecycle/notes.js +726 -0
- package/dist/core/lifecycle/ownership.js +313 -0
- package/dist/core/lifecycle/payload.js +401 -0
- package/dist/core/lifecycle/ports.js +388 -0
- package/dist/core/lifecycle/preconditions.js +367 -0
- package/dist/core/lifecycle/pruning.js +551 -0
- package/dist/core/lifecycle/ready.js +753 -0
- package/dist/core/lifecycle/request.js +525 -0
- package/dist/core/lifecycle/seeding.js +281 -0
- package/dist/core/lifecycle/sizing.js +392 -0
- package/dist/core/lifecycle/state.js +286 -0
- package/dist/core/lifecycle/tlsplan.js +704 -0
- package/dist/core/lifecycle/types.js +232 -0
- package/dist/core/loadtest.js +995 -0
- package/dist/core/migrate.js +612 -0
- package/dist/core/monitor.js +494 -0
- package/dist/core/postready.js +969 -0
- package/dist/core/promote.js +804 -0
- package/dist/core/rcapi.js +1285 -0
- package/dist/core/recovery.js +75 -0
- package/dist/core/runner/engine.js +394 -0
- package/dist/core/runner/host.js +298 -0
- package/dist/core/runner/locks.js +129 -0
- package/dist/core/runner/paths.js +173 -0
- package/dist/core/runner/ports.js +172 -0
- package/dist/core/runner/queries.js +612 -0
- package/dist/core/runner/record.js +563 -0
- package/dist/core/scaleseed.js +271 -0
- package/dist/core/seed-db.js +208 -0
- package/dist/core/sessions.js +472 -0
- package/dist/core/skill.js +326 -0
- package/dist/core/sso-identities.js +172 -0
- package/dist/core/sso.js +703 -0
- package/dist/core/tls-local.js +311 -0
- package/dist/core/tls.js +878 -0
- package/dist/core/topology.js +482 -0
- package/dist/core/upgrade.js +868 -0
- package/dist/core/users.js +739 -0
- package/dist/lib/audit.js +100 -0
- package/dist/lib/close-matches.js +238 -0
- package/dist/lib/compose.js +672 -0
- package/dist/lib/config.js +1398 -0
- package/dist/lib/context.js +18 -0
- package/dist/lib/errors.js +305 -0
- package/dist/lib/events.js +208 -0
- package/dist/lib/float-text.js +126 -0
- package/dist/lib/format.js +1320 -0
- package/dist/lib/home.js +325 -0
- package/dist/lib/journal.js +122 -0
- package/dist/lib/json-text.js +733 -0
- package/dist/lib/jsonout.js +382 -0
- package/dist/lib/lock.js +516 -0
- package/dist/lib/login-name.js +202 -0
- package/dist/lib/map-limit.js +29 -0
- package/dist/lib/mkdir-parents.js +90 -0
- package/dist/lib/mongo-kernel.js +67 -0
- package/dist/lib/monitoring.js +492 -0
- package/dist/lib/platform-name.js +59 -0
- package/dist/lib/presets/common.js +390 -0
- package/dist/lib/presets/composite.js +326 -0
- package/dist/lib/presets/e2ee.js +143 -0
- package/dist/lib/presets/email.js +172 -0
- package/dist/lib/presets/guides.js +27 -0
- package/dist/lib/presets/index.js +490 -0
- package/dist/lib/presets/keycloak.js +369 -0
- package/dist/lib/presets/ldap.js +1285 -0
- package/dist/lib/presets/livechat.js +220 -0
- package/dist/lib/presets/multi-instance.js +124 -0
- package/dist/lib/presets/oidc.js +161 -0
- package/dist/lib/presets/public.js +496 -0
- package/dist/lib/presets/registry.js +64 -0
- package/dist/lib/presets/s3-minio.js +300 -0
- package/dist/lib/presets/saml.js +149 -0
- package/dist/lib/presets/scenario.js +51 -0
- package/dist/lib/presets/types.js +86 -0
- package/dist/lib/presets/voice-pbx.js +320 -0
- package/dist/lib/presets/voice.js +345 -0
- package/dist/lib/presets/webhooks.js +182 -0
- package/dist/lib/redact.js +106 -0
- package/dist/lib/seed-options.js +68 -0
- package/dist/lib/seed-profiles.js +59 -0
- package/dist/lib/targz.js +1383 -0
- package/dist/lib/teammode.js +25 -0
- package/dist/lib/tempdir.js +162 -0
- package/dist/lib/unicode-tables.js +2335 -0
- package/dist/lib/version-spec.js +357 -0
- package/dist/lib/versions.js +463 -0
- package/dist/lib/yaml-dump.js +1361 -0
- package/dist/perf/baseline.js +168 -0
- package/dist/perf/constrain.js +296 -0
- package/dist/perf/k6.js +235 -0
- package/dist/perf/mongoprof.js +171 -0
- package/dist/perf/rcmetrics.js +178 -0
- package/dist/perf/report.js +386 -0
- package/dist/perf/resources.js +224 -0
- package/dist/perf/slo.js +111 -0
- package/dist/perf/timeline.js +187 -0
- package/dist/perf/timings.js +85 -0
- package/dist/perf/verdict.js +201 -0
- package/dist/seams/aws-cli.js +126 -0
- package/dist/seams/docker-cli.js +280 -0
- package/dist/seams/exec.js +861 -0
- package/dist/seams/fs/lock.js +528 -0
- package/dist/seams/kubectl.js +83 -0
- package/dist/seams/rc-http.js +921 -0
- package/dist/seed/apply.js +190 -0
- package/dist/seed/assets.js +76 -0
- package/dist/seed/check.js +391 -0
- package/dist/seed/client.js +172 -0
- package/dist/seed/executor.js +726 -0
- package/dist/seed/history.js +281 -0
- package/dist/seed/kinds.js +91 -0
- package/dist/seed/plan.js +432 -0
- package/dist/seed/receipt.js +339 -0
- package/dist/seed/repairs.js +75 -0
- package/dist/seed/verification.js +363 -0
- package/dist/seed/wording.js +248 -0
- package/dist/web/app.js +326 -0
- package/dist/web/jobs.js +510 -0
- package/dist/web/route-deps.js +211 -0
- package/dist/web/route-table.js +213 -0
- package/dist/web/routes/backup.js +244 -0
- package/dist/web/routes/clusters.js +303 -0
- package/dist/web/routes/data.js +187 -0
- package/dist/web/routes/edge.js +82 -0
- package/dist/web/routes/index.js +63 -0
- package/dist/web/routes/jobs.js +95 -0
- package/dist/web/routes/logs.js +297 -0
- package/dist/web/routes/meta.js +191 -0
- package/dist/web/routes/people.js +151 -0
- package/dist/web/routes/perf.js +95 -0
- package/dist/web/routes/repros.js +550 -0
- package/dist/web/routes/session.js +361 -0
- package/dist/web/routes/spa.js +198 -0
- package/dist/web/security.js +475 -0
- package/dist/web/signin.js +246 -0
- package/package.json +67 -32
- package/.eslintrc +0 -94
- package/.swcrc +0 -18
- package/dist/bin.js +0 -3
- package/dist/cli.js +0 -184
- package/dist/commands/createBranch.js +0 -194
- package/dist/outputCI.js +0 -59
- package/src/bin.js +0 -4
- package/src/cli.ts +0 -25
- package/src/commands/createBranch.ts +0 -28
- package/src/outputCI.ts +0 -12
- package/src-old/logs.js +0 -323
- package/src-old/md.js +0 -191
- package/src-old/release-table.js +0 -60
- package/src-old/set-version.js +0 -614
- package/src-old/utils.js +0 -15
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The shapes a workspace request and its record take, and the constants they carry.
|
|
4
|
+
*
|
|
5
|
+
* Tier 0: this module imports nothing from `core/lifecycle`, which is what makes it the leaf
|
|
6
|
+
* the other nineteen can reach.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.tuning = exports.PUBLISH_PROOF_PAUSE = exports.PUBLISH_PROOF_TRIES = exports.KUBERNETES_UNSUPPORTED = exports.BILLABLE_DISTRIBUTIONS = exports.PRIVILEGED_CREATE_FIELDS = exports.CREATE_POLICY_KEY = exports.UPGRADE_FROM_KEY = exports.LAST_BACKUP_KEY = exports.DESTROY_POLICY_KEY = exports.STATE_ACTIONS = exports.ESSENTIAL_SERVICES = exports.TRANSIENT_STATES = exports.PRESET_LINKS = exports.LOOPBACK_BINDS = exports.BROWSER_HOST_PARAM = exports.BILLABLE_CONTEXT_PREFIXES = exports.INTERACTIVE_LOCK_WAIT = void 0;
|
|
10
|
+
exports.createReq = createReq;
|
|
11
|
+
exports.endpointString = endpointString;
|
|
12
|
+
exports.kubeTls = kubeTls;
|
|
13
|
+
/**
|
|
14
|
+
* How long an INTERACTIVE mutator waits for the repro lock.
|
|
15
|
+
*
|
|
16
|
+
* The lock's own default is 900s, right for a create or a restore queued behind
|
|
17
|
+
* another -- and wrong for a button: nobody wants a Stop click to hang for fifteen
|
|
18
|
+
* minutes rather than say "something else is working on this".
|
|
19
|
+
*/
|
|
20
|
+
exports.INTERACTIVE_LOCK_WAIT = 60.0;
|
|
21
|
+
/**
|
|
22
|
+
* Context-name shapes that identify a managed cluster without asking anything.
|
|
23
|
+
*
|
|
24
|
+
* `aws eks update-kubeconfig` writes the ARN and `gcloud container clusters
|
|
25
|
+
* get-credentials` writes `gke_<project>_<zone>_<name>`, so both name their own
|
|
26
|
+
* service. AKS is NOT here and cannot be: `az aks get-credentials` writes the bare
|
|
27
|
+
* cluster name, indistinguishable from a kind or k3s context -- so an AKS default is
|
|
28
|
+
* missed rather than guessed at, and a guess that called someone's k3s billable would
|
|
29
|
+
* be the worse error of the two.
|
|
30
|
+
*/
|
|
31
|
+
exports.BILLABLE_CONTEXT_PREFIXES = Object.freeze(['arn:aws:eks:', 'gke_']);
|
|
32
|
+
/** A request with the established defaults filled in. */
|
|
33
|
+
function createReq(values) {
|
|
34
|
+
return {
|
|
35
|
+
preset: 'default',
|
|
36
|
+
name: '',
|
|
37
|
+
port: 0,
|
|
38
|
+
rootUrl: '',
|
|
39
|
+
bind: '',
|
|
40
|
+
rcImage: '',
|
|
41
|
+
mongo: '',
|
|
42
|
+
regToken: '',
|
|
43
|
+
license: '',
|
|
44
|
+
params: {},
|
|
45
|
+
seed: false,
|
|
46
|
+
seedHere: false,
|
|
47
|
+
seedProfile: 'small',
|
|
48
|
+
seedScenarios: [],
|
|
49
|
+
seedHistoryDays: null,
|
|
50
|
+
pin: false,
|
|
51
|
+
wait: false,
|
|
52
|
+
offline: false,
|
|
53
|
+
noPull: false,
|
|
54
|
+
fresh: false,
|
|
55
|
+
force: false,
|
|
56
|
+
monitor: false,
|
|
57
|
+
stats: false,
|
|
58
|
+
runtime: '',
|
|
59
|
+
deployment: '',
|
|
60
|
+
replicas: 0,
|
|
61
|
+
context: '',
|
|
62
|
+
mongoOperator: false,
|
|
63
|
+
https: false,
|
|
64
|
+
domain: '',
|
|
65
|
+
acmeEmail: '',
|
|
66
|
+
acmeStaging: false,
|
|
67
|
+
acmeChallenge: 'tlsalpn',
|
|
68
|
+
acmeDnsProvider: '',
|
|
69
|
+
ingressClass: '',
|
|
70
|
+
env: {},
|
|
71
|
+
actor: '',
|
|
72
|
+
exactName: false,
|
|
73
|
+
bindPublic: false,
|
|
74
|
+
bringBack: false,
|
|
75
|
+
...values,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Presets that hand the BROWSER a hostname, and the `--set` param that carries it.
|
|
80
|
+
*
|
|
81
|
+
* Each default names THIS machine -- `localhost:8081`, `keycloak:8085` -- which is right
|
|
82
|
+
* on a laptop and wrong on every shared install, where it names the visitor's own
|
|
83
|
+
* machine instead. The value is not the container network's business; it is whatever the
|
|
84
|
+
* person typing actually uses.
|
|
85
|
+
*/
|
|
86
|
+
exports.BROWSER_HOST_PARAM = Object.freeze({
|
|
87
|
+
saml: 'idp_host',
|
|
88
|
+
oidc: 'idp_host',
|
|
89
|
+
s3_minio: 's3_host',
|
|
90
|
+
});
|
|
91
|
+
/** Binds from which nothing off this machine can reach a published port. */
|
|
92
|
+
exports.LOOPBACK_BINDS = Object.freeze([
|
|
93
|
+
'127.0.0.1',
|
|
94
|
+
'localhost',
|
|
95
|
+
'::1',
|
|
96
|
+
'',
|
|
97
|
+
]);
|
|
98
|
+
/**
|
|
99
|
+
* Preset sidecar links to surface on the dashboard: preset -> [label, index into its ports].
|
|
100
|
+
* The ports are the workspace's own (`record.sidePortsOf` over the registry), so a link never
|
|
101
|
+
* drifts from what the workspace publishes.
|
|
102
|
+
*/
|
|
103
|
+
exports.PRESET_LINKS = Object.freeze({
|
|
104
|
+
email: [['Mailpit', 0]],
|
|
105
|
+
s3_minio: [
|
|
106
|
+
['MinIO console', 1],
|
|
107
|
+
['MinIO API', 0],
|
|
108
|
+
],
|
|
109
|
+
saml: [['Keycloak', 0]],
|
|
110
|
+
oidc: [['Keycloak', 0]],
|
|
111
|
+
livechat: [['Widget site', 0]],
|
|
112
|
+
ldap: [['phpLDAPadmin', 0]],
|
|
113
|
+
// No static link: the webhook inbox is linked from the record (`notes.inboxUrl`), because
|
|
114
|
+
// the receiver chose its session's id and its root page would open a new, empty one. The
|
|
115
|
+
// empty list still marks the preset as having a browser side UI, which the --bind exposure
|
|
116
|
+
// warning (`create-docker`) names by membership here.
|
|
117
|
+
webhooks: [],
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* States beyond running/stopped/down that `reproState()` can hand to the UI:
|
|
121
|
+
* mid-transition or wedged rather than plainly up/stopped/gone. This is the
|
|
122
|
+
* backend->UI contract for them, so adding a state here fails loudly until the
|
|
123
|
+
* dashboard handles it.
|
|
124
|
+
*/
|
|
125
|
+
exports.TRANSIENT_STATES = Object.freeze([
|
|
126
|
+
'restarting',
|
|
127
|
+
'created',
|
|
128
|
+
'paused',
|
|
129
|
+
'dead',
|
|
130
|
+
]);
|
|
131
|
+
/**
|
|
132
|
+
* The services whose absence makes a "running" workspace a lie.
|
|
133
|
+
*
|
|
134
|
+
* Rocket.Chat serves /api/info with no database behind it -- measured: /api/info 200,
|
|
135
|
+
* login 000 after 15s, `ready` exit 0, `list` running, detail health "healthy", and the
|
|
136
|
+
* truth sitting in the same payload's containers array as ("mongodb", "exited").
|
|
137
|
+
*
|
|
138
|
+
* DELIBERATELY JUST THE DATABASE: a stopped Mailpit or phpLDAPadmin is a side service a
|
|
139
|
+
* person can live without.
|
|
140
|
+
*/
|
|
141
|
+
exports.ESSENTIAL_SERVICES = Object.freeze(['mongodb']);
|
|
142
|
+
/** Actions `setState` understands. One tuple, so validator and message cannot drift. */
|
|
143
|
+
exports.STATE_ACTIONS = Object.freeze(['start', 'stop', 'restart']);
|
|
144
|
+
/**
|
|
145
|
+
* Who may destroy -- and, in the GUI, change at all -- a workspace somebody else owns.
|
|
146
|
+
* `owner` is the default: the guardrail was "confirms first, naming the owner". `anyone`
|
|
147
|
+
* restores the earlier behaviour, for a team that would rather share every workspace.
|
|
148
|
+
*/
|
|
149
|
+
exports.DESTROY_POLICY_KEY = 'gui.destroy_policy';
|
|
150
|
+
/**
|
|
151
|
+
* Where `upgrade` records the automatic pre-upgrade bundle, so a rollback finds it, and the
|
|
152
|
+
* version it upgraded from. Here rather than in `upgrade`, because the detail payload reads
|
|
153
|
+
* both to say whether a rollback can be made, and `upgrade` sits above it.
|
|
154
|
+
*/
|
|
155
|
+
exports.LAST_BACKUP_KEY = 'last_upgrade_backup';
|
|
156
|
+
exports.UPGRADE_FROM_KEY = 'upgraded_from';
|
|
157
|
+
/**
|
|
158
|
+
* Who may set the create fields that decide what CODE runs and where it LISTENS.
|
|
159
|
+
*
|
|
160
|
+
* DEFAULT: anyone who may create at all, which is member and up. Set it to `admin` to
|
|
161
|
+
* narrow it. A member can already create workspaces and tear them down WITH their data;
|
|
162
|
+
* "you may destroy Maria's repro but not choose which interface your own listens on" is
|
|
163
|
+
* not a security boundary, it is an inconsistent ladder.
|
|
164
|
+
*/
|
|
165
|
+
exports.CREATE_POLICY_KEY = 'gui.create_policy';
|
|
166
|
+
/**
|
|
167
|
+
* The fields CREATE_POLICY_KEY governs. Named here rather than inline so the check and
|
|
168
|
+
* the message cannot drift apart -- and snake_case because this tuple must be identical to
|
|
169
|
+
* the established one AND equal to what `/api/settings` advertises.
|
|
170
|
+
*/
|
|
171
|
+
exports.PRIVILEGED_CREATE_FIELDS = Object.freeze([
|
|
172
|
+
'rc_image',
|
|
173
|
+
'reg_token',
|
|
174
|
+
'bind',
|
|
175
|
+
'context',
|
|
176
|
+
// An Enterprise license decides what the workspace is allowed to do, as a registration
|
|
177
|
+
// token does: the same policy governs it.
|
|
178
|
+
'license',
|
|
179
|
+
]);
|
|
180
|
+
/**
|
|
181
|
+
* Distributions where a workspace costs money for as long as it exists, and so where
|
|
182
|
+
* reaching it only by port-forward is a waste rather than a choice. Named here rather
|
|
183
|
+
* than reusing `cluster.BILLABLE` because that one prices a cluster and this one warns
|
|
184
|
+
* about a workspace.
|
|
185
|
+
*/
|
|
186
|
+
exports.BILLABLE_DISTRIBUTIONS = Object.freeze(['eks', 'gke', 'aks']);
|
|
187
|
+
/**
|
|
188
|
+
* What `up` accepts on Compose and cannot honour on Kubernetes, with the reason.
|
|
189
|
+
*
|
|
190
|
+
* Each of these was ACCEPTED and silently dropped: the create succeeded, said nothing,
|
|
191
|
+
* and produced a workspace that was not what was asked for. A refusal that names the
|
|
192
|
+
* missing thing is worth more than a create that quietly does less.
|
|
193
|
+
*
|
|
194
|
+
* `https` and `domain` have LEFT this list: the chart's own Ingress template builds the
|
|
195
|
+
* Ingress, cert-manager issues from a `ca` ClusterIssuer backed by houston's CA, and the
|
|
196
|
+
* edge passes the name through by SNI. What refuses instead is
|
|
197
|
+
* `kubernetesTlsPlan`, per cluster.
|
|
198
|
+
*/
|
|
199
|
+
exports.KUBERNETES_UNSUPPORTED = Object.freeze([
|
|
200
|
+
[
|
|
201
|
+
'fresh',
|
|
202
|
+
"--fresh means DELETE this workspace's data, and the Kubernetes path keeps the " +
|
|
203
|
+
'PersistentVolumeClaim — use `houston down --name <n> --volumes` first, which does ' +
|
|
204
|
+
'delete it',
|
|
205
|
+
],
|
|
206
|
+
]);
|
|
207
|
+
/** An endpoint as text: the `<address>:<port>` a passthrough route carries. */
|
|
208
|
+
function endpointString(endpoint) {
|
|
209
|
+
return `${endpoint.address}:${String(endpoint.port)}`;
|
|
210
|
+
}
|
|
211
|
+
/** The `KubeTls` defaults, since a TypeScript interface has no field initialisers. */
|
|
212
|
+
function kubeTls(values) {
|
|
213
|
+
return { context: '', issuer: null, clusterOwns443: false, ...values };
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* How long the publish proof waits for the route to be LIVE, not merely written.
|
|
217
|
+
*
|
|
218
|
+
* Found by running it: the check fired on a chain that was completely correct and
|
|
219
|
+
* reported "answered with a proxy's own default certificate", because a route file
|
|
220
|
+
* appearing and Traefik's file provider having reloaded it are a second apart.
|
|
221
|
+
*/
|
|
222
|
+
exports.PUBLISH_PROOF_TRIES = 8;
|
|
223
|
+
exports.PUBLISH_PROOF_PAUSE = 1.5;
|
|
224
|
+
/**
|
|
225
|
+
* How many consecutive ready-but-not-Rocket.Chat rounds before the port is called
|
|
226
|
+
* foreign. Each round costs a `workspaceReady` probe plus a socket check, so this is
|
|
227
|
+
* seconds of grace for a pod that has just passed its probe -- not a retry budget.
|
|
228
|
+
*
|
|
229
|
+
* On an object rather than a module-level number, following `k8s.tuning`: a test patches
|
|
230
|
+
* one property and every reader resolves it at call time.
|
|
231
|
+
*/
|
|
232
|
+
exports.tuning = { FOREIGN_PORT_STRIKES: 4 };
|