Skip to content

Commit 1601c81

Browse files
docs: add unauthenticated and proxied port options to preview environments (#541)
* docs: add proxied: false documentation for preview environments * docs: strengthen proxied: false as last-resort, recommend unauthenticated: true first * docs: add unauthenticated: true documentation for public ports * docs: fix proxied: false use cases to reflect HTTPS-only sandbox * docs: add API endpoints as primary unauthenticated use case * docs: add API port to unauthenticated example --------- Co-authored-by: Roo Code <roomote@roocode.com>
1 parent 816b575 commit 1601c81

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

docs/roo-code-cloud/environments.mdx

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ keywords:
1414
- mise
1515
- Initial Path
1616
- Subdomain Routing
17+
- Proxied Ports
18+
- Direct Port Access
1719
---
1820

1921
# Preview Environments
@@ -91,6 +93,8 @@ ports:
9193
|-------|-------------|----------|
9294
| `name` | Identifier for the port (used to generate environment variables) | Yes |
9395
| `port` | The port number to expose | Yes |
96+
| `unauthenticated` | Skip authentication for this port's preview URL (`false` by default). See [Public Ports](#public-ports-unauthenticated) | No |
97+
| `proxied` | Whether traffic goes through the auth proxy (`true` by default). Set to `false` for direct port access (see [Direct Port Access](#direct-port-access-non-proxied)) | No |
9498
| `initial_path` | Default path to append to the preview URL | No |
9599
| `subdomain` | Subdomain to set on the `Host` header when forwarding requests to the app | No |
96100

@@ -113,7 +117,10 @@ The name is converted to uppercase for the environment variable (e.g., `web` bec
113117

114118
### Limits
115119

116-
You can configure up to **4 named ports** per environment.
120+
Port limits depend on whether ports are proxied (default) or non-proxied:
121+
122+
- **Proxied ports** (default): up to **10** per environment. These share a single internal port slot via multiplexing.
123+
- **Non-proxied ports** (`proxied: false`): up to **1** per environment. Each non-proxied port consumes a dedicated port slot.
117124

118125
### Initial Path
119126

@@ -189,6 +196,64 @@ Invalid examples:
189196
- **Admin panels**: Serve an admin interface on `admin.localhost:3000` while the main app runs on the root domain
190197
- **Subdomain APIs**: Frameworks like Rails can use `api.localhost:3000` to route API requests to a separate controller namespace
191198

199+
### Public Ports (Unauthenticated)
200+
201+
By default, all preview URLs require authentication -- visitors must be signed in to your Roo Code Cloud organization to access them. Setting `unauthenticated: true` on a port disables this auth check while keeping the proxy layer intact.
202+
203+
```yaml
204+
ports:
205+
- name: WEB
206+
port: 3000
207+
- name: API
208+
port: 3001
209+
unauthenticated: true
210+
- name: WEBHOOK
211+
port: 3002
212+
unauthenticated: true
213+
```
214+
215+
Use `unauthenticated: true` when you need:
216+
217+
- **API endpoints** that your frontend or external clients call directly (the auth proxy would otherwise block non-browser requests)
218+
- **Webhook receivers** that need to accept requests from external services (e.g., Stripe, GitHub)
219+
- **Public-facing endpoints** like documentation sites or landing pages
220+
- **Health checks** or status pages accessed by monitoring tools
221+
222+
The port still goes through the proxy, so it benefits from HTTPS termination and domain routing. Only the authentication requirement is removed.
223+
224+
### Direct Port Access (Non-Proxied)
225+
226+
By default, all ports are proxied through an authentication layer that validates requests before forwarding them to your application. Setting `proxied: false` bypasses this proxy entirely and exposes the port directly on the sandbox domain.
227+
228+
:::tip[Try `unauthenticated: true` first]
229+
If you just need to skip authentication (e.g., for a public-facing endpoint or webhook), use `unauthenticated: true` instead. It keeps the proxy in place while disabling the auth check, and doesn't count against the stricter non-proxied port limit. Only reach for `proxied: false` when the proxy itself is the problem.
230+
:::
231+
232+
```yaml
233+
ports:
234+
- name: WEB
235+
port: 3000
236+
- name: METRICS
237+
port: 9090
238+
proxied: false
239+
```
240+
241+
Use `proxied: false` only when the proxy layer itself is incompatible with your use case:
242+
243+
- **WebSocket or streaming connections** that are disrupted by the proxy intermediary
244+
- **Services with custom connection handling** that conflict with the proxy's request processing
245+
246+
:::warning[Warning]
247+
When `proxied` is `false`, the port is **completely exposed without authentication**, regardless of the `unauthenticated` setting. Non-proxied ports also count against a stricter limit (1 per environment vs. 10 for proxied ports). Only use this as a last resort when other options don't work.
248+
:::
249+
250+
The `ROO_<NAME>_HOST` environment variable for a non-proxied port points to the direct sandbox domain instead of the preview proxy URL. Your application code doesn't need to change -- just use the injected variable as usual:
251+
252+
```typescript
253+
// Works the same whether the port is proxied or not
254+
const metricsUrl = process.env.ROO_METRICS_HOST || 'http://localhost:9090';
255+
```
256+
192257
## Using Environment Variables in Your Code
193258

194259
Use the `ROO_<NAME>_HOST` variables instead of hardcoded URLs so your services can find each other in both preview and local environments:

0 commit comments

Comments
 (0)