Environment Variables ​
Configure the service using environment variables.
Server Variables ​
| Variable | Default | Description |
|---|---|---|
HOST | 0.0.0.0 | Server host |
PORT | 3000 | Server port |
NODE_ENV | development | Environment mode |
LOG_LEVEL | info | Logging level |
SETTINGS_PATH | data/settings.json | Settings file path |
OUTPUT_DIR | pdf-files | PDF output directory |
LOGS_DIR | logs | Process logs directory |
Security Variables ​
| Variable | Default | Description |
|---|---|---|
RATE_LIMIT_MAX | 100 | Max requests per time window |
RATE_LIMIT_WINDOW | 60000 | Time 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_IPS | true | Block private IP addresses in URLs |
SANITIZE_HTML | false | Enable HTML sanitization |
TIP
See the Security Guide for detailed configuration options.
Usage ​
Local Development ​
bash
PORT=4000 LOG_LEVEL=debug npm run devDocker 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/logsDocker Run ​
bash
docker run -d \
-e NODE_ENV=production \
-e LOG_LEVEL=info \
-p 4500:3000 \
chromium-pdf-service:latestLog Levels ​
| Level | Description |
|---|---|
trace | Very detailed debugging |
debug | Debugging information |
info | General information (default) |
warn | Warning messages |
error | Error messages only |
fatal | Fatal errors only |