Installing the Web Interface
The web interface is built using Django. You can run it using Python 3, which will require the following dependencies:
1
$ sudo apt install python3 python3-dev python3-pip python3-mysqldb
2
$ sudo pip3 install Django python-decouple django-geoip2-extras
Copied!
To configure your Krakan Django app, instead of modifying server/settings.py you can create a file named .env inside the server/ folder with the following content:
1
SECRET_KEY=your_secret_key
2
DEBUG=True
3
DB_NAME=kraken
4
DB_USER=user
5
DB_PASSWORD=pass
6
STATIC_ROOT=/home/user/kraken/server/static/
7
GEOIP_PATH=/home/user/geoip/
Copied!
Change those values appropriately. The GEOIP_PATH variable should point to a folder containing your MaxMind GeoLite2 City database.
After having configured the settings in the .env file, you will need to initialize the database with:
1
$ python3 manage.py makemigrations autoruns detections downloads hosts
2
$ python3 manage.py migrate
Copied!
If you want to run the server using Gunicorn, you can install it with:
1
$ sudo pip3 install gunicorn
Copied!
You can create a Gunicorn systemd service by creating a kraken.service file in /etc/systemd/system like the following:
1
Description=Gunicorn Application Server handling Kraken Servers
2
After=network.target
3
4
[Service]
5
User=user
6
Group=www-data
7
WorkingDirectory=/home/user/kraken/server/
8
ExecStart=/usr/local/bin/gunicorn --workers 3 --bind unix:/home/user/kraken-server.sock server.wsgi:application
9
Restart=always
10
11
[Install]
12
WantedBy=multi-user.target
Copied!
You can then configure your webserver to proxy requests to the unix socket at /home/user/kraken-server.sock.
Last modified 3yr ago
Copy link