Settings

Logging

There are 3 log types in our service: access logs, app logs, and process logs.

Access logs - are just standard HTTP access logs.

DOCREADER_LOGS_ACCESS_CONSOLE="false"
DOCREADER_LOGS_ACCESS_FILE="false"
DOCREADER_LOGS_ACCESS_FILE_PATH='logs/access/document-reader-access.log'

App logs - all other application logs. Error logs are printed under the error log level.

DOCREADER_LOGS_APP_CONSOLE="true"
DOCREADER_LOGS_APP_FILE="true"
DOCREADER_LOGS_APP_FILE_PATH='logs/app/document-reader-app.log'

Process logs - store document processing input and results in JSON format. Space-consuming option, up to a few tens of Mb per request. Disabled by default.

DOCREADER_PROCESS_RESULTS_LOG_PATH="logs/process"

Logs format

DOCREADER_LOGS_FORMATTER="text"
# or DOCREADER_LOGS_FORMATTER="json"

The service writes console logs to stdout. Day-based file rotation occurs every midnight UTC. Service keeps the last 30 days of file logs.

General

  • DOCREADER_BIND: the bind ip_address:port, default 0.0.0.0:8080

  • DOCREADER_BACKLOG: the maximum number of requests in a queue, default 20

  • DOCREADER_WORKERS: the number of workers to process requests, default 1

  • DOCREADER_LIC_URL: the URL to regula.license file for further download, if the mount option is not available, default None (low priority over mounted file)

  • DOCREADER_ENABLE_DEMO_WEB_APP: enable demo site, default true

HTTPS

  • DOCREADER_CERT_FILE: the absolute path to SSL certificate file

  • DOCREADER_KEY_FILE: the absolute path to SSL key file

CORS

  • DOCREADER_CORS_ORIGINS: allowed cors origins, default same-origin policy

  • DOCREADER_CORS_METHODS: allowed cors methods, default all methods

  • DOCREADER_CORS_HEADERS: allowed cors headers, default all headers

NOTE Custom options can be overridden on the container start:

docker run -p host_port:8080 -v host_path_to_license_folder/regula.license:/app/extBin/unix_x64/regula.license -e DOCREADER_WORKERS=4 regulaforensics/docreader:tagname

Enable HTTPS mode

Run Nginx as a frontend container for HTTPS processing and proxy service requests to the backend docreader container. link

Option 2. Docreader via HTTPS

To run the docreader service via https:

  • add 644 permissions to certificates so the server is able to read certificates

  • pass cert.crt & cert.key files to the container

  • pass DOCREADER_CERT_FILE, DOCREADER_KEY_FILE environment variables

  • forward container port to 8443 host port

chmod 644 ~/cert.crt ~/cert.key
docker run -it -p 8443:8080 -v ~/regula.license:/app/extBin/unix_x64/regula.license -v ~/cert.crt:/app/cert.crt -v ~/cert.key:/app/cert.key -e DOCREADER_CERT_FILE="/app/cert.crt" -e DOCREADER_KEY_FILE="/app/cert.key" regulaforensics/docreader