Installation

Dependencies

  • Podman or Docker
  • Python 3 (+ venv, yaml)
  • PostgreSQL
  • Java 21
  • Maven

Example on Debian:

sudo apt install podman postgresql openjdk-21-jdk maven python3-venv python3-yaml

Cloning the repo

git clone https://codeberg.org/LUG-Trieste/linux-bomb.git

Database setup

sudo su - postgres
createdb bomb
psql bomb

Execute the SQL code contained in server/src/main/resources/db/migration/V1.0__db-structure.sql to create the tables.

Create the user that the server uses to access the database:

CREATE ROLE bomb WITH PASSWORD 'bomb';
ALTER ROLE bomb WITH LOGIN;
GRANT ALL PRIVILEGES ON DATABASE bomb TO bomb;

Install CLI Python dependencies

Install the dependencies using a virtualenv:

cd cli
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Compile the Java server

cd server
mvn clean package

Generate the Docker images

Generate the base images:

cd server/src/main/resources/static/levels/base

podman build -t linux-bomb-base:en .
podman build --build-arg LANG=it_IT.UTF-8 -t linux-bomb-base:it .
podman build --build-arg LANG=sl_SI.UTF-8 -t linux-bomb-base:sl .

Generate the level images:

cd ../1/
podman build -t linux-bomb-n00b:en .
podman build -t linux-bomb-n00b:it -f Dockerfile.it .
podman build -t linux-bomb-n00b:sl -f Dockerfile.sl .

cd ../2/
podman build -t linux-bomb-explorer:en .
podman build -t linux-bomb-explorer:it -f Dockerfile.it .
podman build -t linux-bomb-explorer:sl -f Dockerfile.sl .

cd ../3/
podman build -t linux-bomb-ninja:en .
podman build -t linux-bomb-ninja:it -f Dockerfile.it .
podman build -t linux-bomb-ninja:sl -f Dockerfile.sl .

Start the server

cd server
java -jar target/bomb-0.0.1-SNAPSHOT.jar