@rocket.chat/houston 0.27.0-next.2 → 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 -192
- package/src/bin.js +0 -4
- package/src/cli.ts +0 -25
- package/src/commands/createBranch.ts +0 -25
- 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,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
const guides_1 = require("./guides");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const registry_1 = require("./registry");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
/**
|
|
9
|
+
* A realistic-looking storefront so the widget sits in a believable page.
|
|
10
|
+
*
|
|
11
|
+
* Self-contained (inline CSS, emoji "product images") -- nginx serves it as-is. The
|
|
12
|
+
* established text VERBATIM, because this string is written to disk in the workspace and
|
|
13
|
+
* must be the bytes earlier releases wrote. `{{ROOT_URL}}` -> the repro URL at write time
|
|
14
|
+
* (`runner.write`); `__WIDGET_PORT__` is substituted below.
|
|
15
|
+
*/
|
|
16
|
+
const WIDGET_PAGE = `<!doctype html>
|
|
17
|
+
<html lang="en">
|
|
18
|
+
<head>
|
|
19
|
+
<meta charset="utf-8">
|
|
20
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
21
|
+
<title>Acme Store — Home</title>
|
|
22
|
+
<style>
|
|
23
|
+
:root { --ink:#1f2329; --muted:#6b7280; --brand:#1d74f5; --bg:#f7f8fa; --card:#fff; --line:#e6e8eb; }
|
|
24
|
+
* { box-sizing: border-box; }
|
|
25
|
+
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); }
|
|
26
|
+
a { color: inherit; text-decoration: none; }
|
|
27
|
+
header { position: sticky; top:0; background:var(--card); border-bottom:1px solid var(--line); }
|
|
28
|
+
.bar { max-width:1080px; margin:0 auto; display:flex; align-items:center; gap:1.5rem; padding:1rem 1.25rem; }
|
|
29
|
+
.logo { font-weight:800; font-size:1.35rem; letter-spacing:-.02em; }
|
|
30
|
+
.logo span { color:var(--brand); }
|
|
31
|
+
nav { display:flex; gap:1.25rem; color:var(--muted); font-weight:500; font-size:.95rem; }
|
|
32
|
+
nav a:hover { color:var(--ink); }
|
|
33
|
+
.cart { margin-left:auto; border:1px solid var(--line); border-radius:8px; padding:.5rem .8rem; font-weight:600; font-size:.9rem; }
|
|
34
|
+
.hero { max-width:1080px; margin:0 auto; padding:3rem 1.25rem 1rem; }
|
|
35
|
+
.hero h1 { font-size:2.4rem; margin:0 0 .5rem; letter-spacing:-.03em; }
|
|
36
|
+
.hero p { color:var(--muted); font-size:1.1rem; margin:0 0 1.25rem; max-width:34rem; }
|
|
37
|
+
.btn { display:inline-block; background:var(--brand); color:#fff; padding:.7rem 1.3rem; border-radius:8px; font-weight:600; }
|
|
38
|
+
.grid { max-width:1080px; margin:1.5rem auto 4rem; padding:0 1.25rem; display:grid;
|
|
39
|
+
grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1.25rem; }
|
|
40
|
+
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
|
|
41
|
+
.thumb { font-size:3.5rem; text-align:center; padding:2rem 0; background:linear-gradient(135deg,#eef2ff,#f7f8fa); }
|
|
42
|
+
.card .body { padding:1rem; }
|
|
43
|
+
.card h3 { margin:0 0 .25rem; font-size:1rem; }
|
|
44
|
+
.card .price { color:var(--brand); font-weight:700; }
|
|
45
|
+
.card .sub { color:var(--muted); font-size:.85rem; }
|
|
46
|
+
footer { border-top:1px solid var(--line); background:var(--card); color:var(--muted); font-size:.85rem; }
|
|
47
|
+
footer div { max-width:1080px; margin:0 auto; padding:1.5rem 1.25rem; }
|
|
48
|
+
.demo { background:#fffbe6; border:1px solid #ffe58f; border-radius:8px; padding:.6rem .9rem;
|
|
49
|
+
font-size:.85rem; color:#7a5c00; max-width:1080px; margin:1rem auto 0; }
|
|
50
|
+
</style>
|
|
51
|
+
</head>
|
|
52
|
+
<body>
|
|
53
|
+
<header>
|
|
54
|
+
<div class="bar">
|
|
55
|
+
<div class="logo">Acme<span>Store</span></div>
|
|
56
|
+
<nav><a href="#">Shop</a><a href="#">Deals</a><a href="#">New</a><a href="#">Support</a></nav>
|
|
57
|
+
<div class="cart">🛒 Cart (0)</div>
|
|
58
|
+
</div>
|
|
59
|
+
</header>
|
|
60
|
+
|
|
61
|
+
<section class="hero">
|
|
62
|
+
<h1>Gear that just works.</h1>
|
|
63
|
+
<p>Free shipping over $50. Questions? Tap the chat bubble in the corner and
|
|
64
|
+
one of our agents will help you out.</p>
|
|
65
|
+
<a class="btn" href="#">Shop the sale</a>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<section class="grid">
|
|
69
|
+
<div class="card"><div class="thumb">🎧</div><div class="body"><h3>Studio Headphones</h3><div class="price">$129</div><div class="sub">Noise cancelling</div></div></div>
|
|
70
|
+
<div class="card"><div class="thumb">⌚</div><div class="body"><h3>Acme Watch 4</h3><div class="price">$199</div><div class="sub">7-day battery</div></div></div>
|
|
71
|
+
<div class="card"><div class="thumb">📷</div><div class="body"><h3>Pocket Camera</h3><div class="price">$249</div><div class="sub">4K, tiny</div></div></div>
|
|
72
|
+
<div class="card"><div class="thumb">⌨️</div><div class="body"><h3>Mech Keyboard</h3><div class="price">$89</div><div class="sub">Hot-swap</div></div></div>
|
|
73
|
+
<div class="card"><div class="thumb">🔋</div><div class="body"><h3>Power Bank</h3><div class="price">$39</div><div class="sub">20,000 mAh</div></div></div>
|
|
74
|
+
<div class="card"><div class="thumb">🖱️</div><div class="body"><h3>Wireless Mouse</h3><div class="price">$29</div><div class="sub">Silent click</div></div></div>
|
|
75
|
+
</section>
|
|
76
|
+
|
|
77
|
+
<div class="demo">houston Livechat demo — this storefront (origin
|
|
78
|
+
<code>http://localhost:__WIDGET_PORT__</code>) embeds your Rocket.Chat Livechat
|
|
79
|
+
widget cross-origin. Start a chat here, answer it in Rocket.Chat's Omnichannel area.</div>
|
|
80
|
+
|
|
81
|
+
<footer><div>© Acme Store — demo site for Rocket.Chat Omnichannel. Not a real shop.</div></footer>
|
|
82
|
+
|
|
83
|
+
<script type="text/javascript">
|
|
84
|
+
(function(w, d, s, u) {
|
|
85
|
+
w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
|
|
86
|
+
var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
|
|
87
|
+
j.async = true; j.src = u + '/rocketchat-livechat.min.js?_=' + Math.random();
|
|
88
|
+
h.parentNode.insertBefore(j, h);
|
|
89
|
+
})(window, document, 'script', '{{ROOT_URL}}/livechat');
|
|
90
|
+
</script>
|
|
91
|
+
</body>
|
|
92
|
+
</html>
|
|
93
|
+
`;
|
|
94
|
+
/** Render the static storefront with the workspace's host port for it. */
|
|
95
|
+
function widgetPage(port) {
|
|
96
|
+
return WIDGET_PAGE.split('__WIDGET_PORT__').join(String(port));
|
|
97
|
+
}
|
|
98
|
+
/** Compose service for the separate customer-site origin. */
|
|
99
|
+
function widgetService(port) {
|
|
100
|
+
return {
|
|
101
|
+
'widget-site': {
|
|
102
|
+
image: 'docker.io/nginx:alpine', // multi-arch
|
|
103
|
+
volumes: ['./livechat/index.html:/usr/share/nginx/html/index.html:ro'],
|
|
104
|
+
ports: [`${String(port)}:80`],
|
|
105
|
+
restart: 'unless-stopped',
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Rocket.Chat settings that permit and route the cross-origin widget. */
|
|
110
|
+
function livechatSettings(registration) {
|
|
111
|
+
return {
|
|
112
|
+
OVERWRITE_SETTING_Livechat_enabled: 'true',
|
|
113
|
+
// The widget calls RC from a different origin (the nginx page), so CORS must be open
|
|
114
|
+
// -- and this is exactly the knob behind "widget won't load on our site" tickets.
|
|
115
|
+
OVERWRITE_SETTING_API_Enable_CORS: 'true',
|
|
116
|
+
OVERWRITE_SETTING_API_CORS_Origin: '*',
|
|
117
|
+
// The widget embeds RC in an IFRAME. RC defaults to X-Frame-Options: sameorigin,
|
|
118
|
+
// which browsers refuse to frame from another origin ("Refused to display ... in a
|
|
119
|
+
// frame"). Dropping the restriction lets the widget load on the demo site. (Livechat
|
|
120
|
+
// allowed domains -- Livechat_AllowedDomainsList -- is empty = all origins.)
|
|
121
|
+
OVERWRITE_SETTING_Iframe_Restrict_Access: 'false',
|
|
122
|
+
// Route each visitor to any available agent (simplest).
|
|
123
|
+
OVERWRITE_SETTING_Livechat_Routing_Method: 'Auto_Selection',
|
|
124
|
+
OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_By_Email_Enabled: 'false',
|
|
125
|
+
OVERWRITE_SETTING_Livechat_registration_form: registration ? 'true' : 'false',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Operator guidance for exercising the customer and agent sides. */
|
|
129
|
+
function livechatNotes(widgetUrl) {
|
|
130
|
+
return [
|
|
131
|
+
`Customer website (widget embedded, cross-origin): ${widgetUrl}`,
|
|
132
|
+
'Built-in standalone widget (same-origin): <workspace-url>/livechat',
|
|
133
|
+
"admin is an available Omnichannel agent, assigned to the 'support'",
|
|
134
|
+
" department. Visitors see 'agents online' once you're logged into RC",
|
|
135
|
+
" (that gives you presence); answer chats in RC's Omnichannel area.",
|
|
136
|
+
'Business hours & canned responses are Enterprise features — a registration',
|
|
137
|
+
' token (--reg-token, or More options when creating) enables them, else',
|
|
138
|
+
' configure them by hand.',
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
/** The customer-site workload, page ConfigMap, and published Service. */
|
|
142
|
+
function widgetManifests(port) {
|
|
143
|
+
return (0, common_1.k8sManifests)({
|
|
144
|
+
name: 'widget-site',
|
|
145
|
+
image: 'docker.io/nginx:alpine',
|
|
146
|
+
ports: [[port, 80]],
|
|
147
|
+
files: { 'index.html': widgetPage(port) },
|
|
148
|
+
mounts: [
|
|
149
|
+
{
|
|
150
|
+
name: 'files',
|
|
151
|
+
mountPath: '/usr/share/nginx/html/index.html',
|
|
152
|
+
subPath: 'index.html',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
readiness: {
|
|
156
|
+
httpGet: { path: '/', port: 80 },
|
|
157
|
+
initialDelaySeconds: 2,
|
|
158
|
+
periodSeconds: 3,
|
|
159
|
+
failureThreshold: 30,
|
|
160
|
+
},
|
|
161
|
+
ui: { 'widget-site': [port, 80] },
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function build(params, ports) {
|
|
165
|
+
const agents = Math.max(1, (0, common_1.intParam)(params, 'agents', 1));
|
|
166
|
+
const registration = (0, common_1.truthyParam)(params, 'registration');
|
|
167
|
+
const department = (0, common_1.truthyParam)(params, 'department', true); // created by default
|
|
168
|
+
const port = (0, common_1.presetPort)('livechat', 0, ports);
|
|
169
|
+
const widgetUrl = `http://localhost:${String(port)}`;
|
|
170
|
+
return {
|
|
171
|
+
...(0, types_1.emptyPreset)('livechat'),
|
|
172
|
+
description: 'Rocket.Chat Omnichannel with the Livechat widget embedded on a ' +
|
|
173
|
+
`separate demo website (${widgetUrl}). Reproduce widget-load / CORS ` +
|
|
174
|
+
'/ routing / agent-availability tickets. Admin is the agent.',
|
|
175
|
+
env: livechatSettings(registration),
|
|
176
|
+
softEnv: [common_1.EMAIL_2FA],
|
|
177
|
+
services: widgetService(port),
|
|
178
|
+
dependsOn: ['widget-site'],
|
|
179
|
+
requiresLicense: false,
|
|
180
|
+
source: 'built-in (dynamic)',
|
|
181
|
+
files: [['livechat/index.html', widgetPage(port)]],
|
|
182
|
+
ports: [port],
|
|
183
|
+
kubernetesManifests: [widgetManifests(port)],
|
|
184
|
+
paramsHelp: {
|
|
185
|
+
agents: 'agents to create + assign to the department (default 1; admin is always an agent)',
|
|
186
|
+
registration: 'show the pre-chat registration form (default false)',
|
|
187
|
+
department: "create a 'support' department + assign the agents (default true)",
|
|
188
|
+
},
|
|
189
|
+
postReady: [
|
|
190
|
+
{
|
|
191
|
+
action: 'livechat_setup',
|
|
192
|
+
agents,
|
|
193
|
+
department: department ? 'support' : '',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
notes: livechatNotes(widgetUrl),
|
|
197
|
+
guides: [
|
|
198
|
+
(0, guides_1.guide)('livechat', {
|
|
199
|
+
summary: 'Omnichannel with the Livechat widget on a separate demo website.',
|
|
200
|
+
signIn: [
|
|
201
|
+
[
|
|
202
|
+
'admin',
|
|
203
|
+
'the Rocket.Chat password above',
|
|
204
|
+
`the Omnichannel agent${department ? ", department 'support'" : ''}`,
|
|
205
|
+
],
|
|
206
|
+
],
|
|
207
|
+
steps: [
|
|
208
|
+
"Sign in to Rocket.Chat as admin: that gives presence, so visitors see 'agents online'.",
|
|
209
|
+
'Open the customer website, or the built-in widget at <workspace-url>/livechat, and start a chat.',
|
|
210
|
+
"Answer it in Rocket.Chat's Omnichannel area.",
|
|
211
|
+
],
|
|
212
|
+
know: [
|
|
213
|
+
agents > 1 ? `${String(agents)} agents are created and assigned to the department.` : '',
|
|
214
|
+
'Business hours and canned responses are Enterprise features: a registration token (--reg-token, or Registration token under More options when creating) enables them, or configure them by hand.',
|
|
215
|
+
],
|
|
216
|
+
}),
|
|
217
|
+
],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
(0, registry_1.register)('livechat', build);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
/**
|
|
5
|
+
* Dynamic `multi-instance` preset: N Rocket.Chat instances behind Traefik, sharing one
|
|
6
|
+
* MongoDB replica set and coordinating over NATS.
|
|
7
|
+
*
|
|
8
|
+
* Reproduces horizontal-scaling tickets -- cross-instance real-time, presence, and
|
|
9
|
+
* sticky-session / websocket issues. Modelled on the official RocketChat/rocketchat-compose
|
|
10
|
+
* (compose.nats.yml + compose.traefik.yml):
|
|
11
|
+
*
|
|
12
|
+
* * Instances talk to each other over NATS (the moleculer transporter), so the legacy
|
|
13
|
+
* INSTANCE_IP DDP mesh is not used.
|
|
14
|
+
* * Traefik load-balances via its FILE provider -- a `dynamic.yml` listing the backend
|
|
15
|
+
* instances. Upstream generates that file from ROCKETCHAT_BACKEND_SERVERS with an
|
|
16
|
+
* init container; we know the instance count at build time, so we generate it
|
|
17
|
+
* directly here (no init container, no Docker-socket dependency).
|
|
18
|
+
*
|
|
19
|
+
* The heavy lifting (cloning rocketchat into rocketchat-1..N, wiring the NATS transporter,
|
|
20
|
+
* handing Traefik the published host port) happens in `compose.build`, because the RC
|
|
21
|
+
* image, env and host port are not known until `up`.
|
|
22
|
+
*
|
|
23
|
+
* Parameters (via `--set`):
|
|
24
|
+
* instances number of Rocket.Chat instances to run (default 2, clamped 2..5).
|
|
25
|
+
*/
|
|
26
|
+
const config_1 = require("../config");
|
|
27
|
+
const guides_1 = require("./guides");
|
|
28
|
+
const common_1 = require("./common");
|
|
29
|
+
const registry_1 = require("./registry");
|
|
30
|
+
const types_1 = require("./types");
|
|
31
|
+
// Pinned to match the official rocketchat-compose defaults (multi-arch; verify with
|
|
32
|
+
// `docker manifest inspect` before release, as with the Mongo images). Traefik is
|
|
33
|
+
// `config.TRAEFIK_TAG`, shared with the HTTPS edge.
|
|
34
|
+
const NATS_TAG = '2.11-alpine';
|
|
35
|
+
/**
|
|
36
|
+
* Traefik file-provider config: one load-balancer service fronting the N instances, with
|
|
37
|
+
* a sticky cookie so a client's websocket (DDP) stays pinned to one instance instead of
|
|
38
|
+
* being bounced mid-session.
|
|
39
|
+
*/
|
|
40
|
+
function dynamicConfig(n) {
|
|
41
|
+
const servers = [];
|
|
42
|
+
for (let i = 1; i <= n; i += 1)
|
|
43
|
+
servers.push(` - url: "http://rocketchat-${String(i)}:3000"`);
|
|
44
|
+
return ('# Generated by houston. Do not edit by hand -- re-run `houston up`.\n' +
|
|
45
|
+
'# Traefik file provider: load-balance across the rocketchat-1..N instances.\n' +
|
|
46
|
+
'http:\n' +
|
|
47
|
+
' routers:\n' +
|
|
48
|
+
' rocketchat:\n' +
|
|
49
|
+
' rule: "PathPrefix(`/`)"\n' +
|
|
50
|
+
' entryPoints: [web]\n' +
|
|
51
|
+
' service: rocketchat\n' +
|
|
52
|
+
' services:\n' +
|
|
53
|
+
' rocketchat:\n' +
|
|
54
|
+
' loadBalancer:\n' +
|
|
55
|
+
' healthCheck:\n' + // only route to instances serving /api/info
|
|
56
|
+
' path: /api/info\n' +
|
|
57
|
+
' interval: "10s"\n' +
|
|
58
|
+
' timeout: "5s"\n' +
|
|
59
|
+
' sticky:\n' +
|
|
60
|
+
' cookie:\n' +
|
|
61
|
+
' name: rc_lb\n' +
|
|
62
|
+
' servers:\n' +
|
|
63
|
+
`${servers.join('\n')}\n`);
|
|
64
|
+
}
|
|
65
|
+
function build(params) {
|
|
66
|
+
const instances = Math.max(2, Math.min(5, (0, common_1.intParam)(params, 'instances', 2)));
|
|
67
|
+
const services = {
|
|
68
|
+
// Inter-instance message broker (presence, notifications, streaming).
|
|
69
|
+
nats: {
|
|
70
|
+
image: `docker.io/nats:${NATS_TAG}`,
|
|
71
|
+
restart: 'unless-stopped',
|
|
72
|
+
command: ['--http_port', '8222'],
|
|
73
|
+
},
|
|
74
|
+
// Reverse proxy / load balancer. File provider reads the generated dynamic.yml
|
|
75
|
+
// (mounted below); compose.build injects the published host port as `<host>:80` via
|
|
76
|
+
// entry_service.
|
|
77
|
+
traefik: {
|
|
78
|
+
image: `docker.io/traefik:${config_1.TRAEFIK_TAG}`,
|
|
79
|
+
restart: 'unless-stopped',
|
|
80
|
+
command: [
|
|
81
|
+
'--providers.file.filename=/etc/traefik/dynamic.yml',
|
|
82
|
+
'--providers.file.watch=true',
|
|
83
|
+
'--entryPoints.web.address=:80',
|
|
84
|
+
],
|
|
85
|
+
volumes: ['./traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro'],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
...(0, types_1.emptyPreset)('multi-instance'),
|
|
90
|
+
description: `${String(instances)} Rocket.Chat instances behind Traefik, sharing one Mongo ` +
|
|
91
|
+
'replica set and NATS. Reproduce horizontal-scaling / real-time-across-' +
|
|
92
|
+
'instances tickets.',
|
|
93
|
+
env: {}, // per-instance env (TRANSPORTER) is added by compose.build
|
|
94
|
+
services,
|
|
95
|
+
dependsOn: ['nats'], // every instance also depends on mongo (added by compose)
|
|
96
|
+
instances, // tells compose.build to clone rocketchat-1..N
|
|
97
|
+
entryService: 'traefik', // tells compose.build to hand the host port to Traefik
|
|
98
|
+
requiresLicense: false,
|
|
99
|
+
source: 'built-in (dynamic)',
|
|
100
|
+
files: [['traefik/dynamic.yml', dynamicConfig(instances)]],
|
|
101
|
+
paramsHelp: { instances: 'number of Rocket.Chat instances (default 2, max 5)' },
|
|
102
|
+
guides: [
|
|
103
|
+
(0, guides_1.guide)('multi-instance', {
|
|
104
|
+
summary: `${String(instances)} Rocket.Chat instances behind one load balancer, with NATS between them.`,
|
|
105
|
+
steps: [
|
|
106
|
+
'Verify the mesh, every connected instance, in a shell on the machine running houston: houston api --name <name> GET /api/v1/instances.get (one a restart replaced stays listed a while).',
|
|
107
|
+
'Open two instance URLs (listed above) in separate browsers and post in one.',
|
|
108
|
+
],
|
|
109
|
+
know: [
|
|
110
|
+
'Cross-instance real-time needs an Enterprise license (its scalability module): without one, a message posted on one instance shows on the others only after a reload. Add one when creating (--license, or the Enterprise license field), or in Rocket.Chat under Workspace > Subscription.',
|
|
111
|
+
],
|
|
112
|
+
}),
|
|
113
|
+
],
|
|
114
|
+
notes: [
|
|
115
|
+
'Verify the mesh (lists every connected instance; one a restart replaced stays listed a while):',
|
|
116
|
+
' houston api --name <name> GET /api/v1/instances.get',
|
|
117
|
+
'Cross-instance real-time needs an Enterprise license (its scalability module): without one,',
|
|
118
|
+
' a message posted on one instance shows on the others only after a reload. Add one with',
|
|
119
|
+
' `--license` or in Rocket.Chat under Workspace > Subscription, then open two instance URLs',
|
|
120
|
+
' (shown above) in separate browsers and post in one.',
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
(0, registry_1.register)('multi-instance', build);
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.build = build;
|
|
37
|
+
const guides_1 = require("./guides");
|
|
38
|
+
const common_1 = require("./common");
|
|
39
|
+
const keycloak = __importStar(require("./keycloak"));
|
|
40
|
+
const registry_1 = require("./registry");
|
|
41
|
+
const types_1 = require("./types");
|
|
42
|
+
const KC_REALM = keycloak.REALM;
|
|
43
|
+
/** Resolvable from RC (compose DNS) AND the browser (/etc/hosts). */
|
|
44
|
+
const KC_HOST = 'keycloak';
|
|
45
|
+
/** The preset itself: what it is called, what it needs, and what `up` must do after. */
|
|
46
|
+
function oidcPreset(env, idpHost, settings, services, users, prefix, kcPort) {
|
|
47
|
+
const realm = keycloak.realmJson([keycloak.oidcClient(idpHost, kcPort)], users, prefix);
|
|
48
|
+
return {
|
|
49
|
+
...(0, types_1.emptyPreset)('oidc'),
|
|
50
|
+
description: `Keycloak OIDC IdP (OpenID Connect) with ${String(users)} users ${prefix}user1..${prefix}user` +
|
|
51
|
+
`${String(users)} (password=username). RC logs in via Custom OAuth (popup). ` +
|
|
52
|
+
`Click 'Keycloak (OIDC)', sign in as ${prefix}user1/${prefix}user1. ` +
|
|
53
|
+
'See the note printed on `up` for how the browser reaches the IdP.',
|
|
54
|
+
env,
|
|
55
|
+
softEnv: [common_1.EMAIL_2FA],
|
|
56
|
+
services,
|
|
57
|
+
dependsOn: ['keycloak'],
|
|
58
|
+
requiresLicense: false,
|
|
59
|
+
source: 'built-in (dynamic)',
|
|
60
|
+
files: [['oidc/keycloak-realm.json', realm]],
|
|
61
|
+
// The same Keycloak as native resources. One Preset carries both renderings because
|
|
62
|
+
// the intent is identical either way -- see `keycloak.manifests`.
|
|
63
|
+
kubernetesManifests: [keycloak.manifests(realm, kcPort, kcPort)],
|
|
64
|
+
paramsHelp: {
|
|
65
|
+
users: 'number of Keycloak test users (default 5)',
|
|
66
|
+
idp_host: 'hostname BOTH your browser and Rocket.Chat reach ' +
|
|
67
|
+
"Keycloak on (default 'keycloak', which needs a hosts entry and works only for a " +
|
|
68
|
+
'browser on the machine running houston; from another computer create the ' +
|
|
69
|
+
'workspace with HTTPS on a domain instead)',
|
|
70
|
+
},
|
|
71
|
+
ports: [kcPort],
|
|
72
|
+
postReady: [
|
|
73
|
+
{ action: 'keycloak_master_ssl_off', service: 'keycloak', port: kcPort },
|
|
74
|
+
// Create the Custom OAuth provider and configure it (cannot be done via env, since
|
|
75
|
+
// the provider's settings do not exist until it is created).
|
|
76
|
+
{
|
|
77
|
+
action: 'create_oauth_provider',
|
|
78
|
+
name: keycloak.capitalize(keycloak.OIDC_PROVIDER),
|
|
79
|
+
settings,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
guides: [
|
|
83
|
+
(0, guides_1.guide)('oidc', {
|
|
84
|
+
summary: `Keycloak as an OpenID Connect provider with ${String(users)} users.`,
|
|
85
|
+
setup: idpHost === KC_HOST
|
|
86
|
+
? {
|
|
87
|
+
why: keycloak.HOSTS_ENTRY_WHY,
|
|
88
|
+
line: `127.0.0.1 ${KC_HOST}`,
|
|
89
|
+
}
|
|
90
|
+
: null,
|
|
91
|
+
signIn: [
|
|
92
|
+
[
|
|
93
|
+
`${prefix}user1 … ${prefix}user${String(users)}`,
|
|
94
|
+
'same as the name',
|
|
95
|
+
"press 'Keycloak (OIDC)' on the login page",
|
|
96
|
+
],
|
|
97
|
+
['admin', 'admin', `Keycloak admin console, realm '${KC_REALM}'`],
|
|
98
|
+
],
|
|
99
|
+
steps: [
|
|
100
|
+
idpHost === KC_HOST ? 'Add the hosts entry above.' : '',
|
|
101
|
+
`On the login page press 'Keycloak (OIDC)' and sign in as ${prefix}user1 / ${prefix}user1.`,
|
|
102
|
+
],
|
|
103
|
+
know: [
|
|
104
|
+
idpHost === KC_HOST
|
|
105
|
+
? `The hosts entry works only for a browser on the machine running houston. ${keycloak.FROM_ANOTHER_COMPUTER}`
|
|
106
|
+
: `Your browser and Rocket.Chat both reach Keycloak at http://${idpHost}:${String(kcPort)}; the workspace must be bound wide enough for both (--bind 0.0.0.0).`,
|
|
107
|
+
],
|
|
108
|
+
}),
|
|
109
|
+
],
|
|
110
|
+
notes: [
|
|
111
|
+
...(idpHost === KC_HOST
|
|
112
|
+
? [
|
|
113
|
+
'OIDC needs one host entry so your browser can reach Keycloak at the',
|
|
114
|
+
"same URL RC's backend uses. Add this line to /etc/hosts (needs sudo):",
|
|
115
|
+
' 127.0.0.1 keycloak',
|
|
116
|
+
' It points at the machine running houston, so the browser has to be on it.',
|
|
117
|
+
keycloak.FROM_ANOTHER_COMPUTER,
|
|
118
|
+
`Then log in via 'Keycloak (OIDC)' as ${prefix}user1 / ${prefix}user1.`,
|
|
119
|
+
]
|
|
120
|
+
: [
|
|
121
|
+
`Your browser AND Rocket.Chat both reach Keycloak at http://${idpHost}:${String(kcPort)}.`,
|
|
122
|
+
' No hosts entry is needed, but the workspace must be bound wide enough',
|
|
123
|
+
' for both to get there (`--bind 0.0.0.0`).',
|
|
124
|
+
`Log in via 'Keycloak (OIDC)' as ${prefix}user1 / ${prefix}user1.`,
|
|
125
|
+
]),
|
|
126
|
+
`Keycloak admin console: http://${idpHost}:${String(kcPort)} (admin/admin, realm '${KC_REALM}').`,
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function build(params, ports) {
|
|
131
|
+
const users = (0, common_1.intParam)(params, 'users', 5);
|
|
132
|
+
// Distinct from SAML's, so both presets can run at once (8080 is too commonly occupied --
|
|
133
|
+
// e.g. other local Keycloaks).
|
|
134
|
+
const kcPort = (0, common_1.presetPort)('oidc', 0, ports);
|
|
135
|
+
// ONE hostname for two consumers -- the browser (authorize) and RC's backend
|
|
136
|
+
// (token/userinfo) -- which is the gotcha this preset's doc comment opens with. The
|
|
137
|
+
// default `keycloak` satisfies the backend over compose DNS and needs a hosts entry for
|
|
138
|
+
// the browser, and that entry (`127.0.0.1 keycloak`) is only correct when the browser
|
|
139
|
+
// is on THIS machine. It is not, on the shared-box deployment this tool now supports,
|
|
140
|
+
// so the popup opened a name that did not resolve and showed the user a blank window --
|
|
141
|
+
// reported as "the OIDC page shows nothing".
|
|
142
|
+
//
|
|
143
|
+
// Setting this to the host's own address satisfies BOTH and removes the hosts entry
|
|
144
|
+
// entirely: the browser reaches the published port, and RC's container reaches the same
|
|
145
|
+
// address over the bridge. It needs `--bind 0.0.0.0`, because a loopback-bound port is
|
|
146
|
+
// not reachable from either.
|
|
147
|
+
const idpHost = (0, common_1.strParam)(params, 'idp_host', KC_HOST);
|
|
148
|
+
const realmBase = `http://${idpHost}:${String(kcPort)}/realms/${KC_REALM}`;
|
|
149
|
+
// Accounts_OAuth_Custom-Keycloak
|
|
150
|
+
const setting = `Accounts_OAuth_Custom-${keycloak.capitalize(keycloak.OIDC_PROVIDER)}`;
|
|
151
|
+
const services = {
|
|
152
|
+
// http_port: listen on the same port we publish, so the single `keycloak:8085` URL
|
|
153
|
+
// works from the browser (via /etc/hosts) and RC's backend (via the compose network)
|
|
154
|
+
// identically.
|
|
155
|
+
keycloak: keycloak.service('./oidc/keycloak-realm.json', kcPort, kcPort),
|
|
156
|
+
};
|
|
157
|
+
const [env, settings] = keycloak.oauthSettings(realmBase, setting);
|
|
158
|
+
const prefix = (0, common_1.strParam)(params, keycloak.USER_PREFIX_PARAM, '');
|
|
159
|
+
return oidcPreset(env, idpHost, settings, services, users, prefix, kcPort);
|
|
160
|
+
}
|
|
161
|
+
(0, registry_1.register)('oidc', build);
|