mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(library): support LIBRARY_BROWSE_ROOT to restrict file path access
Introduce a LIBRARY_BROWSE_ROOT environment variable (defaulting to the current directory) to restrict directories users can browse and select when setting up library paths. Add a PathPolicyService on the backend to enforce path containment checks securely, and update the frontend FolderPickerModal to prevent navigating above the configured browse root. Closes #567
This commit is contained in:
+10
-9
@@ -224,15 +224,16 @@ pnpm --filter @bookorbit/types dev
|
||||
|
||||
These are the variables you are most likely to need during development. See `server/.env.example` for the full list with comments.
|
||||
|
||||
| Variable | Purpose | Default (dev) |
|
||||
| ----------------- | ---------------------------------- | --------------------------------------------------------- |
|
||||
| `DATABASE_URL` | PostgreSQL connection string | `postgres://bookorbit:bookorbit@localhost:5432/bookorbit` |
|
||||
| `PORT` | Server listen port | `3000` |
|
||||
| `NODE_ENV` | Runtime mode | `development` |
|
||||
| `JWT_SECRET` | Signing key for auth tokens | `change-me-in-production` |
|
||||
| `APP_DATA_PATH` | Storage for covers, avatars, cache | `../local/data` |
|
||||
| `APP_URL` | Base URL for email links | `http://localhost:5173` |
|
||||
| `SWAGGER_ENABLED` | Serve Swagger UI and OpenAPI JSON | `false` |
|
||||
| Variable | Purpose | Default (dev) |
|
||||
| --------------------- | ---------------------------------- | --------------------------------------------------------- |
|
||||
| `DATABASE_URL` | PostgreSQL connection string | `postgres://bookorbit:bookorbit@localhost:5432/bookorbit` |
|
||||
| `PORT` | Server listen port | `3000` |
|
||||
| `NODE_ENV` | Runtime mode | `development` |
|
||||
| `JWT_SECRET` | Signing key for auth tokens | `change-me-in-production` |
|
||||
| `APP_DATA_PATH` | Storage for covers, avatars, cache | `../local/data` |
|
||||
| `LIBRARY_BROWSE_ROOT` | Library folder picker root | `/` |
|
||||
| `APP_URL` | Base URL for email links | `http://localhost:5173` |
|
||||
| `SWAGGER_ENABLED` | Serve Swagger UI and OpenAPI JSON | `false` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user