@rocket.chat/houston 2.1.8 → 2.1.9

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/README.md CHANGED
@@ -94,9 +94,10 @@ Every command explains itself with `--help`, for example `houston up --help`.
94
94
 
95
95
  | Guide | Read it when |
96
96
  |---|---|
97
- | [User guide](data/docs/guide.md) | you need a preset, sample data, a customer's settings, backups and upgrades, HTTPS, monitoring, a load test or the REST API |
97
+ | [User guide](data/docs/guide.md) | you need a preset, sample data, a customer's settings, backups and upgrades, HTTPS, monitoring or the REST API |
98
98
  | [Encrypted conversations (E2EE)](data/docs/e2ee.md) | the ticket concerns encrypted DMs, rooms or files |
99
99
  | [Voice calls](data/docs/voice.md) | the ticket concerns Voice calls or the SIP integration |
100
+ | [Load testing and capacity](data/docs/loadtest.md) | the ticket is about slowness under load, or how much load a server takes |
100
101
  | [Kubernetes](data/docs/kubernetes.md) | the ticket needs Kubernetes, or Rocket.Chat as microservices |
101
102
  | [Rocket.Chat on EKS](data/docs/eks.md) | the ticket needs a real cloud cluster. A cluster costs money by the hour, so read the guide before you create one. `houston cluster guide` prints it, and `houston cluster overview` shows what is billing |
102
103
  | [Web GUI](data/docs/gui.md) | you prefer a browser, or you share one machine with your team, signing in with Okta or a password |
@@ -23,7 +23,7 @@ On a shared machine, set `HOUSTON_USER=<account>` so the audit log names who ran
23
23
  `skill` take `--json`; `capabilities` always prints JSON. Every reply is one envelope:
24
24
 
25
25
  ```json
26
- {"schema":"houston.info.v1","contract":2,"houston_version":"2.1.8",
26
+ {"schema":"houston.info.v1","contract":2,"houston_version":"2.1.9",
27
27
  "generated_at":"…","ok":true,"data":{…},"warnings":[],"error":null}
28
28
  ```
29
29
 
