The Server is divided into two main components:
- Backend
- Frontend
The backend performs the following tasks:
- Initializes a connection with the database.
- Starts a basic
HTTPServer
to expose the REST API, potentially creating seeds/mock data for testing purposes. - Initializes a
gRPC
server to handle communication with clients. - Initializes a
TCP
server to handle communication with daemons. - Encapsulates the core application logic queue.
The frontend performs the following tasks:
- Starts a basic
HTTPServer
and parses template files to expose a user interface. - Accepts user inputs and communicates with the backend using
REST API
by performing HTTP requests.
Important
You need to export the following environment variables. Customize them as needed.
cd database && \
docker build -t dp-database . && \
docker run -d \
--name dp-database \
-e MYSQL_RANDOM_ROOT_PASSWORD=yes \
--restart unless-stopped \
-p 3306:3306 \
--health-cmd="mysqladmin ping -h localhost -uagent -pSUPERSECUREUNCRACKABLEPASSWORD" \
--health-interval=20s \
--health-retries=10 \
dp-database
For simplicity you can save these into a .env
and the source .env
Change them accoding to your needs.
export BACKEND_HOST="0.0.0.0"
export BACKEND_PORT="4747"
export FRONTEND_HOST="0.0.0.0"
export FRONTEND_PORT="4748"
export DB_USER="agent"
export DB_PASSWORD="SUPERSECUREUNCRACKABLEPASSWORD" # This should be changed (remember to change it in database/initialize.sql too)
export DB_HOST="localhost"
export DB_PORT="3306"
export DB_NAME="dp_hashcat"
export DB_CERT="dp_certs"
export DB_CERT_USER="certs"
export DB_CERT_PASSWORD="SUPERSECUREUNCRACKABLEPASSWORD" # This should be changed (remember to change it in database/initialize.sql too)
export ALLOW_REGISTRATIONS="True" # Disable if needed
export DEBUG="True" # leave to true this
export RESET="False" # set to false when running the server normally otherwise at each server restart data will be wiped from the db
export GRPC_URL="0.0.0.0:7777"
export GRPC_TIMEOUT="10s"
export TCP_ADDRESS="0.0.0.0"
export TCP_PORT="4749"
cd server
make build
./build/server
After completing these steps, the server should be up and running, with both the frontend and backend components functioning as expected.
Frontend will be available to FRONTEND_PORT
port value.