This repository is used to develop a web interface that enables the configuration of nftables through a graphical user interface.
To use this project, you need to install python3-nftables
and python3-hug
. For proper functioning, it's necessary to run the parsing file as an administrator.
The default user credentials are as follows:
- Username: default
- Password: defaultpassword
To run the project, follow these steps:
-
Grant permissions to the
run.sh
file:sudo chmod +x run.sh
-
Execute the run.sh file. This file is used to run the project:
sudo ./run.sh
-
To kill all processes:
sudo killall python
To deploy an Apache server, use the build.sh file:
-
Grant permissions to the build.sh file:
sudo chmod +x build.sh
-
Execute the build.sh file:
sudo ./build.sh
(Apache server will be available on port 8080)
-
Install dependencies
sudo apt install gunicorn gevent
-
In nftables-frontend folder execute:
sudo gunicorn -w 4 -b 0.0.0.0:4000 --worker-class gevent app:app
-
In nftables-parser execute:
sudo hug -f main.py
To run the tests and generate coverage reports, use the following commands:
-
Execute the test files (in the nftables-frontend folder):
python -m pytest
-
Execute coverage:
python -m pytest --cov
-
Generate a coverage report:
python -m pytest --cov --cov-report=html