Skip to content

Environment Variables

The URL Media Inspector API relies on standard environment variables for configuration. These should be defined in a .env file or supplied directly by your container orchestration system.

Core Variables

VariableTypeDefaultDescription
PORTNumber3000The port the server will bind to.
NODE_ENVStringdevelopmentDefines the environment. Set to production for optimized logging and cache behavior.
PUBLIC_API_URLStringThe public-facing base URL of the API (e.g., https://api.urlmediainspector.dev). Used for Swagger UI server resolution and Content Security Policy. When unset in development, Swagger defaults to http://localhost:{PORT}.
LOG_LEVELStringinfoLogging verbosity. Use debug for development.

Network Constraints

VariableTypeDefaultDescription
MAX_FILE_SIZE_BYTESNumber52428800Maximum allowed size (in bytes) for media fetching. Default is 50 MB.
MAX_REDIRECTSNumber5Maximum number of HTTP redirects to follow.
TIMEOUT_MSNumber10000Global timeout for outbound HTTP requests (in milliseconds).

Redis Configuration

The API uses Redis for canonical resource caching and background job orchestration.

VariableTypeDefaultDescription
REDIS_HOSTString127.0.0.1Redis server hostname. Use redis inside Docker Compose.
REDIS_PORTNumber6379Redis server port.
REDIS_PASSWORDStringRedis authentication password. Leave empty for development.
REDIS_DBNumber0Redis database index.

Queue Configuration

Background enrichment workers are managed through a job queue.

VariableTypeDefaultDescription
QUEUE_CONCURRENCYNumber5Maximum number of concurrent enrichment jobs.
QUEUE_ATTEMPTSNumber3Number of retry attempts for failed jobs.
QUEUE_BACKOFFNumber1000Backoff delay (in milliseconds) between retry attempts.

Security

VariableTypeDefaultDescription
WEBHOOK_SECRETStringShared secret for webhook signature verification. Must be set to a strong, unique value in production.
ADMIN_TOKENStringToken for administrative API endpoints.

Note: SSRF protection is always enabled. There is no toggle to disable it.

Infrastructure Documentation — Behavior-Driven, Schema-Governed