Skip to main content
Version: 3.1.0

Configuration

The service is configured through environment variables. If not specified, default values are used.

Server Configuration

VariableDescriptionDefault
PROTOCOLHTTP protocol to usehttp
DOMAINServer domainlocalhost
PORTServer port number3333
EXTERNAL_PORTPort used in generated URLs (Swagger, storage URIs). Useful when the service runs behind a reverse proxy on a different port.Value of PORT

Authentication Configuration

VariableDescriptionDefaultRequired
API_KEYAPI key for authenticating upload requestsNoneYes

The service will not start without API_KEY set.

Storage Configuration

VariableDescriptionDefault
STORAGE_TYPEStorage provider (local, gcp, or aws)local
LOCAL_DIRECTORYDirectory for local file storageuploads
PUBLIC_URLOverride base URL for document URIs returned to clients. Applies to aws and gcp storage.(not set)

For cloud storage provider configuration, see Storage Providers.

Bucket Configuration

VariableDescriptionDefault
DEFAULT_BUCKETFallback bucket used when a request does not include a bucket field. If unset, requests without a bucket return a 400 error. Automatically added to AVAILABLE_BUCKETS if not already present.(not set)
AVAILABLE_BUCKETSComma-separated list of allowed storage bucketsdocuments,files

Upload Configuration

VariableDescriptionDefault
MAX_UPLOAD_SIZEMaximum upload size in bytes10485760 (10 MB)
ALLOWED_UPLOAD_TYPESComma-separated list of allowed MIME typesimage/png,image/jpeg,image/webp,application/pdf
info

MAX_UPLOAD_SIZE governs the maximum size for both JSON request bodies and multipart file uploads.

Google Cloud Storage Configuration

VariableDescriptionDefault
GOOGLE_APPLICATION_CREDENTIALSPath to the GCP service account JSON fileNone

See Storage Providers for full Google Cloud Storage setup instructions.

Disk space considerations for file uploads

Uploaded files are temporarily written to the OS temp directory before being forwarded to storage. Temp files are automatically cleaned up after each upload completes or fails.

When planning your deployment, ensure:

  • Temp directory disk space can accommodate concurrent uploads at the configured MAX_UPLOAD_SIZE. For example, 10 concurrent 10 MB uploads require approximately 100 MB of temporary disk space.
  • MAX_UPLOAD_SIZE is set appropriately for your use case -- lower it if your files are typically smaller.

Example Environment File

Example .env file for local development:

# Server
PROTOCOL=http
DOMAIN=localhost
PORT=3333
# EXTERNAL_PORT=443

# Authentication (Required)
API_KEY=your-secure-api-key-here

# Storage
STORAGE_TYPE=local
LOCAL_DIRECTORY=uploads

# Buckets
DEFAULT_BUCKET=documents
AVAILABLE_BUCKETS=documents,files