Skip to content
This page was generated and translated with the assistance of AI. If you spot any inaccuracies, feel free to help improve it. Edit on GitHub

Configuration Reference ​

OpenPR is configured through environment variables. All services read from the same .env file when using Docker Compose, or individual environment variables when running directly.

API Server ​

VariableDefaultDescription
APP_NAMEapiApplication identifier for logging
BIND_ADDR0.0.0.0:8080Address and port the API listens on
DATABASE_URL--PostgreSQL connection string
JWT_SECRETchange-me-in-productionSecret key for signing JWT tokens
JWT_ACCESS_TTL_SECONDS2592000 (30 days)Access token lifetime in seconds
JWT_REFRESH_TTL_SECONDS604800 (7 days)Refresh token lifetime in seconds
RUST_LOGinfoLog level (trace, debug, info, warn, error)
UPLOAD_DIR/app/uploadsDirectory for file uploads

Security

Always change JWT_SECRET to a strong, random value in production. Use at least 32 characters of random data:

bash
openssl rand -hex 32

Database ​

VariableDefaultDescription
DATABASE_URL--Full PostgreSQL connection string
POSTGRES_DBopenprDatabase name
POSTGRES_USERopenprDatabase user
POSTGRES_PASSWORDopenprDatabase password

Connection string format:

postgres://user:password@host:port/database

Docker Compose

When using Docker Compose, the database service is named postgres, so the connection string is:

postgres://openpr:openpr@postgres:5432/openpr

Worker ​

VariableDefaultDescription
APP_NAMEworkerApplication identifier
DATABASE_URL--PostgreSQL connection string
JWT_SECRET--Must match the API server value
RUST_LOGinfoLog level

The worker processes background tasks from the job_queue and scheduled_jobs tables.

MCP Server ​

VariableDefaultDescription
APP_NAMEmcp-serverApplication identifier
OPENPR_API_URL--API server URL (including proxy if applicable)
OPENPR_BOT_TOKEN--Bot token with opr_ prefix
OPENPR_WORKSPACE_ID--Default workspace UUID
DATABASE_URL--PostgreSQL connection string
JWT_SECRET--Must match the API server value
DEFAULT_AUTHOR_ID--Fallback author UUID for MCP operations
RUST_LOGinfoLog level

MCP Transport Options ​

The MCP server binary accepts command-line arguments:

bash
# HTTP mode (default)
mcp-server --transport http --bind-addr 0.0.0.0:8090

# stdio mode (for Claude Desktop, Codex)
mcp-server --transport stdio

# Subcommand form
mcp-server serve --transport http --bind-addr 0.0.0.0:8090

Frontend ​

VariableDefaultDescription
VITE_API_URLhttp://localhost:8080API server URL for the frontend to connect to

Reverse Proxy

In production with a reverse proxy (Caddy/Nginx), VITE_API_URL should point to the proxy URL that routes to the API server.

Docker Compose Ports ​

ServiceInternal PortExternal PortPurpose
PostgreSQL54325432Database
API80808081REST API
Worker----Background tasks (no port)
MCP Server80908090MCP tools
Frontend803000Web UI

Example .env File ​

bash
# Database
DATABASE_URL=postgres://openpr:openpr@localhost:5432/openpr
POSTGRES_DB=openpr
POSTGRES_USER=openpr
POSTGRES_PASSWORD=openpr

# JWT (CHANGE IN PRODUCTION)
JWT_SECRET=change-me-in-production
JWT_ACCESS_TTL_SECONDS=2592000
JWT_REFRESH_TTL_SECONDS=604800

# API Server
APP_NAME=api
BIND_ADDR=0.0.0.0:8080
RUST_LOG=info

# Frontend
VITE_API_URL=http://localhost:8080

# MCP Server
MCP_SERVER_PORT=8090

Log Levels ​

OpenPR uses the tracing crate for structured logging. Set RUST_LOG to control verbosity:

LevelDescription
errorOnly errors
warnErrors and warnings
infoNormal operational messages (default)
debugDetailed debugging information
traceVery verbose, includes all internal operations

Per-module filtering is supported:

bash
RUST_LOG=info,api=debug,mcp_server=trace

Next Steps ​

Released under the Apache-2.0 License.