Local installation - Dadard29/PassiveDNS Wiki

How to install the project locally

Database

First, start the database. Head to the ArangoDB instructions to install the database engine locally. Don't forget to run the secure installation script to setup the root account. Ensure that the database is running before proceeding to the next steps.

Then you need to initialize the PassiveDNS database. A script in this repository allows you to do so:

$~ pip install pycryptodome
$~ python db/init.py

You will be guided through the initialization process. You'll need to specify some configuration, including:

This python script will generate a javascript file, to be used to initialize the database. Execute it into the database engine:

arangosh --javascript.execute _init_db_tmp.js

Now, the database should be ready.

API

The API needs a python3 environment. Creates a new one into the api folder, and install the project dependencies:

$~ cd api
$~ python venv -m venv
$~ source venv/bin/activate
$~ pip install -r requirements.txt

The API also needs several environment variables to be set.

variable usage example
ARANGO_USERNAME database connection root
ARANGO_PASSWORD database connection password
DB_HOST database connection http://localhost:8529
JWT_SECRET_KEY used to build JWT jwt_key
DEBUG set to '1' for verbose mode, set to '0' otherwise 1
VERSION the last tag used in the code local
COMMIT_SHA the last commit sha
JOB_URL the url of the build pipeline http://github.com/PassiveDNS/PassiveDNS

You can edit the ./env/api.env file et export it before starting the API.

$~ cat .env
ARANGO_USERNAME=passive_dns_user
ARANGO_PASSWORD=<db_password>
JWT_SECRET_KEY=<jwt_key>
DEBUG=1
$~ set -a
$~ source .env
$~ set +a

Then, you can start the API service

$~ python main.py

The API should be reachable on localhost with port 8080.

Front

The front needs an NPM environment.

First, install the dependencies of the project.

$~ cd front
$~ npm install

Then , run the project.

$~ npm run serve

Checkout http://localhost:8081 on your browser to use the application.