changed README
This commit is contained in:
parent
7a1094c733
commit
8d691f994e
1 changed files with 92 additions and 87 deletions
179
README.md
179
README.md
|
|
@ -1,102 +1,101 @@
|
|||
# Luanti-Web: A dynamic website-toolkit
|
||||
# Luanti-Web: Ein dynamisches Webseiten-Toolkit
|
||||
|
||||
Welcome to the Luanti Web Generator! Born from a passion for creative sandbox gaming, this hobby project provides a powerful, automated toolkit for generating a beautiful and feature-rich static website for your Minetest or Luanti server. Showcase your server, worlds, track your players, and inform your community.
|
||||
Willkommen beim Luanti Web Generator! Entstanden aus einer Leidenschaft für kreative Sandbox-Spiele, bietet dieses Hobby-Projekt ein leistungsstarkes, automatisiertes Toolkit zur Erstellung einer schönen und funktionsreichen statischen Webseite für Ihren Minetest- oder Luanti-Server. Präsentieren Sie Ihren Server, Ihre Welten, verfolgen Sie Ihre Spieler und informieren Sie Ihre Community.
|
||||
|
||||
This system is designed from the ground up to be modular, easily configurable, and perfect for small communities who want web presence without the hassle.
|
||||
Dieses System ist von Grund auf so konzipiert, dass es modular, leicht konfigurierbar und perfekt für kleine Gemeinschaften ist, die ohne großen Aufwand eine Webpräsenz wünschen.
|
||||
|
||||
## ✨ Features
|
||||
|
||||
* **Automated Map Generation:** Leverages `minetestmapper` to create high-resolution PNG maps of your game worlds.
|
||||
* **Tiled Map Generation:** Uses `gdal2tiles.py` to create performant, zoomable map tiles for a smooth user experience.
|
||||
* **Dynamic Map Viewer:** Implements an interactive map viewer using [Leaflet.js](https://leafletjs.com/), powered by the generated map tiles.
|
||||
* **Live Player Tracking:** Dynamically fetches and displays player locations as markers on the live map.
|
||||
* **Map Archive:** Automatically saves a daily snapshot of the map and makes it available through a dropdown viewer on the world detail page.
|
||||
* **Template-Driven Site Generation:** Builds all static HTML pages from simple, customizable templates.
|
||||
* **Flexible Configuration:** Configuration is easy with a central global config and a sub-config file for every of your worlds.
|
||||
* **Automation-Ready:** Designed for unattended execution via scheduling tools like cron.
|
||||
* **Automatisierte Kartenerstellung:** Nutzt `minetestmapper`, um hochauflösende PNG-Karten Ihrer Spielwelten zu erstellen.
|
||||
* **Performante Bildverarbeitung:** Verwendet `vips`, eine extrem schnelle und speichereffiziente Bibliothek, um auch riesige Karten (getestet bis 64k x 64k Pixel) für das Web zu skalieren.
|
||||
* **Gekachelte Kartenerstellung:** Nutzt `gdal2tiles.py`, um performante, zoombare Kartenkacheln für ein flüssiges Benutzererlebnis zu erstellen.
|
||||
* **Dynamischer Karten-Viewer:** Implementiert einen interaktiven Karten-Viewer mit **OpenLayers**, angetrieben von den generierten Kartenkacheln, inklusive digitalem Zoom über die höchste Auflösung hinaus.
|
||||
* **Live-Spieler-Tracking:** Lädt dynamisch Spielerpositionen und zeigt sie als Marker auf der Live-Karte an, inklusive individuell gestalteter Popups.
|
||||
* **Karten-Archiv:** Speichert automatisch einen täglichen Snapshot der Karte und macht ihn über eine Dropdown-Auswahl auf der Welt-Detailseite verfügbar.
|
||||
* **Vorlagen-gesteuerte Seitengenerierung:** Baut alle statischen HTML-Seiten aus einfachen, anpassbaren Vorlagen.
|
||||
* **Flexible Konfiguration:** Einfache Konfiguration durch eine zentrale, globale `config.sh` und eine `web.conf`-Datei für jede Ihrer Welten.
|
||||
* **Automatisierungs-bereit:** Konzipiert für die unbeaufsichtigte Ausführung über Planungswerkzeuge wie `cron`.
|
||||
|
||||
## 🔧 Prerequisites
|
||||
## 🔧 Voraussetzungen
|
||||
|
||||
To run this system, the following software packages must be installed on your server:
|
||||
Um dieses System zu betreiben, müssen die folgenden Softwarepakete auf Ihrem Server installiert sein:
|
||||
|
||||
* **bash:** The scripting language used for the entire project.
|
||||
* **ImageMagick:** Required for `identify` (to read image dimensions) and `convert` (to resize images).
|
||||
* **bash:** Die Skriptsprache, die für das gesamte Projekt verwendet wird.
|
||||
* **vips:** Eine hochperformante Bildverarbeitungsbibliothek, die `convert` (ImageMagick) ersetzt.
|
||||
* *Debian/Ubuntu Install:* `sudo apt-get install libvips-tools`
|
||||
* **ImageMagick:** Wird aktuell noch für den Befehl `identify` (zum Auslesen von Bilddimensionen) benötigt.
|
||||
* *Debian/Ubuntu Install:* `sudo apt-get install imagemagick`
|
||||
* **GDAL/OGR:** Provides the `gdal2tiles.py` script for tile generation.
|
||||
* **GDAL/OGR:** Stellt das `gdal2tiles.py`-Skript für die Kachelerstellung bereit.
|
||||
* *Debian/Ubuntu Install:* `sudo apt-get install gdal-bin python3-gdal`
|
||||
* **minetestmapper:** The executable used to render maps from world data. This must be placed within the project directory.
|
||||
* **Web Server:** A web server like Nginx or Apache is needed to serve the generated static files.
|
||||
* **minetestmapper:** Das ausführbare Programm zur Erstellung der Karten aus den Weltdaten. Muss im Projektverzeichnis platziert werden.
|
||||
* **iproute2:** Stellt das `ss`-Kommando für den `check_server_status.sh` bereit (auf den meisten Systemen vorinstalliert).
|
||||
* **Webserver:** Ein Webserver wie Nginx oder Apache wird benötigt, um die generierten statischen Dateien auszuliefern.
|
||||
|
||||
Ein mitgeliefertes Skript (`check_dependencies.sh`) kann alle wichtigen Abhängigkeiten automatisch überprüfen.
|
||||
|
||||
## ⚙️ Installation & Setup
|
||||
|
||||
### 1. Clone the Repository
|
||||
### 1. Projektdateien herunterladen/klonen
|
||||
|
||||
Download the **latest build** from the [Releases-Page](https://git.geigernet.eu/rainer/luanti-web/releases) and save it to your server's base directory, such as `/opt/luweb/`.
|
||||
Laden Sie den **letzten Build** von der [Releases-Seite](https://git.geigernet.eu/rainer/luanti-web/releases) herunter und entpacken Sie ihn in ein Basisverzeichnis auf Ihrem Server, z.B. `/opt/luweb/`.
|
||||
|
||||
OR
|
||||
ODER
|
||||
|
||||
Clone all project files to a base directory on your server.
|
||||
|
||||
```
|
||||
git clone https://git.geigernet.eu/rainer/luanti-web.git /opt/luweb
|
||||
cd /opt/luweb
|
||||
chmod +x generate_map.sh generate_site.sh
|
||||
```
|
||||
|
||||
### 2. Global Configuration
|
||||
|
||||
The main configuration file is `config.sh`. You must edit this file to match your server's environment.
|
||||
|
||||
**Key variables in `config.sh`:**
|
||||
|
||||
* `BASE_SCRIPT_DIR`: The root directory of the project (e.g., `/opt/luweb`).
|
||||
* `MINETESTMAPPER_WORLD_DATA_BASE_PATH`: The path to your Minetest/Luanti worlds' data directory (e.g., `<server-path>/worlds/`), docker compatible.
|
||||
* `WEB_ROOT_PATH`: The document root of your website where the generated files will be placed (e.g., `/var/www/your-domain.com/web`).
|
||||
* `LOG_DIR_BASE`: The directory where log files will be written (e.g., `/var/log/luweb`).
|
||||
|
||||
### 3. Per-World Configuration
|
||||
|
||||
For each world you want to feature on the website, a `web.conf` file must exist within that world's data directory (e.g., `<server-path>/worlds/my_world/web.conf`). This file allows you to override global defaults with world-specific settings.
|
||||
|
||||
A minimal `web.conf` could look like this and is automatically created for every detected world in your `MINETESTMAPPER_WORLD_DATA_BASE_PATH`:
|
||||
Klonen Sie das Git-Repository in ein Basisverzeichnis.
|
||||
|
||||
```bash
|
||||
# Display name for the world
|
||||
WORLD_DISPLAY_NAME="My Creative World"
|
||||
|
||||
# Server connection details
|
||||
SERVER_ADDRESS="your-server.com"
|
||||
SERVER_PORT="30001"
|
||||
|
||||
# A short description for the world overview page
|
||||
WORLD_SHORT_DESCRIPTION="A brief, catchy description of this world."
|
||||
|
||||
# A detailed HTML description for the world's detail page
|
||||
WORLD_LONG_DESCRIPTION="<p>A longer description with <b>HTML</b> support.</p>"
|
||||
git clone https://git.geigernet.eu/rainer/luanti-web.git /opt/luweb
|
||||
cd /opt/luweb
|
||||
# Alle Skripte ausführbar machen
|
||||
chmod +x generate_map.sh generate_site.sh check_server_status.sh check_dependencies.sh
|
||||
```
|
||||
|
||||
## 📂 Directory Structure
|
||||
### 2. Globale Konfiguration
|
||||
|
||||
The system expects the following directory structure:
|
||||
Die Hauptkonfigurationsdatei ist `config.sh`. Sie müssen diese Datei bearbeiten, um sie an die Umgebung Ihres Servers anzupassen.
|
||||
|
||||
**Wichtige Variablen in `config.sh`:**
|
||||
|
||||
* `BASE_SCRIPT_DIR`: Das Wurzelverzeichnis des Projekts (z.B. `/opt/luweb`).
|
||||
* `MINETESTMAPPER_WORLD_DATA_BASE_PATH`: Der Pfad zum Datenverzeichnis Ihrer Minetest/Luanti-Welten.
|
||||
* `WEB_ROOT_PATH`: Das Document-Root Ihrer Webseite, in das die generierten Dateien platziert werden (z.B. `/var/www/IhreDomain.de/web`).
|
||||
* `LOG_DIR_BASE`: Das Verzeichnis, in das Logdateien geschrieben werden (z.B. `/var/log/luweb`).
|
||||
|
||||
### 3. Konfiguration pro Welt
|
||||
|
||||
Das System ist so konzipiert, dass **nur Welten mit einer `web.conf`-Datei** im Web-Frontend angezeigt werden. Dies gibt Ihnen die volle Kontrolle darüber, welche Welten öffentlich sichtbar sind.
|
||||
|
||||
Um eine Welt hinzuzufügen, kopieren Sie die Vorlage `site_generator/examples/web.conf.template` in das Datenverzeichnis der entsprechenden Welt (z.B. `<server-pfad>/worlds/meine_welt/web.conf`) und passen Sie die Werte an.
|
||||
|
||||
## 📂 Verzeichnisstruktur
|
||||
|
||||
Das System verwendet nun eine modulare Struktur, um die Wartbarkeit zu erhöhen:
|
||||
```md
|
||||
/opt/luweb/
|
||||
├── config.sh
|
||||
├── generate_map.sh
|
||||
├── generate_site.sh
|
||||
├── minetestmapper (executable)
|
||||
├── check_server_status.sh
|
||||
├── check_dependencies.sh
|
||||
├── minetestmapper (ausführbare Datei)
|
||||
├── site_generator/
|
||||
│ ├── functions/
|
||||
│ │ ├── 01_utils.sh
|
||||
│ │ ├── 02_init.sh
|
||||
│ │ ├── 03_html_helpers.sh
|
||||
│ │ └── generators/
|
||||
│ │ ├── css_generator.sh
|
||||
│ │ ├── static_pages_generator.sh
|
||||
│ │ ├── world_detail_generator.sh
|
||||
│ │ └── world_overview_generator.sh
|
||||
│ ├── templates/
|
||||
│ │ ├── world_detail_page.template
|
||||
│ │ ├── world_detail_archive.template
|
||||
│ │ └── ...
|
||||
│ └── examples/
|
||||
│ └── web.conf.template
|
||||
├── web_content/
|
||||
│ ├── images/
|
||||
│ │ └── players/
|
||||
│ └── static/
|
||||
│ ├── startseite_content.html
|
||||
│ └── ...
|
||||
└── worldmaps_output/
|
||||
└── <world_name>/
|
||||
├── map.png
|
||||
|
|
@ -105,41 +104,47 @@ The system expects the following directory structure:
|
|||
|
||||
## 🚀 Usage
|
||||
|
||||
The scripts are designed to be run from the command line, either manually or via automated jobs.
|
||||
|
||||
### 1. Map and Tile Generation
|
||||
|
||||
The `generate_map.sh` script creates the map, tiles, and archive images for a specific world. It must be called with the "world key" (the name of the world's directory) as an argument.
|
||||
### 1. Karten- und Daten-Generierung
|
||||
|
||||
Das `generate_map.sh`-Skript erzeugt die Karte, Kacheln und Metadaten für eine spezifische Welt.
|
||||
```bash
|
||||
# Generate map assets for the world located in the 'world' directory
|
||||
# Erzeugt die Assets für die Welt im Verzeichnis 'world'
|
||||
./generate_map.sh world
|
||||
```
|
||||
|
||||
### 2. Website Generation
|
||||
|
||||
The `generate_site.sh` script builds the entire website (overview, detail pages, etc.). It scans all configured world directories and creates a detail page for each one.
|
||||
### 2. Webseiten-Generierung
|
||||
|
||||
Das `generate_site.sh`-Skript baut die gesamte Webseite für alle Welten, die eine `web.conf` besitzen.
|
||||
```bash
|
||||
# Generate the complete website
|
||||
# Generiert die komplette Webseite
|
||||
./generate_site.sh
|
||||
```
|
||||
|
||||
### 3. Automation (Cronjob)
|
||||
|
||||
For fully automatic operation, setting up cronjobs is recommended.
|
||||
|
||||
**Example for `crontab -e`:**
|
||||
### 3. Live-Status-Prüfung
|
||||
|
||||
Das `check_server_status.sh`-Skript prüft den Online-Status aller konfigurierten Welten. Es sollte sehr häufig ausgeführt werden.
|
||||
```bash
|
||||
# Generate map assets for the 'world' every 30 minutes
|
||||
*/30 * * * * /opt/luweb/generate_map.sh world >> /var/log/luweb/cron.log 2>&1
|
||||
|
||||
# Re-build the website every 12 hours
|
||||
* */12 * * * /opt/luweb/generate_site.sh >> /var/log/luweb/cron.log 2>&1
|
||||
# Prüft den Server-Status
|
||||
./check_server_status.sh
|
||||
```
|
||||
|
||||
## 📄 License
|
||||
### 4. Automatisierung (Cronjob)
|
||||
|
||||
Für den vollautomatischen Betrieb wird die Einrichtung von Cronjobs empfohlen.
|
||||
|
||||
**Beispiel für `crontab -e`:**
|
||||
```bash
|
||||
# Generiere die Karten-Assets für 'world' einmal pro Stunde
|
||||
0 * * * * /opt/luweb/generate_map.sh world >> /var/log/luweb/cron.log 2>&1
|
||||
|
||||
# Prüfe den Server-Status alle 2 Minuten
|
||||
*/2 * * * * /opt/luweb/check_server_status.sh >> /var/log/luweb/cron.log 2>&1
|
||||
|
||||
# Baue die Webseite (z.B. für neue Admins, geänderte Beschreibungen) zweimal täglich neu
|
||||
0 */12 * * * /opt/luweb/generate_site.sh >> /var/log/luweb/cron.log 2>&1
|
||||
```
|
||||
|
||||
## 📄 Lizenz
|
||||
**MIT License**
|
||||
Copyright (c) 2025 Rage87 - rage87@geigernet.eu
|
||||
|
||||
|
|
@ -161,5 +166,5 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
## 👤 Authors
|
||||
* **Rage87** (Main-Developer)
|
||||
## 👤 Autoren
|
||||
* **Rage87** (Main-Developer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue