Project to manage fire hoses. This project is based on a web-based interface which was realized with Python and Django.
This installation was tested on Debian 9 (stretch) but should work on all environments which a current version of python. I decided to use the Apache webserver with mod_wsgi and database MariaDB, but other systems like Ngnix and PostgreSQL can also be used.
The first steps are to download the git repository and install the necessary system programs.
- Go to the directory where you want to install this project:
cd /opt
- Install different system packages:
apt-get install apache2 libapache2-mod-wsgi-py3 libmariadbclient-dev mariadb-server python3-pip python3-venv
- Clone this repository:
git clone https://github.com/HyP3r-/firehose.git
- Change to this directory:
cd firehose
- Create a virtual environment:
python3 -m venv venv
- Activate this environment
source venv/bin/activate
- Install python requirements:
pip install -U -r requirements.txt
The second step is to configure the database. Make sure you still have the python virtual environment activated.
- Add those configuration fields to the database configuration (
/etc/mysql/mariadb.conf.d/50-server.cnf
), this activate the new Barracuda file format:innodb_default_row_format = dynamic innodb_file_format = Barracuda innodb_file_per_table = ON innodb_large_prefix = ON
- Create a database user and a new database to connect to (change the user name, database name, and password if you want):
root@example:/opt/firehose# mysql mysql> CREATE DATABASE `firehose`; mysql> CREATE USER 'firehose'@'localhost' IDENTIFIED BY 'password'; mysql> GRANT ALL privileges ON `firehose`.* TO 'firehose'@localhost; mysql> FLUSH PRIVILEGES;
- Update database connection configuration in
config/my.cnf
(username, password and database name) - Create database tables:
python manage.py migrate
- Create first user:
python manage.py createsuperuser
The last step is to configure the web interface, i.e. apache.
- Activate the necessary module:
a2enmod wsgi
- Add the following lines to your web configuration:
WSGIDaemonProcess example.com python-home=/opt/firehose/venv python-path=/opt/firehose/web WSGIProcessGroup example.com WSGIScriptAlias / /opt/firehose/web/firehose/wsgi.py process-group=example.com Alias /favicon.ico /opt/firehose/web/static/hose/img/firefighter.ico Alias /static/ /opt/firehose/web/static/ <Directory /opt/firehose/web/static> Require all granted </Directory> <Directory /opt/firehose/web/firehose> <Files wsgi.py> Require all granted </Files> </Directory>
- Restart the apache service:
service apache2 restart
- Now you can login to the web interface with the user account
The system can generally be managed under the URL /admin
. On this page users can be created and other tables in the database can be adapted.
The actual project can be retrieved under the URL /
.