From b8e8bbd0e336584c47de9263fc37b3c165a956bf Mon Sep 17 00:00:00 2001
From: Flavio Meyer <flavio.meyer@ajila.com>
Date: Tue, 21 Jan 2020 11:20:34 +0100
Subject: [PATCH] Updating README with environment variable option

---
 README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 79 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index e60a73e..eeda1e6 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,38 @@
-This is two in one docker image so it runs open source virus scanner ClamAV (https://www.clamav.net/), automatic virus definition updates as background process and REST api interface to interact with ClamAV process.
+# Table of Contents
 
-## Usage:
+- [Introduction](#introduction)
+- [Prerequisites](#prerequisites)
+- [Installation](#installation)
+- [Quick Start](#quick-start)
+    - [Status Codes](#status-codes)
+- [Configuration](#configuration)
+    - [Environment Variables](#environment-variables)
+    - [Networking](#networking)  
+- [Maintenance](#maintenance)
+    - [Shell Access](#shell-access)
+- [Developing](#developing)    
+- [References](#references)
+
+# Introduction
+
+This is two in one docker image so it runs open source virus scanner ClamAV (https://www.clamav.net/), automatic virus definition updates as background process and REST API interface to interact with ClamAV process.
+
+# Prerequisites
+
+This container doesn't do much on it's own unless you use an additional service or communicator to talk to it!
+
+# Installation
+
+Automated builds of the image are available on [Registry](https://hub.docker.com/r/ajilaag/clamav-rest) and is the recommended method of installation.
+
+```bash
+docker pull hub.docker.com/ajilaag/clamav-rest:(imagetag)
+```
+
+The following image tags are available:
+* `latest` - Most recent release of ClamAV with REST API
+
+# Quick Start
 
 Run clamav-rest docker image:
 ```bash
@@ -34,19 +66,61 @@ Content-Length: 33
 { Status: "OK", Description: "" }
 ```
 
-**Status codes:**
+## Status Codes
 - 200 - clean file = no KNOWN infections
 - 400 - ClamAV returned general error for file
 - 406 - INFECTED
 - 412 - unable to parse file
 - 501 - unknown request
 
+# Configuration
 
-## Developing:
+## Environment Variables
+
+Below is the complete list of available options that can be used to customize your installation.
+
+| Parameter | Description |
+|-----------|-------------|
+| `MAX_SCAN_SIZE` | Amount of data scanned for each file - Default `100M` |
+| `MAX_FILE_SIZE` | Don't scan files larger than this size - Default `25M` |
+| `MAX_RECURSION` | How many nested archives to scan - Default `16` |
+| `MAX_FILES` | Number of files to scan withn archive - Default `10000` |
+| `MAX_EMBEDDEDPE` | Maximum file size for embedded PE - Default `10M` |
+| `MAX_HTMLNORMALIZE` | Maximum size of HTML to normalize - Default `10M` |
+| `MAX_HTMLNOTAGS` | Maximum size of Normlized HTML File to scan- Default `2M` |
+| `MAX_SCRIPTNORMALIZE` | Maximum size of a Script to normalize - Default `5M` |
+| `MAX_ZIPTYPERCG` | Maximum size of ZIP to reanalyze type recognition - Default `1M` |
+| `MAX_PARTITIONS` | How many partitions per Raw disk to scan - Default `50` |
+| `MAX_ICONSPE` | How many Icons in PE to scan - Default `100` |
+| `PCRE_MATCHLIMIT` | Maximum PCRE Match Calls - Default `100000` |
+| `PCRE_RECMATCHLIMIT` | Maximum Recursive Match Calls to PCRE - Default `2000` |
+
+## Networking
+
+| Port | Description |
+|-----------|-------------|
+| `3310`    | ClamD Listening Port |
+
+# Maintenance
+
+## Shell Access
+
+For debugging and maintenance purposes you may want access the containers shell. 
+
+```bash
+docker exec -it (whatever your container name is e.g. clamav) bash
+```
+
+# Developing
 
 Build golang (linux) binary and docker image:
+
 ```bash
 # env GOOS=linux GOARCH=amd64 go build
 docker build . -t clamav-go-rest
 docker run -p 9000:9000 -itd --name clamav-rest clamav-go-rest
-```
\ No newline at end of file
+```
+
+# References
+
+* https://www.clamav.net
\ No newline at end of file