## VOL Installation

This guide describes how to install the VOL system using Docker and Docker Compose. The distribution package includes the images required for the operation of the various services.

## Hardware Requirements

Namirial's VOL (On-Line Verifier) solution does not require two separate machines (FE and
BE) but only one instance (VM or physical server) on which it is necessary to first install
Docker and Docker Compose as reported in the API Documentation.

To ensure balancing, the sticky session must be applied on the basis of the source IP;
therefore, once a session has been established and for its entire duration, the balancer
will divert all client requests to the same machine.

Here are the minimum hardware requirements:

- A modern multicore CPU (minimum 4 cores)
- 8 GB RAM
- 200 GB Hard Drive
- Network card with Gigabit Ethernet connectivity


## Prerequisites

To install and start VOL, the following are required:

- Docker version 17.03.0 or later
- Docker Compose version 1.10.0 or later
- Appropriate permissions to execute Docker commands


## Importing Docker images

After extracting the provided archive, import the images using the following commands:

```
docker load --input VOL-api-x.y.z.tar.gz
docker load --input VOL-gui-x.y.z.tar.gz
docker load --input VOL-web-x.y.z.tar.gz
docker load --input VOL-fetcher-x.y.z.tar.gz
```

## Verifying loaded images

To verify that the images have been loaded correctly, use:

```
docker image ls
```

## Starting the application

To start all services required to run VOL, use:

```
docker-compose --project-name vol up -d
```

### Additional commands

View the status of services:

```
docker-compose --project-name vol ps
```

View logs of all services:

```
docker-compose --project-name vol logs
```

View logs of a single service:

```
docker-compose --project-name vol logs <service_name>
```

Stop the application:

```
docker-compose --project-name vol down
```

It is necessary to always use the same value for `--project-name` to preserve volume persistence.

## Enabling the API documentation

To enable the online API documentation:

- Verify the base URL in the `openapi.yaml` file
- Copy the file into the directory:


```
/home/dok/vol-docs-storage/
```

If the directory does not exist, create it.

## Enabling the administration console

To enable access to the admin console, create the directory:

```
/home/dok/vol-web-storage/
```

Inside it, create the file:

- allowers.conf


Insert the allowed IP addresses into the file, following Nginx syntax:

```
allow 192.168.3.60/24;
allow 192.168.3.61/24;
```

If the file is not present, access to the console is denied.

## TLS certificate configuration

To update the TLS certificates used by the web server:

1. Identify the volume containing the certificates using:

```
docker volume ls | grep web_storage
```
2. Retrieve the mount point of the volume with:

```
docker inspect <volume_name> | grep Mountpoint
```
3. Replace the `server.cer` and `server.key` files with updated versions in PEM format.