@@ -10,7 +10,7 @@ Every command also explains itself: `houston <command> --help`.
10
10
  [Sample data](#sample-data) · [A customer's settings](#a-customers-settings) ·
11
11
  [Settings and environment variables](#settings-and-environment-variables) ·
12
12
  [Backup, restore, upgrade](#backup-restore-upgrade) · [HTTPS](#https) ·
13
- [Monitoring](#monitoring) · [Load testing](#load-testing-and-capacity) ·
13
+ [Monitoring](#monitoring) · [Load testing](loadtest.md) ·
14
14
  [REST API](#rest-api) · [Versions and MongoDB](#versions-and-mongodb) ·
15
15
  [Where state lives](#where-state-lives)
16
16
 
@@ -24,7 +24,7 @@ Every command also explains itself: `houston <command> --help`.
24
24
  | inspect | `list` `info` `logs` `ready` `stats` |
25
25
  | settings | `use` `config` `env` |
26
26
  | data | `seed` `config-import` `backup` `backups` `restore` `upgrade` |
27
- | performance (Docker only) | `loadtest` `capacity` |
27
+ | performance (Docker only) | `loadtest` `capacity` ([guide](loadtest.md)) |
28
28
  | REST | `token` `api` `pat` |
29
29
  | web GUI and accounts | `serve` `users` `audit` `chown` |
30
30
  | HTTPS | `edge` `trust-ca` `tls-status` |
@@ -243,9 +243,22 @@ On Docker it goes into `.license.env` in the workspace (mode 0600), which the co
243
243
  names and never holds; on Kubernetes into a Secret the pod reads it from. `env`, the GUI and
244
244
  `houston.log` never show it; backups leave it out, and `up --force` keeps it.
245
245
 
246
- Rocket.Chat 8.8 and 8.9 announce that LDAP, SAML and Custom OAuth login will need a Premium
247
- plan from 9.0. On Rocket.Chat 9 and later, `up` warns when an `ldap`, `saml` or `oidc`
248
- workspace has neither `--license` nor `--reg-token`.
246
+ Rocket.Chat 9.0 and later refuse LDAP, SAML and Custom OAuth login without a Premium plan: a
247
+ license carrying `ldap-enterprise`, `saml-enterprise` or `oauth-enterprise` respectively. On
248
+ Rocket.Chat 9 and later, `up` warns when an `ldap`, `saml` or `oidc` workspace has neither
249
+ `--license` nor `--reg-token`. Without one, the `oidc` preset cannot create its provider and
250
+ says so in Rocket.Chat's words ("This is an enterprise feature"). A license applied later in
251
+ Rocket.Chat (Administration → Subscription) takes effect at once; `houston ready --name <name>`
252
+ then finishes the preset's setup (in the GUI: take it down, then bring it up), and asks
253
+ Rocket.Chat which license it now holds. `houston info` and the GUI's notes say all of this for
254
+ as long as it applies, from Rocket.Chat's last answer once there is one.
255
+
256
+ Rocket.Chat 9.0 also signs in through Custom OAuth (the `oidc` preset, and `ldap --set
257
+ idp=oidc`) only over HTTPS: add `--https` (a browser on this machine, after `houston trust-ca`)
258
+ or `--domain <name>`. On 9.0.x that sign-in still cannot finish through houston's HTTPS: 9.0
259
+ joins the full token address houston gives it onto the provider URL and the callback answers 500
260
+ (fixed in 9.1.0). Test it on 8.9, on 9.1.0 or later, or behind a TLS proxy of your own (`--root-url
261
+ https://<name>`). `houston info` and the GUI's notes say which applies to a workspace.
249
262
 
250
263
  ---
251
264
 
@@ -536,46 +549,6 @@ A bare `--root-url` uses the local Grafana URL; a customer proxy must route `/gr
536
549
 
537
550
  ---
538
551
 
539
- ## Load testing and capacity
540
-
541
- **Docker workspaces only.** On Kubernetes the traffic would go through one
542
- `kubectl port-forward`, which saturates long before Rocket.Chat does, so the numbers
543
- would measure the forward.
544
-
545
- ```bash
546
- houston loadtest --name ticket-1234 --scenario journey --vus 50 --duration 60s
547
- houston loadtest --name ticket-1234 --scenario custom --endpoint "GET /api/v1/channels.list?count=100"
548
- houston loadtest --name ticket-1234 --scenario journey --save before-fix
549
- houston loadtest --name ticket-1234 --scenario journey --compare before-fix
550
- houston capacity --name ticket-1234 --slo "p95=300ms,error=2%"
551
- ```
552
-
553
- The load comes from [k6](https://k6.io), run as a temporary container on the
554
- workspace's own network.
555
-
556
- - **Scenarios:** `journey` (a whole session, each step timed), `messages`, `login`,
557
- `read`, `mixed`, `webhook`, `badbot` and `custom`.
558
- - **Shapes:** a constant `--vus`, `--ramp 10:200`, or `--spike 10:100`, which reports
559
- how long p95 took to recover. `--stats` on a long run reports memory growth per
560
- hour, the sign of a leak.
561
- - **The customer's hardware:** `--constrain "rc=2cpu/2g,mongo=1cpu/1g"` limits the
562
- services for the run and puts back what they had afterwards. Docker cannot clear a limit, so
563
- a service that had none is given this machine's whole capacity, which is the same thing. A
564
- memory cap below what a service already uses is refused: the kernel would restart it as the
565
- test began, and the run would measure the restart.
566
- - **`--slo p95=300ms,error=1%`** makes the command fail when the target is missed, so it
567
- fits in CI.
568
- - **Diagnosis is on by default:** Rocket.Chat's event-loop lag, MongoDB's slow queries
569
- with their plans (it flags `COLLSCAN`), and when errors started, ending in a
570
- plain-language verdict.
571
-
572
- `capacity` doubles the load until the target breaks, narrows down where, and says why.
573
-
574
- **VUs are k6 workers, not Rocket.Chat accounts.** Write scenarios leave real messages
575
- in `#general`; `read` and `login` add nothing.
576
-
577
- ---
578
-
579
552
  ## REST API
580
553
 
581
554
  ```bash
@@ -0,0 +1,264 @@
1
+ # Load testing and capacity
2
+
3
+ Two commands show how a workspace behaves under load, on the customer's exact version:
4
+
5
+ - **`houston loadtest`** puts a load on the workspace for a set time. It reports how fast
6
+ Rocket.Chat answered, how many requests failed, and why it slowed down.
7
+ - **`houston capacity`** raises the load step by step until the workspace misses a target,
8
+ and tells you how much load it held.
9
+
10
+ Both work on **Docker workspaces only**, from the terminal or from the GUI.
11
+
12
+ ```bash
13
+ houston up --name ticket-1234 --version 8.9.1 --wait
14
+ houston seed --name ticket-1234 # users for the load to log in as
15
+ houston loadtest --name ticket-1234 --scenario journey --vus 20 --duration 30s
16
+ houston capacity --name ticket-1234
17
+ houston down --name ticket-1234 --volumes
18
+ ```
19
+
20
+ **Contents:** [How it works](#how-it-works) · [Scenarios](#scenarios) ·
21
+ [loadtest](#loadtest) · [Reading the result](#reading-the-result) · [capacity](#capacity) ·
22
+ [In the GUI](#in-the-gui) · [Good to know](#good-to-know)
23
+
24
+ ---
25
+
26
+ ## How it works
27
+
28
+ 1. houston starts [k6](https://k6.io), a load-testing tool, in a temporary container on the
29
+ workspace's own Docker network, so the load reaches Rocket.Chat directly.
30
+ 2. k6 runs a number of **VUs** (virtual users). Each VU repeats the scenario in a loop,
31
+ without pausing, for the whole run. A VU is a k6 worker, not a Rocket.Chat account, and it
32
+ sends far more requests than one person in a browser does.
33
+ 3. The VUs log in as the users `houston seed` made, so the load comes from several accounts.
34
+ `houston seed` makes 5 users, and `--profile standard` makes 20. With no seeded users,
35
+ every request uses the admin account.
36
+ 4. While the load runs, houston watches Rocket.Chat and MongoDB from the inside.
37
+ 5. At the end it prints the result and a short verdict, then puts the workspace back.
38
+
39
+ The first run downloads the k6 image, `grafana/k6`.
40
+
41
+ ### What a run changes, and puts back
42
+
43
+ | During the run | Why | Afterwards |
44
+ |---|---|---|
45
+ | The API rate limiter is off | otherwise Rocket.Chat refuses the load (429) and you measure the limiter | back on |
46
+ | Prometheus metrics are on | to read Rocket.Chat's event-loop lag | as it was |
47
+ | The MongoDB profiler is on | to catch queries slower than `--slowms` | as it was |
48
+ | CPU and RAM caps, with `--constrain` | to act like the customer's server | as they were (see below) |
49
+
50
+ Docker cannot remove a cap, so a service that had none gets this machine's whole CPU and
51
+ RAM afterwards, which works out the same.
52
+
53
+ They go back even when the run fails. If houston is stopped before the run ends, by Ctrl-C
54
+ or by being killed, run `houston doctor`: it lists anything left changed, and `houston
55
+ serve` puts it back when it starts.
56
+
57
+ Some things stay in the workspace: the messages the writing scenarios post in `#general`,
58
+ an access token named `houston-loadtest` on the admin account, and, after the `webhook`
59
+ scenario, an incoming integration named `houston-loadtest-hook`.
60
+
61
+ ---
62
+
63
+ ## Scenarios
64
+
65
+ | `--scenario` | Each VU, in a loop | Use it when |
66
+ |---|---|---|
67
+ | `messages` (default) | posts a message to `#general` | sending messages is slow |
68
+ | `read` | reads the last 20 messages of `#general` | opening rooms is slow |
69
+ | `login` | logs in | logins are slow, or many people log in at once |
70
+ | `mixed` | reads (60%), posts (30%) or logs in and straight out again (10%) | you want a general, realistic load |
71
+ | `journey` | logs in, lists its rooms, opens `#general`, posts, syncs; each step timed | you need to know **which part** is slow |
72
+ | `webhook` | posts an alert through an incoming webhook houston creates | a monitoring system floods a channel |
73
+ | `badbot` | reads 100 messages, lists users, lists channels, with no paging | a customer's script or bot hammers the server |
74
+ | `custom` | calls the one endpoint you name with `--endpoint` | the customer has one slow API call |
75
+
76
+ ---
77
+
78
+ ## loadtest
79
+
80
+ ```bash
81
+ # 20 VUs for 30 seconds
82
+ houston loadtest --name ticket-1234 --scenario journey --vus 20 --duration 30s
83
+
84
+ # a pass/fail target: exit 1 when it is missed, so it works in CI
85
+ houston loadtest --name ticket-1234 --scenario journey --slo "p95=500ms,error=1%"
86
+
87
+ # the customer's own slow call
88
+ houston loadtest --name ticket-1234 --scenario custom --endpoint "GET /api/v1/channels.list?count=100"
89
+
90
+ # on the customer's hardware: 2 CPUs and 2 GB for Rocket.Chat, 1 CPU and 1 GB for MongoDB
91
+ houston loadtest --name ticket-1234 --scenario messages --constrain "rc=2cpu/2g,mongo=1cpu/1g"
92
+
93
+ # a sudden burst: 10 VUs, then 100, then 10 again; says how long it took to recover
94
+ houston loadtest --name ticket-1234 --scenario read --spike 10:100 --duration 60s
95
+
96
+ # before and after a fix
97
+ houston loadtest --name ticket-1234 --scenario journey --save before-fix
98
+ houston loadtest --name ticket-1234 --scenario journey --compare before-fix
99
+ ```
100
+
101
+ | Option | What it does | Default |
102
+ |---|---|---|
103
+ | `--scenario` | the load to run ([Scenarios](#scenarios)) | `messages` |
104
+ | `--vus` | how many VUs run at once | `10` |
105
+ | `--duration` | how long the run lasts: `30s`, `2m` | `30s` |
106
+ | `--users` | how many seeded users the VUs log in as; `0` is the admin only | `10` |
107
+ | `--ramp 10:200` | grow from 10 to 200 VUs over the run, instead of a fixed `--vus` | |
108
+ | `--spike 10:100` | 10 VUs, then 100, then 10, for a third of the run each | |
109
+ | `--endpoint`, `--body` | for `custom`: the call, such as `"GET /api/v1/me"`, and a JSON body for POST | |
110
+ | `--slo` | the target the run must meet (below); missing it exits 1 | |
111
+ | `--constrain` | CPU and RAM caps for the run (below) | |
112
+ | `--diag`, `--no-diag` | the inside view: event-loop lag, slow MongoDB queries, the verdict | on |
113
+ | `--slowms` | a MongoDB query slower than this many ms counts as slow | `100` |
114
+ | `--stats` | also report each container's CPU and RAM | |
115
+ | `--live` | stream the numbers to Grafana during the run; run `houston monitor` first | |
116
+ | `--save NAME`, `--compare NAME` | keep this run under a name; compare a later run with it | |
117
+ | `--report`, `--report-path` | also write a Markdown report to attach to a ticket | |
118
+ | `--json` | print the result as JSON, for scripts | |
119
+
120
+ **`--slo`** is a list of rules joined by commas, such as `p95=500ms,error=1%,rps=100`.
121
+ `p50` `p90` `p95` `p99` `avg` `min` `max` are the longest a response may take; `error` is
122
+ the most requests that may fail, in percent; `rps` is the fewest requests per second.
123
+
124
+ **`--constrain`** caps services by name: `rc` (every Rocket.Chat container), `mongo`, or
125
+ any other service of the workspace, with CPUs, memory or both: `rc=2cpu/2g`,
126
+ `mongo=0.5cpu/512m`. A memory cap below what a service already uses is refused, because the
127
+ service would restart and the run would measure the restart.
128
+
129
+ ### Reading the result
130
+
131
+ The `journey` example above, on Rocket.Chat 8.9.1 on a 4-CPU test machine (k6's own
132
+ progress lines left out):
133
+
134
+ ```text
135
+ Load test: journey @ 20 VUs for 30s as 5 seeded users -> http://rocketchat:3000 (via k6 on 'ticket-1234''s network)
136
+
137
+ +- loadtest journey (20 VUs / 30s, 5 users) --------------+
138
+ | throughput 209.4 req/s (6340 requests) |
139
+ | latency p50 57ms p90 205ms p95 246ms p99 380ms |
140
+ | avg 95ms min 2ms max 519ms |
141
+ | errors 0.00% checks 100% ok |
142
+ | responses 2xx 6340 |
143
+ +---------------------------------------------------------+
144
+
145
+ Per-step latency:
146
+ step count p50 p95 p99
147
+ login 1268 157ms 272ms 336ms
148
+ rooms 1268 29ms 69ms 101ms
149
+ open 1268 51ms 115ms 152ms
150
+ post 1268 173ms 375ms 432ms
151
+ sync 1268 22ms 54ms 79ms
152
+
153
+ p95 over time 171ms |::... .*#- ... | 417ms (16 buckets of 2s)
154
+
155
+ RC internals during the test:
156
+ rocketchat event-loop lag peak 51ms / p99 40ms heap 895MB ddp users 0
157
+
158
+ Verdict:
159
+ - No saturation signals: p95 246ms at 209.4 req/s, 0.00% errors - the workspace has
160
+ headroom at this load.
161
+ ```
162
+
163
+ - **throughput**: requests answered per second, by all VUs together.
164
+ - **latency**: how long requests took. **p95** means 95 of every 100 requests were faster
165
+ than this. It is the number to quote, because an average hides the slow requests.
166
+ - **errors** and **responses**: the share of requests that failed, and their status codes.
167
+ 429 is a rate limit; 5xx is Rocket.Chat failing.
168
+ - **Per-step latency** (`journey`, `mixed`): the time of each step. Here `post` and `login`
169
+ are the slow ones.
170
+ - **p95 over time**: whether it stayed steady or got worse as the run went on.
171
+ - **RC internals**: Rocket.Chat's event-loop lag. houston calls it degraded when it averages
172
+ over 100 ms, and saturated when it peaks over 500 ms.
173
+ - **Verdict**: what the inside view found, one sentence each.
174
+
175
+ | The verdict says | It means |
176
+ |---|---|
177
+ | RC event loop saturated, or degraded | Rocket.Chat's Node.js process is out of CPU. More CPU or more instances help. |
178
+ | MongoDB ran N collection scans (COLLSCAN) | a query read a whole collection: likely a missing index. |
179
+ | N MongoDB queries exceeded the slow threshold | the slowest query is named, with how MongoDB ran it. |
180
+ | MongoDB, or Rocket.Chat, was the hot container | which of the two used the CPU. |
181
+ | High client latency without RC event-loop saturation | requests wait somewhere else: a CPU cap, MongoDB, or connections. |
182
+ | N% of requests failed: Nx 429, Nx 5xx, Nx 4xx, starting ~Ns into the run | how many failed, of which kind, and from when. 5xx is the server failing. 4xx in `journey` above 50 VUs per seeded user is the session limit (see [Good to know](#good-to-know)), not the server. |
183
+ | Slow spike recovery, or did not recover | after a burst, Rocket.Chat took long to catch up, or never did. |
184
+ | RAM grew ~N MB/h | with `--stats` on a long run: a possible memory leak. |
185
+ | No saturation signals | the workspace coped with this load. |
186
+
187
+ ---
188
+
189
+ ## capacity
190
+
191
+ `capacity` finds how much load the workspace holds. It runs the scenario with 10 VUs, then
192
+ 20, 40, 80 and so on, for 20 seconds each, until a step misses the target. Then it tries two
193
+ loads in between to narrow it down.
194
+
195
+ ```bash
196
+ houston capacity --name ticket-1234
197
+ houston capacity --name ticket-1234 --slo "p95=300ms,error=1%" --constrain "rc=2cpu/2g" --max 160 --report
198
+ ```
199
+
200
+ The first example, on the same machine (k6's progress lines left out):
201
+
202
+ ```text
203
+ Capacity search: journey as 5 seeded users, SLO p95=500ms,error=2% (steps of 20s)
204
+ 10 VUs 217.2 req/s p95 119ms err 0.00% PASS
205
+ 20 VUs 231.5 req/s p95 212ms err 0.00% PASS
206
+ 40 VUs 232.9 req/s p95 416ms err 0.00% PASS
207
+ 80 VUs 215.6 req/s p95 937ms err 0.00% FAIL (p95 <= 500ms (actual 937ms))
208
+ 60 VUs (bisect) 223.4 req/s p95 699ms err 0.00% FAIL (p95 <= 500ms (actual 699ms))
209
+ 50 VUs (bisect) 236.0 req/s p95 512ms err 0.00% FAIL (p95 <= 500ms (actual 512ms))
210
+
211
+ Capacity: ~40 concurrent VUs (holds at 40, breaks at 50)
212
+ why it broke: at 50 VUs: p95 <= 500ms (actual 512ms)
213
+ ```
214
+
215
+ The answer is the last load that met the target, the first that missed it, and why it
216
+ broke. Here throughput stopped growing at about 230 req/s while p95 kept rising: past that
217
+ point, more VUs only wait longer. Missing the target is the answer, not a failure, so
218
+ `capacity` exits 0. If no step misses it, the answer is `holds the SLO up to N VUs (never
219
+ breached; raise --max to push further)`.
220
+
221
+ | Option | What it does | Default |
222
+ |---|---|---|
223
+ | `--scenario` | `journey`, `messages`, `read`, `mixed`, `login` or `badbot` | `journey` |
224
+ | `--slo` | the target that counts as holding | `p95=500ms,error=2%` |
225
+ | `--start` | the first step's VUs | `10` |
226
+ | `--max` | stop doubling past this many VUs | `640` |
227
+ | `--step-duration` | how long each step runs | `20s` |
228
+ | `--users`, `--constrain`, `--report`, `--report-path`, `--json` | as for `loadtest` | |
229
+
230
+ **The number is VUs, not people.** A VU sends requests without a pause, so it is far more
231
+ traffic than one person. Use the number to compare: two versions, 2 CPUs against 4, before
232
+ and after a fix. It does not say how many people the customer's server can take.
233
+
234
+ ---
235
+
236
+ ## In the GUI
237
+
238
+ On a running Docker workspace, **Run a load test** and **Find capacity** are among the
239
+ workspace's actions, for admins, and for members on their own workspaces. The job log shows the progress, and the result
240
+ when the run ends.
241
+
242
+ The GUI offers every scenario except `webhook` and `custom`. Ramp, spike, save and
243
+ compare, and the report are in the terminal only.
244
+
245
+ ---
246
+
247
+ ## Good to know
248
+
249
+ - **Docker only.** On Kubernetes the load would pass through one `kubectl port-forward`,
250
+ which gives out long before Rocket.Chat does, so houston refuses. Reproduce on a Docker
251
+ workspace with the same version.
252
+ - **The numbers are this machine's**, not the customer's server. `--constrain` brings the
253
+ CPU and RAM closer; disks, network and the amount of data still differ.
254
+ - **A customer's amount of data:** `houston seed --scale` fills MongoDB in bulk
255
+ ([Sample data](guide.md#sample-data)). Those users cannot log in, so also run a plain
256
+ `houston seed` for the VUs.
257
+ - **`journey` with many VUs:** each VU logs in for itself, and Rocket.Chat keeps 50
258
+ sessions per user. Keep the VUs (or `capacity`'s `--max`) at or under 50 per seeded user;
259
+ above that, some steps fail with 4xx that are not the server's, and houston warns. For
260
+ more, `houston seed --profile standard` makes 20 users: use them with `--users 20`.
261
+ - **Rocket.Chat 6.x and runs back to back:** 6.x limits how fast the run's tokens can be
262
+ made, so a run started right after another can be refused with "rate-limiting token
263
+ creation … try again then". Wait a minute and run it again.
264
+ - **Files:** reports go to `~/.houston/reports/`, saved runs to `~/.houston/loadtests/`.
@@ -47,6 +47,15 @@ houston logs --name <name> --tail 100
47
47
  houston stats --name <name> # a climbing restart count means it is out of memory
48
48
  ```
49
49
 
50
+ SAML sign-in stops at Keycloak's "Invalid redirect uri": the workspace was made with
51
+ `--root-url` by houston 2.1.8 or earlier, and its Keycloak still accepts only `localhost`.
52
+ `ready` and `restart` do not change that. Rebuild it with the flags it was made with, plus
53
+ `--force`; its data is kept:
54
+
55
+ ```bash
56
+ houston up --name <name> --version <version> --preset saml --root-url <url> --force --wait
57
+ ```
58
+
50
59
  ## Rocket.Chat's own behaviour, not houston's
51
60
 
52
61
  Seen on Rocket.Chat 8.5.1, and the same with or without houston's edge in front:
@@ -94,7 +103,8 @@ Names are lowercase: `TICKET-1234` lives in namespace `houston-ticket-1234`.
94
103
  | "the ingress controller's built-in placeholder certificate" | Normal for a minute or three on a new cluster. `houston tls-status --name <name>` again; `kubectl -n houston-<name> get certificate` shows what it waits for. |
95
104
  | Let's Encrypt never validates | The name must point at the right place, port 443 open, **before** `up`. On a cloud cluster, point it at the address `houston cluster prepare --context <cluster>` prints. On Cloudflare use **DNS only**. Check with `dig +short <name> @1.1.1.1`. |
96
105
  | "something in front is terminating TLS for this name" | A proxy, CDN or another program is intercepting. `houston doctor` names a cluster holding the ports. |
97
- | Behind a tunnel or a proxy that terminates TLS (Cloudflare proxied, a load balancer) | TLS-ALPN cannot pass it. `houston config set acme.challenge http` makes Let's Encrypt validate over plain HTTP on `:80` instead; `up --domain` and `serve --domain` both use it. Send the name's HTTP to this host's `:80`. |
106
+ | Behind a proxy that terminates TLS (Cloudflare proxied, a load balancer) | TLS-ALPN cannot pass it. `houston config set acme.challenge http` makes Let's Encrypt validate over plain HTTP on `:80` instead; `up --domain` and `serve --domain` both use it. Send the name's HTTP to this host's `:80`. |
107
+ | Behind a tunnel (cloudflared) | Point the tunnel at the edge, `https://localhost:443`, with the name as its origin server name and Host header, and certificate verification off (Cloudflare: No TLS Verify): Let's Encrypt cannot reach a tunnelled host, so the edge has only its default certificate. Not `:80`, which redirects to HTTPS and loops; not Rocket.Chat's own port, where `/keycloak`, `/mailpit` and the other preset paths answer with Rocket.Chat's page. |
98
108
  | The browser warns about a local certificate | Run `houston trust-ca` once, then `houston tls-status --name <name>` says it is trusted. Phones cannot use local certificates: use `--domain`. |
99
109
  | No "Local certificate" option in the GUI | The cluster is not on this machine; houston's CA key never leaves it. Use a domain. |
100
110
 
@@ -99,8 +99,10 @@ export function buildOptions() {
99
99
  const body = total - 2;
100
100
  const third = Math.max(2, Math.floor(body / 3));
101
101
  const first = Math.max(2, body - 2 * third);
102
+ // With `stages`, k6 takes the starting VUs from `vus`. It has no top-level
103
+ // `startVUs`: that was ignored with a warning and the run began at 1 VU.
102
104
  return {
103
- startVUs: base, summaryTrendStats: TREND,
105
+ vus: base, summaryTrendStats: TREND,
104
106
  stages: [
105
107
  { duration: `${first}s`, target: base },
106
108
  { duration: "1s", target: peak },
@@ -113,7 +115,7 @@ export function buildOptions() {
113
115
  if (ramp) {
114
116
  const [start, end] = ramp.split(":").map(Number);
115
117
  return {
116
- startVUs: start, summaryTrendStats: TREND,
118
+ vus: start, summaryTrendStats: TREND,
117
119
  stages: [{ duration: __ENV.DURATION || "60s", target: end }],
118
120
  };
119
121
  }
@@ -1,4 +1,4 @@
1
- // Realistic blend: mostly reads, some posts, occasional login — with a
1
+ // Realistic blend: mostly reads, some posts, an occasional login (and logout), with a
2
2
  // step_<name> Trend per endpoint so the summary shows which call is slow.
3
3
  import http from "k6/http";
4
4
  import { check } from "k6";
@@ -12,8 +12,25 @@ const T = {
12
12
  read: new Trend("step_read", true),
13
13
  post: new Trend("step_post", true),
14
14
  login: new Trend("step_login", true),
15
+ logout: new Trend("step_logout", true),
15
16
  };
16
17
 
18
+ // Rocket.Chat keeps 50 login tokens per user and drops every older one, the
19
+ // token made before the run (that the reads and posts use) among them. Logging
20
+ // each new session straight out again keeps the count where it was.
21
+ function logout(login) {
22
+ if (login.status !== 200) return;
23
+ let data = null;
24
+ try { data = login.json("data"); } catch (e) { data = null; }
25
+ if (!data || !data.authToken) return;
26
+ const res = http.post(`${URL}/api/v1/logout`, null, { headers: {
27
+ "X-Auth-Token": data.authToken,
28
+ "X-User-Id": data.userId,
29
+ } });
30
+ T.logout.add(res.timings.duration);
31
+ record(res);
32
+ }
33
+
17
34
  export default function () {
18
35
  const roll = Math.random();
19
36
  let res, name;
@@ -36,4 +53,5 @@ export default function () {
36
53
  T[name].add(res.timings.duration);
37
54
  record(res);
38
55
  check(res, { "status 200": (r) => r.status === 200 });
56
+ if (name === "login") logout(res);
39
57
  }
@@ -176,7 +176,7 @@ From `houston info --name <n> --json`:
176
176
  which are advertised.
177
177
  3. **Never import houston's internals and never scrape human output.**
178
178
  Use `--json` on the commands that have it — `capabilities.commands[].json` says
179
- which, and it is a minority, not all of them: `capabilities`, `cluster`, `doctor`, `down`, `info`, `list`, `ready`, `skill install`, `skill status`, `up` (`capabilities` prints
179
+ which, and it is a minority, not all of them: `capabilities`, `cluster`, `doctor`, `down`, `info`, `list`, `presets`, `ready`, `skill install`, `skill status`, `up` (`capabilities` prints
180
180
  JSON without the flag). For the rest (`seed`, `logs`,
181
181
  `env`, `backup`, `restore`, `upgrade`, `prune`, `tls-status`, …) the **exit code** is
182
182
  the machine-readable part. stdout is the document; anything on stderr is for a
@@ -187,7 +187,7 @@ From `houston info --name <n> --json`:
187
187
  Every `--json` reply is one envelope:
188
188
 
189
189
  ```json
190
- {"schema":"houston.info.v1","contract":2,"houston_version":"2.1.8",
190
+ {"schema":"houston.info.v1","contract":2,"houston_version":"2.1.9",
191
191
  "generated_at":"...","ok":true,"data":{...},"warnings":[],"error":null}
192
192
  ```
193
193
 
@@ -218,8 +218,8 @@ function renderPresets() {
218
218
  const v9 = ctx.$("#v9");
219
219
  v9.hidden = !(major >= 9 && kinds.length && !S.license && !(token && token.value.trim()));
220
220
  v9.replaceChildren(
221
- `Rocket.Chat 9.0 is set to require a Premium plan for ${andJoin(kinds)} sign-in. `
222
- + "Without a license or a registration token, those sign-ins may be refused. ",
221
+ `Rocket.Chat 9.0 and later require a Premium plan for ${andJoin(kinds)} sign-in. `
222
+ + "Without a license or a registration token, those sign-ins are refused. ",
223
223
  node("button", { type: "button", class: "linkbtn", onclick: openLicense, disabled: !may() }, "Add a license"), " or a ",
224
224
  node("button", { type: "button", class: "linkbtn", onclick: openToken }, "registration token"), ".");
225
225
  ctx.$("#ppanels").replaceChildren(...[...S.presets].sort().map(paramPanel).filter(Boolean));
@@ -1173,12 +1173,17 @@ async function dispatch(invocation, dependencies, io) {
1173
1173
  io.writeOut(' --dry-run: nothing changed\n');
1174
1174
  return null;
1175
1175
  }
1176
+ // The panel above said the plan's warnings; the run raises them again as it starts.
1177
+ const said = new Set(strings(plan.warnings));
1176
1178
  return await upgrade.run(text(o.name), text(o.to), {
1177
1179
  offline: bool(o.offline),
1178
1180
  force: bool(o.force),
1179
1181
  noBackup: bool(o.no_backup),
1180
1182
  rollbackOnFailure: !bool(o.no_rollback),
1181
- emit,
1183
+ emit: (event) => {
1184
+ if (event.level !== 'warn' || !said.has(event.message))
1185
+ emit(event);
1186
+ },
1182
1187
  });
1183
1188
  }
1184
1189
  case 'stats':
@@ -1283,7 +1288,18 @@ async function dispatch(invocation, dependencies, io) {
1283
1288
  }
1284
1289
  case 'presets': {
1285
1290
  const presets = require('../lib/presets');
1286
- return { presets: presets.listPresets() };
1291
+ const list = presets.listPresets();
1292
+ if (!bool(o.json_out))
1293
+ return { presets: list };
1294
+ // The names the support bot reads (`data.presets[].paramsHelp`, `.error`), and no more.
1295
+ return {
1296
+ presets: list.map((p) => ({
1297
+ name: p.name,
1298
+ description: p.description,
1299
+ paramsHelp: p.paramsHelp,
1300
+ ...(p.error ? { error: p.error } : {}),
1301
+ })),
1302
+ };
1287
1303
  }
1288
1304
  case 'versions':
1289
1305
  return await runVersions(a, o);
package/dist/cli/perf.js CHANGED
@@ -241,6 +241,10 @@ function parseRamp(value, flag) {
241
241
  if (start < 0 || end < 1) {
242
242
  throw new errors_1.ValidationError(`bad ${flag}: ramp needs START >= 0 and END >= 1, e.g. 10:200`);
243
243
  }
244
+ // A spike is measured against its base, so a base of 0 VUs leaves nothing to compare.
245
+ if (flag === '--spike' && start < 1) {
246
+ throw new errors_1.ValidationError('bad --spike: the base must be at least 1 VU, e.g. 10:100');
247
+ }
244
248
  if (flag === '--spike' && end <= start) {
245
249
  throw new errors_1.ValidationError(`--spike peak must exceed base ('${value}')`);
246
250
  }
@@ -2030,8 +2030,14 @@ exports.COMMAND_SPECS = [
2030
2030
  arguments: [],
2031
2031
  options: [],
2032
2032
  json: {
2033
- mode: 'none',
2033
+ mode: 'flag',
2034
+ schema: 'houston.presets.v1',
2034
2035
  streams: false,
2036
+ option: {
2037
+ index: 0,
2038
+ description: "print the catalogue as one JSON envelope: each preset's name, description and " +
2039
+ 'paramsHelp (its --set keys)',
2040
+ },
2035
2041
  },
2036
2042
  }),
2037
2043
  (0, spec_types_1.defineCommand)({
@@ -255,9 +255,10 @@ async function applySettings(rootUrl, admin, pw, plan, failures, log) {
255
255
  // Custom OAuth providers' settings do not exist until the provider is created -- do that
256
256
  // first so its Accounts_OAuth_Custom-*-* PATCHes land.
257
257
  for (const name of plan.oauthServices) {
258
- if (await (0, rcapi_1.addOauthService)(rootUrl, admin, pw, name)) {
259
- log(` created custom OAuth provider: ${name}`);
260
- }
258
+ const refused = await (0, rcapi_1.addOauthService)(rootUrl, admin, pw, name);
259
+ log(refused === null
260
+ ? ` created custom OAuth provider: ${name}`
261
+ : ` could not create custom OAuth provider ${name}: ${refused}`);
261
262
  }
262
263
  // Apply everything except the limiter (handled last, in finally) so a dump that
263
264
  // re-enables it mid-run cannot throttle the rest of the import.
@@ -440,7 +440,8 @@ function openEntries() {
440
440
  continue;
441
441
  }
442
442
  }
443
- return out;
443
+ // By when each was written: the ids are random, so the file names alone are no order.
444
+ return out.sort((a, b) => (a.at < b.at ? -1 : a.at > b.at ? 1 : 0));
444
445
  }
445
446
  /**
446
447
  * How to ask "is the thing this note is ABOUT still here", per kind.
@@ -604,7 +605,9 @@ async function repairOne(entry, emit, login) {
604
605
  */
605
606
  async function recover(emit = events_1.nullEmit, { dryRun = false, login = null } = {}) {
606
607
  const results = [];
607
- for (const entry of abandoned()) {
608
+ // Newest first: two runs cut short on one workspace both noted a "prior" state, and the
609
+ // second's prior is the first's change, so the oldest note's has to be put back last.
610
+ for (const entry of abandoned().reverse()) {
608
611
  const row = {
609
612
  id: entry.id,
610
613
  kind: entry.kind,