Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:latest
If the detector in 0.9.3 exits with `SIGSEGV`, add `-e ORT_DISABLE_TELEMETRY=1`
to `docker run`; see [installation troubleshooting](https://pasteguard.com/docs/installation).

Open [localhost:3000](http://localhost:3000) for the dashboard.
Open [localhost:3000/health](http://localhost:3000/health) to check the service.

The dashboard is disabled by default. Set `dashboard.enabled: true` in `config.yaml`
to enable it; see [dashboard configuration](https://pasteguard.com/docs/configuration/overview#dashboard).

Point your app or agent to PasteGuard instead of the provider:

Expand Down
5 changes: 3 additions & 2 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ logging:
# Only scanned roles (scan_roles) are stored, after PII and secrets are masked.
log_masked_content: true

# Dashboard settings
# Dashboard settings (disabled by default)
dashboard:
enabled: true
enabled: false

# Basic auth for dashboard (optional)
# Without auth, anyone who can reach the server can read dashboard logs.
# auth:
# username: admin
# password: ${DASHBOARD_PASSWORD}
2 changes: 2 additions & 0 deletions docs/api-reference/dashboard-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Request logs and statistics
---

The dashboard provides an API for accessing request logs and statistics.
Enable it with `dashboard.enabled: true`; it is disabled by default.
If `dashboard.auth` is configured, supply Basic Authentication credentials.

## Logs

Expand Down
7 changes: 6 additions & 1 deletion docs/configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ dashboard:

| Option | Default | Description |
|--------|---------|-------------|
| `enabled` | `true` | Enable dashboard at `/dashboard` |
| `enabled` | `false` | Enable dashboard at `/dashboard` |
| `auth.username` | - | Basic auth username |
| `auth.password` | - | Basic auth password |

Set `dashboard.enabled: true` to enable the dashboard and its logs/statistics APIs.
Authentication is optional. Without `dashboard.auth`, anyone who can reach the
server can read dashboard data; configure authentication or restrict network access.
Existing configurations with `enabled: true` remain enabled.

## Environment Variables

Use `${VAR}` or `${VAR:-default}` syntax:
Expand Down
4 changes: 3 additions & 1 deletion docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:latest
```

PasteGuard runs on `http://localhost:3000`. Open
[http://localhost:3000](http://localhost:3000) for the dashboard.
[http://localhost:3000/health](http://localhost:3000/health) to check the service.
The dashboard is disabled by default. Enable it with `dashboard.enabled: true`
in a mounted `config.yaml`; see [dashboard configuration](/configuration/overview#dashboard).

<Note>
The first start loads the detection model and can take a little longer; the
Expand Down
6 changes: 4 additions & 2 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ description: Run PasteGuard locally and connect Browser Chat, Apps & APIs, or Co
docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:latest
```

PasteGuard runs on `http://localhost:3000`. Open `http://localhost:3000` to see the dashboard.
PasteGuard runs on `http://localhost:3000`. Open `http://localhost:3000/health` to
check the service. The dashboard is disabled by default.

<Note>
For custom configuration, Docker Compose, or persistent logs, see [Installation](/installation).
Expand Down Expand Up @@ -61,7 +62,8 @@ The name and email were masked before reaching OpenAI and restored in the respon

## 5. View Dashboard

Open `http://localhost:3000` in your browser to see:
Set `dashboard.enabled: true` in a mounted `config.yaml` (see [Installation](/installation))
and restart PasteGuard. Open `http://localhost:3000/dashboard` in your browser to see:

- Request history
- Detected PII and secrets
Expand Down
25 changes: 25 additions & 0 deletions src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ function cleanupConfig(path: string): void {
}

describe("config", () => {
test.each([
["omitted dashboard", "", false],
["empty dashboard", "dashboard: {}", false],
["explicitly disabled dashboard", "dashboard:\n enabled: false", false],
["explicitly enabled dashboard", "dashboard:\n enabled: true", true],
])("loads %s", (_label, dashboard, enabled) => {
const path = writeConfig(`
mode: mask
providers: {}
pii_detection:
detector_url: http://localhost:5002
${dashboard}
`);

try {
expect(loadConfig(path).dashboard.enabled).toBe(enabled);
} finally {
cleanupConfig(path);
}
});

test("ships with the dashboard disabled in the example configuration", () => {
expect(loadConfig("config.example.yaml").dashboard.enabled).toBe(false);
});

test("accepts a valid detector HTTP URL", () => {
const path = writeConfig(`
mode: mask
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const DashboardAuthSchema = z.object({
});

const DashboardSchema = z.object({
enabled: z.boolean().default(true),
enabled: z.boolean().default(false),
auth: DashboardAuthSchema.optional(),
});

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Codex: http://${host}:${port}/codex
Mask API: http://${host}:${port}/api/mask
Health: http://${host}:${port}/health
Info: http://${host}:${port}/info
Dashboard: http://${host}:${port}/dashboard
Dashboard: ${config.dashboard.enabled ? `http://${host}:${port}/dashboard` : "disabled"}

Mode: ${config.mode.toUpperCase()}
${modeInfo}
Expand Down
Loading