Skip to content

Latest commit

 

History

History
46 lines (42 loc) · 9.7 KB

CONFIGURATION.md

File metadata and controls

46 lines (42 loc) · 9.7 KB

Runtime configuration

Set options as process environment variables. The application does not load .env files. Boolean values accept 1, true, yes, or on for true and 0, false, no, or off for false. Other boolean values use the listed default. Positive integer options use the default when their value is invalid or zero.

Variable Default Purpose
HOST 0.0.0.0 Listener address.
PORT 7100 Listener port.
PUBLIC_DIR <cwd>/public Root of repository files and metadata.
BLOG_DIR <PUBLIC_DIR>/content/blogs Directory of blog JSON files.
STATIC_DIR <cwd>/site Root of application pages and assets.
STATIC_INDEX_FILE index.html Page served at /.
INDEX_FILE index.html Index file used for repository directory requests.
DIRECTORY_INDEX true Find an index file or show a listing for repository directories.
DIRECTORY_LISTING true Show a listing when a directory has no index file.
DIRECTORY_TEMPLATE /srv/repository/directory-listing.html Template for repository directory listings.
DIRECTORY_REDIRECT 301 Redirect code for directory paths without a trailing slash. Accepted values are 301 and 308.
ALLOW_DOTFILES false Allow requests for paths with segments that begin with a period.
ALLOW_SYMLINKS false Allow symbolic links in repository content.
SECURITY_HEADERS true Add the configured browser protection headers.
CORS_ORIGIN empty Add an Access-Control-Allow-Origin response header.
ALLOW_GET true Allow GET requests.
ALLOW_HEAD true Allow HEAD requests.
BYTE_RANGES true Support byte-range file requests.
ETAG true Add weak ETag headers to files.
LAST_MODIFIED true Add Last-Modified headers to files.
CACHE_CONTROL empty Set a default Cache-Control header. Route-specific headers can override it.
DEFAULT_MIME_TYPE application/octet-stream MIME type for unknown file extensions.
NOT_FOUND_FILE empty File to return for 404 responses when it can be read.
METHOD_NOT_ALLOWED_FILE empty File to return for 405 responses when it can be read.
ACCESS_LOG true Write one access log entry for each completed request.
STRUCTURED_LOGS true Write logs as JSON, rather than plain text.
LOG_LEVEL info Logger level. Set silent to suppress access log entries.
SHUTDOWN_TIMEOUT 5000 Shutdown timeout in milliseconds for the shared process handlers.
REQUEST_TIMEOUT 30000 Request timeout in milliseconds.
HEADERS_TIMEOUT 60000 Header timeout in milliseconds.
KEEP_ALIVE_TIMEOUT 5000 Keep-alive timeout in milliseconds.
RAM_CACHE false Cache selected public files in memory at startup.
RAM_CACHE_PATHS /index.html,/directory-listing.html,/web/app.css,/web/app.js,/assets/favicon.ico,/assets/eliware-brand.svg Comma-separated paths to cache when RAM_CACHE is enabled.
RAM_CACHE_MAX_BYTES 10485760 Maximum total file bytes in the memory cache.
COMPRESSION true Compress eligible response bodies when clients accept compression.
COMPRESSION_MIN_BYTES 256 Minimum response body length in bytes for compression.

The production image sets PUBLIC_DIR=/srv/repository, BLOG_DIR=/srv/repository/content/blogs, and STATIC_DIR=/opt/nodejs-http/site. It also sets a no-store Cache-Control policy and uses the image copy of directory-listing.html.

Keep PUBLIC_DIR read-only in production. Keep ALLOW_DOTFILES and ALLOW_SYMLINKS disabled unless the repository content and its access policy require them. See metadata integration for readiness files.