### Start Docker Containers Source: https://github.com/hashtopolis/server/wiki/Migration-Update Start the Hashtopolis Docker containers using docker compose. ```bash docker compose up ``` -------------------------------- ### Download and Install Hashtopolis Server Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Downloads the Hashtopolis server release bundle using wget, unzips it, moves it to the web server directory, installs Composer, and runs composer install for backend dependencies. ```bash wget https://github.com/hashtopolis/server/archive/refs/tags/vx.x.x.zip -O server-x.x.x.zip unzip server-x.x.x.zip sudo mv server-x.x.x/ /var/www/hashtopolis-backend curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer sudo composer install --working-dir=/var/www/hashtopolis-backend ``` -------------------------------- ### Example Task Command Line Source: https://github.com/hashtopolis/server/wiki/Server-Manual An example of a command line for a task, demonstrating the use of placeholders like #HL# and file references. ```bash -a 0 #HL# words.txt ``` -------------------------------- ### Download Environment File Source: https://github.com/hashtopolis/server/wiki/Migration-Update Download the example .env file for configuring Hashtopolis Docker environment variables. ```bash wget https://raw.githubusercontent.com/hashtopolis/server/master/env.example -O .env ``` -------------------------------- ### Download Docker Compose and environment file Source: https://github.com/hashtopolis/server/wiki/Installation Fetch the docker-compose.yml configuration file and an example environment file to set up Hashtopolis. ```bash wget https://raw.githubusercontent.com/hashtopolis/server/master/docker-compose.yml wget https://raw.githubusercontent.com/hashtopolis/server/master/env.example -O .env ``` -------------------------------- ### Install Mono via Brew (macOS) Source: https://github.com/hashtopolis/server/wiki/Client-Prerequisites Installs the Mono runtime environment on macOS using the Homebrew package manager. ```bash brew install mono ``` -------------------------------- ### Start Docker Compose Source: https://github.com/hashtopolis/server/wiki/Ubuntu-VPS-development-setup Commands to start the Docker Compose services for the Hashtopolis development environment. Can be run in detached mode. ```bash cd .devcontainer docker-compose up ``` ```bash # Alternative start in detached mode docker-compose up -d ``` -------------------------------- ### Setup Hashtopolis Database Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Creates a new database named 'hashtopolis' and a user 'hashtopolis' with a specified password, granting all privileges. ```sql sudo mysql CREATE DATABASE hashtopolis; CREATE USER 'hashtopolis'@'localhost' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON hashtopolis.* TO 'hashtopolis'@'localhost' WITH GRANT OPTION; exit ``` -------------------------------- ### Install and Configure ufw-docker Source: https://github.com/hashtopolis/server/wiki/Ubuntu-VPS-development-setup Installs the ufw-docker utility and restarts ufw to manage Docker container firewall rules. This helps in securing the development instance by controlling network access. ```bash sudo wget -O /usr/local/bin/ufw-docker https://github.com/chaifeng/ufw-docker/raw/master/ufw-docker sudo chmod +x /usr/local/bin/ufw-docker ufw-docker install sudo systemctl restart ufw ``` -------------------------------- ### Install Node.js and Angular Dependencies Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Installs Node.js version 18.x and then installs Angular and other project dependencies using npm for the new web-ui. ```bash # Install nodejs, see https://github.com/nodesource/distributions#debinstall curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs # Install Angular and the dependencies npm install ``` -------------------------------- ### Hashcat Straight Attack Mode Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Use this format for a basic straight attack mode task. ```bash -a0 #HL# Wordlist.txt ``` -------------------------------- ### Update Package List and Install Mono (Ubuntu) Source: https://github.com/hashtopolis/server/wiki/Client-Prerequisites Updates the package list and installs the mono-complete runtime and ca-certificates-mono on Ubuntu. ```bash sudo apt-get update apt-get install mono-complete ca-certificates-mono ``` -------------------------------- ### Install Requirements on Ubuntu Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Installs essential packages for Hashtopolis, including MySQL server, Apache, PHP modules, and utility tools. Enables Apache rewrite module. ```bash sudo apt update && sudo apt upgrade sudo apt install mysql-server sudo apt install apache2 sudo apt install libapache2-mod-php php-mysql php php-gd php-pear php-curl sudo apt install git unzip curl sudo a2enmod rewrite ``` -------------------------------- ### Generic Cracker Command Line Options Source: https://github.com/hashtopolis/server/blob/master/doc/README.md This example shows the command-line options for a generic cracker compatible with Hashtopolis. It details arguments for attack types, hashlists, and keyspace manipulation. ```bash cracker.exe [options] action Generic Cracker compatible with Hashtopolis Options: -m, --mask Use mask for attack -w, --wordlist Use wordlist for attack -a, --attacked-hashlist Hashlist to attack -s, --skip Keyspace to skip at the beginning -l, --length Length of the keyspace to run --timeout Stop cracking process after fixed amount of time Arguments: action Action to execute ('keyspace' or 'crack') ``` -------------------------------- ### Start Agent Manually in Dev Container Source: https://github.com/hashtopolis/server/wiki/Development-environment Commands to manually start the agent within its development container. This involves spawning a shell and then executing the agent script. ```bash docker exec -it hashtopolis_agent /bin/bash ``` ```bash cd src/ python3 . --url http://hashtopolis/api/server.php --debug --voucher devvoucher ``` -------------------------------- ### Update and Install Mono (Debian) Source: https://github.com/hashtopolis/server/wiki/Client-Prerequisites Updates the package list, upgrades existing packages, and installs mono-complete and curl on Debian. ```bash sudo apt update && sudo apt upgrade sudo apt install mono-complete curl ``` -------------------------------- ### Create Hashtopolis Data Directory Source: https://github.com/hashtopolis/server/wiki/Migration-Update Create the directory where Hashtopolis data will be stored within the Docker setup. ```bash sudo mkdir -p /usr/local/share/hashtopolis ``` -------------------------------- ### Hashcat Hybrid Attack Mode (Wordlist First) Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Execute a hybrid attack where the wordlist precedes the mask. Ensure correct ordering for hashcat. ```bash -a7 #HL# ?a?a?a?a?a?a Wordlist.txt ``` -------------------------------- ### Hashcat Hybrid Attack Mode (Mask First) Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Execute a hybrid attack where the mask precedes the wordlist. Ensure correct ordering for hashcat. ```bash -a6 #HL# Wordlist.txt ?a?a?a?a?a?a ``` -------------------------------- ### Hashcat Incremental Brute-force Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Hashcat's incremental mode requires specific mask formatting. This example shows a basic incremental mask. ```bash -a3 -i #HL# ?a?a?a?a ``` -------------------------------- ### Hashcat Combination Attack Mode Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Combine two wordlists for a combination attack. ```bash -a1 #HL# Wordlist.Left Wordlist.Right ``` -------------------------------- ### Load Docker Images from Tar Archives Source: https://github.com/hashtopolis/server/wiki/Installation Import the saved .tar image archives into Docker on the Hashtopolis server. This step is crucial for offline installations. ```bash docker load --input hashtopolis-backend.tar docker load --input hashtopolis-frontend.tar ``` -------------------------------- ### Hashcat Straight Attack with Rules Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Append rule files to a straight attack task to modify wordlist candidates. ```bash -a0 #HL# Wordlist.txt -r Rules.rule ``` -------------------------------- ### Replace Hashtopolis Files Source: https://github.com/hashtopolis/server/wiki/Upgrading-Hashtopolis Copy the new version of Hashtopolis files to your web server's installation directory. Ensure you replace `` with your actual username. ```bash cp -prv /home//hashtopolis/src/* /var/www/hashtopolis/ ``` -------------------------------- ### Pull Docker Images for Offline Installation Source: https://github.com/hashtopolis/server/wiki/Installation Use these commands to pull the latest backend and frontend images from Docker Hub when setting up Hashtopolis on an air-gapped or offline network. ```bash docker pull hashtopolis/backend:latest docker pull hashtopolis/frontend:latest ``` -------------------------------- ### Get Attack Command Source: https://github.com/hashtopolis/server/blob/master/src/templates/pretasks/new.template.html Retrieves the command line for the attack. It suggests using a specific alias for hash lists and notes case sensitivity for Linux agents. ```HTML [[copy.getAttackCmd()]] Use **[[config.getVal([[$DConfig::HASHLIST_ALIAS]])]]** for hash list and assume all files in current directory. If you have Linux agents, please mind the filename case sensitivity! ``` -------------------------------- ### Hashcat Brute-force with Custom Character Set Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Utilize a custom character set for brute-force attacks, especially with special characters. Specify the custom character file with -1, -2, -3, or -4 before the file path. ```bash -a3 #HL# -1 Custom.hcchar ?1?1?1?1?1?1 ``` -------------------------------- ### Initialize Hashtopolis and Set Permissions Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Runs the Hashtopolis initialization script, sets the correct ownership for the web server, and restarts Apache to apply changes. ```bash sudo php -f /var/www/hashtopolis-backend/src/inc/load.php sudo chown -R www-data:www-data /var/www/hashtopolis-backend sudo systemctl restart apache2 ``` -------------------------------- ### Clone and navigate to server repository Source: https://github.com/hashtopolis/server/wiki/Installation Move up one directory, clone the Hashtopolis server repository, and change into its directory to build the backend image. ```bash cd .. git clone https://github.com/hashtopolis/server.git cd server ``` -------------------------------- ### Import Database Backup Source: https://github.com/hashtopolis/server/wiki/Migration-Update Import the Hashtopolis database backup into the running database within the container. ```bash mysql -Dhashtopolis -p < hashtopolis-backup.sql ``` -------------------------------- ### Download Docker Compose File Source: https://github.com/hashtopolis/server/wiki/Migration-Update Download the docker-compose.yml file for setting up Hashtopolis with Docker. ```bash wget https://raw.githubusercontent.com/hashtopolis/server/master/docker-compose.yml ``` -------------------------------- ### Create and navigate to Hashtopolis directory Source: https://github.com/hashtopolis/server/wiki/Installation Use these commands to create a new directory for Hashtopolis and change into it. ```bash mkdir hashtopolis cd hashtopolis ``` -------------------------------- ### Hashcat Brute-force Attack Mode Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Perform a brute-force attack using a standard character set. ```bash -a3 #HL# ?a?a?a?a?a?a ``` -------------------------------- ### Clone and navigate to web-ui repository Source: https://github.com/hashtopolis/server/wiki/Installation Clone the Hashtopolis web-ui repository and change into its directory to build the frontend image. ```bash git clone https://github.com/hashtopolis/web-ui.git cd web-ui ``` -------------------------------- ### Build Hashtopolis frontend Docker image Source: https://github.com/hashtopolis/server/wiki/Installation Build the production-ready frontend Docker image for Hashtopolis. ```bash docker build -t hashtopolis/frontend:latest --target hashtopolis-web-ui-prod . ``` -------------------------------- ### Update Existing Hashtopolis Repository Source: https://github.com/hashtopolis/server/wiki/Upgrading-Hashtopolis If you have an existing Hashtopolis installation managed by Git, use this command to pull the latest changes. ```bash git pull ``` -------------------------------- ### Run Hashtopolis Upgrade Script Source: https://github.com/hashtopolis/server/wiki/Upgrading-Hashtopolis Execute the specific upgrade script for your version. Replace `vX.X.X_vX.X.X` with the actual version numbers relevant to your upgrade path. ```bash php -f /var/www/hashtopolis/install/updates/update_vX.X.X_vX.X.X.php ``` -------------------------------- ### Build Hashtopolis backend Docker image Source: https://github.com/hashtopolis/server/wiki/Installation Build the production-ready backend Docker image for Hashtopolis. ```bash docker build . -t hashtopolis/backend:latest --target hashtopolis-server-prod ``` -------------------------------- ### Initialize API Token Source: https://github.com/hashtopolis/server/blob/master/ci/apiv2/HACKING.md Obtain an API token for authentication by sending a POST request to the auth endpoint. Ensure you have the correct username and password. ```bash TOKEN=$(curl -X POST --user admin:hashtopolis http://localhost:8080/api/v2/auth/token | jq -r .token) ``` -------------------------------- ### Build and Deploy Angular Web-UI Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Builds the Angular web-ui for production and copies the built files to the web server directory. Sets ownership for the web server. ```bash npm run build sudo mkdir -p /var/www/hashtopolis-frontend/ sudo cp -r dist/* /var/www/hashtopolis-frontend/ sudo chown -R www-data:www-data /var/www/hashtopolis-frontend/ ``` -------------------------------- ### Configure Web-UI to Connect to Backend Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Modifies the `app.ts` file to set the correct IP address and port for the Hashtopolis backend server that the web-ui should connect to. ```bash sed -i 's/localhost:8080/:8080/g' src/config/default/app/main.ts ``` -------------------------------- ### Hashcat Hybrid Attack with Custom Character Set Example Source: https://github.com/hashtopolis/server/wiki/Task-Creation-Guidelines Combine a custom character set with a wordlist in a hybrid attack. The order of mask and wordlist is crucial. ```bash -a7 #HL# -1 Custom.hcchar ?1?1?1?1 Wordlist.txt ``` -------------------------------- ### Import SSL Certificate for Mono (Ubuntu/Debian) Source: https://github.com/hashtopolis/server/wiki/Client-Prerequisites Imports an SSL certificate into the Mono environment for secure HTTPS connections. Replace {url} with the actual URL. ```bash mono /usr/lib/mono/4.5/certmgr.exe -ssl https://{url} ``` -------------------------------- ### Fetch Hashlist Data Source: https://github.com/hashtopolis/server/blob/master/ci/apiv2/HACKING.md Retrieve hashlist data, including associated hashes, by sending a GET request to the hashlists endpoint. Requires an active API token. ```bash curl --header "Content-Type: application/json" -X GET --header "Authorization: Bearer $TOKEN" 'http://localhost:8080/api/v2/ui/hashlists/1?expand=hashes' -d '{}' ``` -------------------------------- ### Run Hashtopolis Client with Mono (macOS) Source: https://github.com/hashtopolis/server/wiki/Client-Prerequisites Executes the Windows executable 'hashtopolis.exe' on macOS using the Mono runtime. ```bash mono hashtopolis.exe ``` -------------------------------- ### Hashtopolis Docker Uninstall Script Source: https://github.com/hashtopolis/server/wiki/Uninstall This bash script stops and removes all Docker containers, volumes, images, and networks related to a Hashtopolis installation. It's designed for a complete system removal. ```bash #!/usr/bin/env bash CONTAINER_NAME="hashtopolis" DB_NAME="db" IMAGE_BACKEND_NAME="hashtopolis/backend" IMAGE_FRONTEND_NAME="hashtopolis/frontend" VOLUME_NAME="server_hashtopolis" VOLUME_DB_NAME="server_db" NETWORK_NAME="server_default" # 1 - Stop and remove running app container(s) docker ps -q --no-trunc --filter "name=$CONTAINER_NAME" | xargs -r docker stop docker ps -a -q --filter "name=$CONTAINER_NAME" | xargs -r docker rm # 2 - Stop and remove running app container(s) docker ps -q --no-trunc --filter "name=$DB_NAME" | xargs -r docker stop docker ps -a -q --filter "name=$DB_NAME" | xargs -r docker rm # 3 - Remove Volume, comment this line if you don't want to the volume docker volume ls --filter "name=$VOLUME_NAME" | xargs -r docker volume rm --force docker volume ls --filter "name=$VOLUME_DB_NAME" | xargs -r docker volume rm --force # 4 - Remove image docker image rmi "$IMAGE_BACKEND_NAME" docker image rmi "$IMAGE_FRONTEND_NAME" # 5 - Remove Network docker network ls -q --no-trunc --filter "name=$NETWORK_NAME" | xargs -r docker network rm --force # 6 - Prune container and volume docker container prune -f && docker volume prune -f ``` -------------------------------- ### Connect Agent to Development Container Source: https://github.com/hashtopolis/server/wiki/Development-environment Command to connect an agent to the Hashtopolis development server using a specific URL and voucher. Debugging is enabled. ```bash python3 hashtopolis.zip --url http://127.0.0.1:8080/api/server.php --voucher devagent --debug ``` -------------------------------- ### Build container with firewall arguments Source: https://github.com/hashtopolis/server/wiki/Installation Build Docker containers with specific arguments to handle TLS-inspection or IDS firewalls. Replace with the actual build command. ```bash export CONTAINER_USER_CMD_PRE CONTAINER_USER_CMD_POST docker build --build-arg CONTAINER_USER_CMD_PRE --build-arg CONTAINER_USER_CMD_POST ``` -------------------------------- ### Chunk Detail Rendering Source: https://github.com/hashtopolis/server/blob/master/src/templates/chunks.template.html Renders individual chunk details such as ID, start time, length, checkpoint, progress, task, agent, dispatch time, last activity, time spent, state, and cracked count. Includes conditional logic for displaying links based on permissions and values. ```html ID Start Length Checkpoint Progress Task Agent Dispatch time Last activity Time spent State Cracked [[chunk.getId()]] {{IF [[max([[chunk.getSolveTime()]], [[chunk.getDispatchTime()]])]] > [[time()]] - [[config.getVal('chunktimeout')]] && [[chunk.getProgress()]] < [[chunk.getLength()]] && [[chunk.getState()]] < 4}} {{ENDIF}} [[chunk.getSkip()]] [[chunk.getLength()]] [[chunk.getCheckpoint()]] {{IF [[chunk.getLength()]] > 0}} ([[Util::showperc([[chunk.getCheckpoint()]] - [[chunk.getSkip()]], [[chunk.getLength()]])]]%) {{ENDIF}} {{IF [[chunk.getProgress()]] == null}} N/A {{ELSE}} [[Util::showperc([[chunk.getProgress()]], 10000)]]% {{ENDIF}} {{IF [[chunk.getTaskId()]] == null}} N/A {{ELSE}} [[taskNames.getVal([[chunk.getTaskId()]])]](tasks.php?id=[[chunk.getTaskId()]]) {{ENDIF}} {{IF [[chunk.getAgentId()]] == null}} N/A {{ENDIF}} {{IF [[chunk.getAgentId()]] != null && [[accessControl.hasPermission([[$DAccessControl::VIEW_AGENT_ACCESS]])]]}} [[agentNames.getVal([[chunk.getAgentId()]])]](agents.php?id=[[chunk.getAgentId()]]) {{ENDIF}} {{IF [[chunk.getAgentId()]] != null && ![[accessControl.hasPermission([[$DAccessControl::VIEW_AGENT_ACCESS]])]]}} [[agentNames.getVal([[chunk.getAgentId()]])]] {{ENDIF}} [[date([[config.getVal(DConfig::TIME_FORMAT)]], [[chunk.getDispatchTime()]])]] {{IF [[chunk.getSolveTime()]] == 0}} (no activity) {{ELSE}} [[date([[config.getVal(DConfig::TIME_FORMAT)]], [[chunk.getSolveTime()]])]] [[Util::sectotime([[spent.getVal([[chunk.getId()]])]])]] {{ENDIF}} [[Util::getStaticArray([[chunk.getState()]], 'states')]] {{IF [[chunk.getCracked()]] > 0 && [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}} [[chunk.getCracked()]](hashes.php?chunk=[[chunk.getId()]]) {{ELSE}} [[chunk.getCracked()]] {{ENDIF}} {%TEMPLATE->struct/foot%} ``` -------------------------------- ### Edit environment variables Source: https://github.com/hashtopolis/server/wiki/Installation Open the .env file using nano to customize Hashtopolis settings. ```bash nano .env ``` -------------------------------- ### Chunk Information Loop Source: https://github.com/hashtopolis/server/blob/master/src/templates/tasks/detail.template.html Iterates through dispatched chunks to display details such as ID, start, length, checkpoint, progress, agent, dispatch time, last activity, time spent, state, cracked count, and actions. Conditional rendering is applied for agent name, cracked count, and action buttons based on permissions and chunk status. ```HTML {{FOREACH chunk;[[chunks]]}} {{ENDFOREACH}} ID Start Length Checkpoint Progress Agent Dispatch time Last activity Time spent State Cracked Action [[chunk.getId()]] {{IF [[activeChunks.getVal([[chunk.getId()]])]]}} {{ENDIF}} [[chunk.getSkip()]] [[chunk.getLength()]] [[chunk.getCheckpoint()]] {{IF [[chunk.getLength()]] > 0}} ([[Util::showperc([[chunk.getCheckpoint()]] - [[chunk.getSkip()]], [[chunk.getLength()]])]]%) {{ENDIF}} {{IF [[chunk.getProgress()]] == null}} N/A {{ELSE}} [[Util::showperc([[chunk.getProgress()]], 10000)]]% {{ENDIF}} {{IF ![[chunk.getAgentId()]]}} N/A {{ELSE}} {{IF [[accessControl.hasPermission([[$DAccessControl::VIEW_AGENT_ACCESS]])]]}} [[fullAgents.getVal([[chunk.getAgentId()]]).getAgentName()]](agents.php?id=[[chunk.getAgentId()]]) {{ELSE}} [[fullAgents.getVal([[chunk.getAgentId()]]).getAgentName()]] {{ENDIF}} {{ENDIF}} {{IF [[chunk.getDispatchTime()]] == 0}} (no activity) {{ELSE}} [[date([[config.getVal(DConfig::TIME_FORMAT)]], [[chunk.getDispatchTime()]])]] {{ENDIF}} {{IF [[chunk.getSolveTime()]] == 0}} (no activity) {{ELSE}} [[date([[config.getVal(DConfig::TIME_FORMAT)]], [[chunk.getSolveTime()]])]] [[Util::sectotime([[chunk.getSolveTime()]] - [[chunk.getDispatchTime()]])]] {{ENDIF}} [[Util::getStaticArray([[chunk.getState()]], 'states')]] {{IF [[chunk.getCracked()]] > 0 && [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}} [[[chunk.getCracked()]](hashes.php?chunk=[[chunk.getId()]]) {{ELSE}} [[chunk.getCracked()]] {{ENDIF}} {{IF [[activeChunks.getVal([[chunk.getId()]])]] == false && [[accessControl.hasPermission([[$DAccessControl::MANAGE_TASK_ACCESS]])]]}} {{ENDIF}} {{IF [[activeChunks.getVal([[chunk.getId()]])]] && [[accessControl.hasPermission([[$DAccessControl::MANAGE_TASK_ACCESS]])]]}} {{ENDIF}} ``` -------------------------------- ### Create Config Folder for Docker Source: https://github.com/hashtopolis/server/wiki/Migration-Update Create a 'config' folder within the Hashtopolis data directory for Docker configuration files. ```bash mkdir /usr/local/share/hashtopolis/config ``` -------------------------------- ### Connect to Hashtopolis Database Source: https://github.com/hashtopolis/server/wiki/Development-environment Command to connect to the Hashtopolis MySQL database from within the development container. This requires spawning a shell inside the container first. ```bash docker exec -it hashtopolis /bin/bash ``` ```bash mysql -phashtopolis -uroot -hdb -Dhashtopolis ``` -------------------------------- ### Login to Database Container Source: https://github.com/hashtopolis/server/wiki/Migration-Update Access the Hashtopolis database container's shell environment. ```bash docker exec -it db /bin/bash ``` -------------------------------- ### Configure Apache DocumentRoot Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Sets the Apache `DocumentRoot` directive in the default site configuration to point to the Hashtopolis backend's `src` directory. ```bash sudo nano /etc/apache2/sites-enabled/000-default.conf ... DocumentRoot /var/www/hashtopolis-backend/src ... ``` -------------------------------- ### Configure Apache for Hashtopolis Frontend and Backend Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Sets up Apache virtual hosts to serve both the backend on port 8080 and the new frontend on port 4200. Enables APIv2 for the backend. ```apache ServerAdmin webmaster@localhost DocumentRoot /var/www/hashtopolis-backend/src SetEnv HASHTOPOLIS_APIV2_ENABLE 1 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined AllowOverride All ServerAdmin webmaster@localhost DocumentRoot /var/www/hashtopolis-frontend ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ``` -------------------------------- ### Task Speed Chart Configuration Source: https://github.com/hashtopolis/server/blob/master/src/templates/tasks/detail.template.html Configuration for a line chart displaying task speed over time. Includes data, options for tooltips, hover effects, and scales. ```javascript var config = { type: 'line', data: { labels: [[taskSpeedXLabels]], datasets: [[taskSpeed]] }, options: { responsive: true, maintainAspectRatio: true, tooltips: { mode: 'index', intersect: false, callbacks: { label: function (tooltipItem, data) { var dataLabel = data.labels[tooltipItem.index]; var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index].toLocaleString(); if (Chart.helpers.isArray(dataLabel)) { dataLabel = dataLabel.slice(); dataLabel[0] += value; } else { dataLabel += value; } return dataLabel; } }, }, hover: { mode: 'nearest', intersect: true }, scales: { xAxes: [ { display: true, scaleLabel: { display: true, labelString: 'Time' } } ], yAxes: [ { display: true, scaleLabel: { display: true, labelString: 'H/s' }, ticks: { beginAtZero: true, callback: function(value, index, values) { return value.toLocaleString(); } } } ] } } }; window.onload = function () { var ctx = document.getElementById('taskSpeed').getContext('2d'); window.myLine = new Chart(ctx, config); }; ``` -------------------------------- ### Initialize DataTable for Pretasks Source: https://github.com/hashtopolis/server/blob/master/src/templates/supertasks/detail.template.html Initializes a DataTable for displaying pretask information with specific ordering and column definitions. ```javascript $(document).ready(function () { $('#pretasksOfSupertasks').DataTable({ pageLength: 10, "order": [ [0, 'asc'], [1, 'asc'] ], "columnDefs": [ { "orderable": true, "targets": [0, 1, 2, 3, 4, 5] } ] }); }); ``` -------------------------------- ### Source environment variables for firewall configuration Source: https://github.com/hashtopolis/server/wiki/Installation Load environment variables from a file, typically used when building behind a TLS-inspecting firewall. ```bash source .devcontainer/.env ``` -------------------------------- ### Configure PHP Settings Source: https://github.com/hashtopolis/server/wiki/Install-without-Docker Adjusts PHP configuration parameters in `php.ini` to optimize Hashtopolis performance, such as memory limits and file upload sizes. ```bash sudo nano /etc/php/8.1/apache2/php.ini ... memory_limit = ... upload_max_filesize = ... post_max_size = ... ... ``` -------------------------------- ### Displaying Task Name with Link and Tooltip Source: https://github.com/hashtopolis/server/blob/master/src/templates/hashlists/detail/tasks.template.html Shows the task name with a link to its detail page. The tooltip displays the attack command. ```HTML [[task.getVal('task')->getTaskName()]](tasks.php?id=[[task.getVal('task')->getId()]] "[[task.getVal('task')->getAttackCmd()]]") ``` -------------------------------- ### Copy Database Backup to DB Container Source: https://github.com/hashtopolis/server/wiki/Migration-Update Copy the database backup file into the Docker database container. ```bash docker cp hashtopolis-backup.sql db:. ```