Installation ############ Compatibility ************* DeepHunter has been designed to run on a Linux environment. Ubuntu Server or Debian are the recommended OS to install DeepHunter. Automated installation (stable release) *************************************** The recommended way to install DeepHunter is to use the installer script. It will install all necessary dependencies, create a Python virtual environment, download DeepHunter, initialize the database, and configure Apache2 with mod-wsgi. .. warning:: - The installer script is to install DeepHunter from scratch. If you already have an existing installation, please refer to the `upgrading section <#upgrading-deephunter>`_. - The installer script does a basic installation, which allows you to test and confirm that DeepHunter is working correctly. However, it may not be suitable for production use without further configuration. For example, to install version 2.5: .. code-block:: sh $ wget https://raw.githubusercontent.com/sebastiendamaye/deephunter/main/install/scripts/v2.5/installer-v2.5.sh $ chmod +x installer-v2.5.sh $ ./installer-v2.5.sh Manual Installation (dev or advanced) ************************************* If you want to install the development version of DeepHunter or if you have an environment that does not fit with the automated installation script, you can install DeepHunter manually by following the steps below. Build the python virtual environment ==================================== It is highly recommended that you install DeepHunter in a Python virtual environment. There are several tools to do that (Conda, Poetry, etc). We'll use ``venv``. We'll install DeepHunter in ``/data/deephunter/`` and the Python virtual environment in ``/data/venv/``. Adapt the procedure if you choose different folders. .. code-block:: sh $ sudo apt install python3-venv python3-wheel python3-dev default-libmysqlclient-dev $ sudo apt install build-essential pkg-config $ sudo mkdir /data $ sudo chown -R $(id -nu):$(id -ng) /data $ chmod -R 755 /data/ $ cd /data $ python3 -m venv venv Install the database ==================== .. code-block:: sh $ sudo apt install mariadb-server libmariadb-dev $ sudo mysql_secure_installation $ mysql -u root -p mysql> create database deephunter; mysql> create user deephunter@localhost identified by 'Awes0meP4ssW0rd'; mysql> grant all privileges on deephunter.* to deephunter@localhost; mysql> \q Download DeepHunter =================== To download DeepHunter, use the following git command: .. code-block:: sh $ sudo apt install git $ cd /data/ $ git clone https://github.com/sebastiendamaye/deephunter.git While cloning the repo as explained above will give you access to the latest features, you may prefer to install the `latest stable release `_. Install the python dependencies =============================== Enter the virtual environment and install dependencies from the ``requirements.txt`` file: .. code-block:: sh $ source /data/venv/bin/activate $ cd /data/deephunter/ (venv) $ pip install -r requirements.txt .. note:: To manage the session timeout, DeepHunter relies on the `django-auto-logout `_ package, that is not `CSP `_ compliant. If you care about CSP compliance, use the following patch (notice that you will need to patch the file each time the package will be updated). Also make sure you use the same ID in your `/etc/apache2/conf-available/security.conf` file. .. code-block:: sh $ VENV_PATH="/data/venv" $ LIB_PATH=$(find $VENV_PATH -type d -name django_auto_logout 2>/dev/null) $ sed -i "s/