Skip to content

Environment Variables ​

Configure the service using environment variables.

Server Variables ​

VariableDefaultDescription
HOST0.0.0.0Server host
PORT3000Server port
NODE_ENVdevelopmentEnvironment mode
LOG_LEVELinfoLogging level
SETTINGS_PATHdata/settings.jsonSettings file path
OUTPUT_DIRpdf-filesPDF output directory
LOGS_DIRlogsProcess logs directory

Security Variables ​

VariableDefaultDescription
RATE_LIMIT_MAX100Max requests per time window
RATE_LIMIT_WINDOW60000Time window in ms (1 minute)
API_KEYS(empty)Comma-separated API keys for authentication
ALLOWED_ORIGINS(empty)Comma-separated CORS origins
ALLOWED_URL_DOMAINS(empty)Comma-separated allowed URL domains
BLOCK_PRIVATE_IPStrueBlock private IP addresses in URLs
SANITIZE_HTMLfalseEnable HTML sanitization

TIP

See the Security Guide for detailed configuration options.

Usage ​

Local Development ​

bash
PORT=4000 LOG_LEVEL=debug npm run dev

Docker Compose ​

yaml
services:
  pdf-service:
    image: chromium-pdf-service:latest
    environment:
      - NODE_ENV=production
      - PORT=3000
      - LOG_LEVEL=info
      - OUTPUT_DIR=/app/pdf-files
      - LOGS_DIR=/app/logs

Docker Run ​

bash
docker run -d \
  -e NODE_ENV=production \
  -e LOG_LEVEL=info \
  -p 4500:3000 \
  chromium-pdf-service:latest

Log Levels ​

LevelDescription
traceVery detailed debugging
debugDebugging information
infoGeneral information (default)
warnWarning messages
errorError messages only
fatalFatal errors only

Released under the MIT License.