Skip to main content

Set Up Backend

To be able to build and work on the backend components, it is necessary to have Python and Docker Compose installed.

Python​

The required Python interpreter (Python 3.11.18) and virtual environment (.venv) are managed automatically by mise. Please refer to the Toolchain documentation for setup and usage instructions.

When entering the repository directory with mise activated, .venv is automatically created and activated, and PYTHONPATH is configured.

Docker / Docker Compose​

The whole project is executed via Docker containers. Because of this, it is necessary to have Docker and Docker Compose installed on your machine when working on it.

Docker separates the different components of the project into so-called containers. Each of those containers acts on an own virtualization layer. With Docker Compose, all those specific containers can be built and act together as one project.

A guide on how to install Docker on Linux can be found here. On Windows, Docker Desktop can be installed. Please keep in mind that on Windows WSL2 also needs to be installed for Docker to work.

After Docker is installed, Docker Compose can be installed using this guide.

Script permissions on Linux and WSL​

Run Git commands inside WSL when the checkout is stored in its Linux filesystem. Keep core.fileMode enabled so Git preserves executable script permissions:

git config --get core.fileMode

The value should be true; do not disable it to hide unexpected mode changes. Before committing, check git diff --summary and git diff --cached --summary for unintended permission changes. The repository's .gitattributes keeps configure and shell scripts on Linux line endings so their shebangs work.

Developer Mode​

The developer mode is a setting that can be enabled to limit the number of firmware images that are downloaded per vendor. This is useful for development and testing, as it reduces the time and disk space required to run the scraper.

To enable the developer mode, run mise run configure, pass --developer_mode=y to the configure script, or answer y when prompted during an interactive run:

# Via mise task (headless developer mode)
mise run configure

# Non-interactive
./configure --developer_mode=y

# Combined with headless mode
./configure --headless --developer_mode=y

This will set the developer_mode variable in the .env and config.json files to True.

When the developer mode is active, the scraper will only download 3 firmware images per vendor. The limit is defined in the firmware_scraper/settings.py file.