mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 20:27:37 +00:00
95 lines
7.2 KiB
Plaintext
95 lines
7.2 KiB
Plaintext
---
|
|
title: Environment Variables
|
|
description: Comprehensive configuration reference for Shumai.
|
|
---
|
|
|
|
Shumai is configured via environment variables. You can define these variables in a `.env` file at the root of your application workspace, or pass them directly to your Docker containers.
|
|
|
|
---
|
|
|
|
## Database Config
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :------------- | :----------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
| `DATABASE_URL` | PostgreSQL connection URL. Must target a database with the `pgvector` extension installed. | `postgresql://user:pass@localhost:5432/db?schema=public` |
|
|
|
|
---
|
|
|
|
## Server Config
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :---------------------- | :------------------------------------------------------------------------------------------------ | :---------------- |
|
|
| `SHUMAI_SERVER_PORT` | The port on which the Shumai web server will listen. | `3000` (default) |
|
|
| `MAX_REQUEST_BODY_SIZE` | Maximum allowed size for request bodies (e.g., for large file uploads). Default is 10GB in bytes. | `10737418240` |
|
|
|
|
---
|
|
|
|
## Authentication Config
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :------------------- | :--------------------------------------------------------------------- | :--------------------------------------------------------------- |
|
|
| `BETTER_AUTH_SECRET` | A secure, random 32-byte secret used to sign session cookies and JWTs. | Generate with `openssl rand -base64 32` |
|
|
| `BETTER_AUTH_URL` | The public URL of your Hono backend API. Used for redirect flows. | `http://localhost:3000` (respects `SHUMAI_SERVER_PORT` fallback) |
|
|
|
|
---
|
|
|
|
## Storage Config
|
|
|
|
Shumai supports storing files locally or on S3-compatible endpoints.
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------ |
|
|
| `STORAGE_BACKEND` | Storage type. Use `local` for local file system storage, or `s3` for S3-compatible cloud storage. | `local` (default) or `s3` |
|
|
| `AWS_ENDPOINT_URL_S3` | Endpoint for S3 storage or local storage. Used by the browser to build file upload URLs. Must include port if deploying remotely or using custom ports. | `http://localhost:3000` (respects `SHUMAI_SERVER_PORT` fallback if unset) |
|
|
| `S3_BUCKET` | S3 bucket name. | `shumai` (default) |
|
|
| `S3_ACCESS_KEY_ID` | Access key credentials for S3. | `minioadmin` (default) |
|
|
| `S3_SECRET_ACCESS_KEY` | Secret key credentials for S3. | `minioadmin` (default) |
|
|
| `S3_REGION` | S3 storage region. | `auto` (default) |
|
|
| `PRESIGNED_URL_EXPIRES_IN` | Number of hours for which generated presigned download/upload links are valid. | `5` (default) |
|
|
|
|
### Local Storage Port Configuration
|
|
|
|
When `STORAGE_BACKEND` is set to `local` (default):
|
|
|
|
- `SHUMAI_SERVER_PORT` configures the port on which the Shumai web server starts and listens.
|
|
- `AWS_ENDPOINT_URL_S3` configures the public/external endpoint used by client browsers to upload and download files. It must include the scheme and port.
|
|
|
|
For example, if you deploy Shumai on a remote server at `http://123.456.7.8` and configure port mapping `12345:3000` (exposing port 3000 internally as port 12345 externally) in Docker Compose:
|
|
|
|
- Set `SHUMAI_SERVER_PORT` to `3000`.
|
|
- Set `AWS_ENDPOINT_URL_S3` to `http://123.456.7.8:12345`.
|
|
|
|
---
|
|
|
|
## Workflow Config
|
|
|
|
Configures whether background transcoding and AI agents are executed locally or offloaded to a Temporal cluster.
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :------------------------- | :------------------------------------------------------------------------------------------------- | :------------------------------ |
|
|
| `WORKFLOW_EXECUTOR` | Engine choice. Use `local` for in-process database polling, or `temporal` for distributed workers. | `local` (default) or `temporal` |
|
|
| `TEMPORAL_ADDRESS` | Host and port of the Temporal cluster gRPC service. | `localhost:7233` (default) |
|
|
| `EMBEDDING_CHUNK_DURATION` | The duration in seconds for each video chunk when generating video embeddings. | `60.0` (default) |
|
|
| `EMBEDDING_CHUNK_OVERLAP` | The duration in seconds to overlap video chunks when generating video embeddings. | `5.0` (default) |
|
|
|
|
---
|
|
|
|
## Logging Config
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :----------- | :--------------------------------------------------------------------------------------------------- | :---------------- |
|
|
| `LOG_LEVEL` | Pino logging level. Options: `debug`, `info`, `warn`, `error`. | `info` (default) |
|
|
| `LOG_FORMAT` | Log format style. Use `json` for production logging, or `pretty` for human-readable terminal output. | `json` (default) |
|
|
|
|
---
|
|
|
|
## LLM API Key
|
|
|
|
API keys to AI providers on startup.
|
|
|
|
| Variable | Description | Example / Default |
|
|
| :------------------ | :---------------------------------- | :---------------- |
|
|
| `GEMINI_API_KEY` | API key for Google Gemini provider. | `AIzaSy...` |
|
|
| `OPENAI_API_KEY` | API key for OpenAI provider. | `sk-proj-...` |
|
|
| `ANTHROPIC_API_KEY` | API key for Anthropic provider. | `sk-ant-...` |
|