feat: change default listen port from 3000 to 1852 (#756)

Updates the backend listen port, Vite dev proxy target, Docker EXPOSE,
compose port mapping, .env.example default, GitHub Actions smoke-test
default, healthcheck URLs, and every doc/example reference. Test fixtures
that include example URLs were updated for consistency, though their
assertions are port-agnostic.

The rate-limit value of 3000 in middleware/rateLimiters.ts and the
3000 entry in WEB_UI_PORTS (which detects user containers like Grafana)
are intentionally untouched.
This commit is contained in:
Anso
2026-04-24 22:23:31 -04:00
committed by GitHub
parent d6b744e8e6
commit ed553f1f19
27 changed files with 72 additions and 72 deletions
+8 -8
View File
@@ -8,7 +8,7 @@ Sencho exposes a REST API for automating stack deployments, managing webhooks, m
## Base URL
```
https://your-sencho-instance:3000/api
https://your-sencho-instance:1852/api
```
Replace with your actual Sencho host and port. All API paths are prefixed with `/api`.
@@ -19,7 +19,7 @@ Authenticated endpoints require a **Bearer token** in the `Authorization` header
```bash
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://your-sencho-instance:3000/api/stacks
https://your-sencho-instance:1852/api/stacks
```
<Note>
@@ -51,7 +51,7 @@ If omitted, the request targets the default node.
# Target node ID 2
curl -H "Authorization: Bearer TOKEN" \
-H "x-node-id: 2" \
https://your-sencho-instance:3000/api/stacks
https://your-sencho-instance:1852/api/stacks
```
## Error format
@@ -132,7 +132,7 @@ Sencho also provides real-time streaming via WebSocket connections. These are no
Stream live logs from a stack's containers.
**URL:** `wss://your-sencho-instance:3000/api/stacks/{stackName}/logs?nodeId={nodeId}`
**URL:** `wss://your-sencho-instance:1852/api/stacks/{stackName}/logs?nodeId={nodeId}`
**Authentication:** Pass the token as a cookie (`sencho_token`) or Bearer token. For WebSocket connections, authentication is verified during the upgrade handshake.
@@ -142,7 +142,7 @@ Stream live logs from a stack's containers.
import WebSocket from "ws";
const ws = new WebSocket(
"wss://your-sencho-instance:3000/api/stacks/my-app/logs",
"wss://your-sencho-instance:1852/api/stacks/my-app/logs",
{ headers: { Cookie: "sencho_token=YOUR_JWT" } }
);
@@ -156,7 +156,7 @@ curl -i -N \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Cookie: sencho_token=YOUR_JWT" \
https://your-sencho-instance:3000/api/stacks/my-app/logs
https://your-sencho-instance:1852/api/stacks/my-app/logs
```
</CodeGroup>
@@ -165,7 +165,7 @@ curl -i -N \
Open an interactive shell session inside a running container.
**URL:** `wss://your-sencho-instance:3000/ws`
**URL:** `wss://your-sencho-instance:1852/ws`
**Authentication:** Cookie-based JWT only. API tokens with `read-only` or `deploy-only` scope are blocked.
@@ -174,7 +174,7 @@ Open an interactive shell session inside a running container.
```javascript Node.js
import WebSocket from "ws";
const ws = new WebSocket("wss://your-sencho-instance:3000/ws", {
const ws = new WebSocket("wss://your-sencho-instance:1852/ws", {
headers: { Cookie: "sencho_token=YOUR_JWT" },
});
+9 -9
View File
@@ -21,7 +21,7 @@ Writes are admin-only and rejected on replica nodes (policies are managed on the
```bash
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://your-sencho-instance:3000/api/security/policies
https://your-sencho-instance:1852/api/security/policies
```
**Response:**
@@ -60,7 +60,7 @@ curl -H "Authorization: Bearer YOUR_API_TOKEN" \
| `node_id` | number or `null` | no | Scope the policy to one node. `null` applies the policy fleet-wide. |
```bash
curl -X POST https://your-sencho-instance:3000/api/security/policies \
curl -X POST https://your-sencho-instance:1852/api/security/policies \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
@@ -89,7 +89,7 @@ curl -X POST https://your-sencho-instance:3000/api/security/policies \
Any of the create fields can be updated individually. Omitted fields are left unchanged.
```bash
curl -X PUT https://your-sencho-instance:3000/api/security/policies/1 \
curl -X PUT https://your-sencho-instance:1852/api/security/policies/1 \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "block_on_deploy": 0 }'
@@ -106,7 +106,7 @@ curl -X PUT https://your-sencho-instance:3000/api/security/policies/1 \
**License:** Skipper or Admiral · **Role:** Admin
```bash
curl -X DELETE https://your-sencho-instance:3000/api/security/policies/1 \
curl -X DELETE https://your-sencho-instance:1852/api/security/policies/1 \
-H "Authorization: Bearer YOUR_API_TOKEN"
```
@@ -156,7 +156,7 @@ Response rows include an `active` boolean computed from the `expires_at` timesta
| `expires_at` | number or `null` | no | Unix timestamp in milliseconds. `null` for an indefinite suppression. |
```bash
curl -X POST https://your-sencho-instance:3000/api/security/suppressions \
curl -X POST https://your-sencho-instance:1852/api/security/suppressions \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
@@ -179,7 +179,7 @@ curl -X POST https://your-sencho-instance:3000/api/security/suppressions \
**License:** Skipper or Admiral · **Role:** Admin
```bash
curl -X DELETE https://your-sencho-instance:3000/api/security/suppressions/3 \
curl -X DELETE https://your-sencho-instance:1852/api/security/suppressions/3 \
-H "Authorization: Bearer YOUR_API_TOKEN"
```
@@ -201,7 +201,7 @@ Accepts an image reference and starts an asynchronous scan. The response returns
| `scanners` | `["vuln"]` or `["vuln","secret"]` | no | Omit for vuln-only. `secret` requires Skipper or Admiral. |
```bash
curl -X POST https://your-sencho-instance:3000/api/security/scan \
curl -X POST https://your-sencho-instance:1852/api/security/scan \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "imageRef": "nginx:1.27" }'
@@ -221,7 +221,7 @@ Supports filters: `imageRef`, `imageRefLike`, `status`, `limit`, `offset`. Respo
```bash
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
"https://your-sencho-instance:3000/api/security/scans?imageRefLike=nginx&limit=20"
"https://your-sencho-instance:1852/api/security/scans?imageRefLike=nginx&limit=20"
```
## Stack deploy with policy
@@ -266,7 +266,7 @@ HTTP 409 Conflict. The response body is parseable JSON so CI pipelines can branc
Admins can bypass the gate on a per-deploy basis by passing `?ignorePolicy=true` on the deploy URL. The flag is only honored when the calling session resolves to an admin user; API tokens with read-only or deploy-only scope cannot bypass a policy.
```bash
curl -X POST "https://your-sencho-instance:3000/api/stacks/myapp/deploy?ignorePolicy=true" \
curl -X POST "https://your-sencho-instance:1852/api/stacks/myapp/deploy?ignorePolicy=true" \
-H "Authorization: Bearer ADMIN_API_TOKEN"
```