Skip to content

Commit b7e84e2

Browse files
gididafclaude
andcommitted
docs(install): surface the env-var-vs-pipe trap before the var table
Restructure the install page so the curl|bash env-var gotcha is documented immediately after the one-line install — readers see three explicit examples (two ✓ shapes, one ✗) before they encounter the list of supported variables. Previously the explanation came after the table, by which point most readers will have already constructed the broken `VAR=... curl ... | bash` form. Fold the standalone "Custom domain" section into "Customizing the install" since it's the same mechanism, and update the hub doc's link to the new anchor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a7221e3 commit b7e84e2

2 files changed

Lines changed: 15 additions & 22 deletions

File tree

packages/site/src/pages/docs/hub.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The hub talks to your spannora across origins, so each install you want to manag
2727
curl -fsSL https://spannora.dev/install.sh | sudo SPANNORA_ALLOWED_ORIGINS=https://spannora.dev bash
2828
```
2929

30-
The variable must be on the **bash** at the tail of the pipe, not the `curl`. `SPANNORA_ALLOWED_ORIGINS=... curl ... | bash` does nothing — the var lives in curl's environment and never reaches bash. See [install docs](/docs/install/#passing-env-vars-correctly) for the full explanation.
30+
The variable must be on the **bash** at the tail of the pipe, not the `curl`. `SPANNORA_ALLOWED_ORIGINS=... curl ... | bash` does nothing — the var lives in curl's environment and never reaches bash. See [Customizing the install](/docs/install/#customizing-the-install) for the full explanation.
3131

3232
To clear the allowlist later, re-run the installer with the variable **unset** — the drop-in is removed.
3333

packages/site/src/pages/docs/install.mdx

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,27 @@ What it does:
3636

3737
Visit `https://<your-vm-ip>.sslip.io/setup`, paste the setup token, create your account, and you're in.
3838

39-
## Custom domain
39+
## Customizing the install
4040

41-
Point an A record at your VM, then run:
41+
The installer reads a handful of environment variables. **The variable must be set on `bash` at the end of the pipe, not on `curl` in front**`curl` and `bash` are separate processes and a pipe doesn't carry environment across them.
4242

4343
```bash
44+
# ✓ Works — var is in bash's environment
4445
curl -fsSL https://spannora.dev/install.sh | sudo SPANNORA_DOMAIN=chat.example.com bash
46+
47+
# ✓ Also works — explicit export + sudo -E
48+
export SPANNORA_DOMAIN=chat.example.com
49+
curl -fsSL https://spannora.dev/install.sh | sudo -E bash
50+
51+
# ✗ Does NOT work — var is in curl's environment, never reaches bash
52+
SPANNORA_DOMAIN=chat.example.com curl -fsSL https://spannora.dev/install.sh | bash
4553
```
4654

47-
The installer will configure the proxy and request a certificate for that hostname instead of `sslip.io`.
55+
That last shape is what the prefix looks like in most `cmd | bash` recipes online, so it's a natural thing to type — but it silently does nothing here. The installer prints which overrides it saw at the top of its output; if your variable doesn't show up there, you've hit this trap.
4856

49-
## Other install options
57+
If you're setting `SPANNORA_DOMAIN`, point an A record at your VM first — Let's Encrypt's HTTP-01 challenge needs DNS to resolve before the installer can provision a cert.
5058

51-
The installer respects a handful of environment variables:
59+
### Supported variables
5260

5361
| Variable | Purpose |
5462
|---|---|
@@ -58,22 +66,7 @@ The installer respects a handful of environment variables:
5866
| `SPANNORA_ACME_EMAIL` | Email registered with Let's Encrypt. |
5967
| `SPANNORA_ALLOWED_ORIGINS` | Comma-separated origins permitted to talk to this install (needed for cross-origin [hub](/docs/hub/) access). Re-run unset to clear. |
6068

61-
### Passing env vars correctly
62-
63-
The variable must be set in the **bash** process at the end of the pipe, not the `curl` in front. Two shapes that work:
64-
65-
```bash
66-
# inline on bash (one-shot)
67-
curl -fsSL https://spannora.dev/install.sh | sudo SPANNORA_ALLOWED_ORIGINS=https://spannora.dev bash
68-
69-
# or export + sudo -E to preserve env
70-
export SPANNORA_ALLOWED_ORIGINS=https://spannora.dev
71-
curl -fsSL https://spannora.dev/install.sh | sudo -E bash
72-
```
73-
74-
`SPANNORA_ALLOWED_ORIGINS=... curl ... | bash` does **not** work — the variable lives in curl's environment and never reaches bash. Same trap applies to all the variables above.
75-
76-
The installer is idempotent: re-running with `SPANNORA_ALLOWED_ORIGINS` set writes a systemd drop-in at `/etc/systemd/system/spannora.service.d/origins.conf`; re-running with it unset removes that drop-in.
69+
The installer is idempotent: re-running with `SPANNORA_ALLOWED_ORIGINS` set writes a systemd drop-in at `/etc/systemd/system/spannora.service.d/origins.conf`; re-running with it unset removes that drop-in. The main systemd unit is rewritten on every install, so the drop-in is how CORS config survives upgrades.
7770

7871
## Reverse-proxy detection
7972

0 commit comments

Comments
 (0)