Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions docu/docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# 🇩🇪 Anleitung zur Installation von BOSWatch3
Die Installation von BOSWatch3 wird mittels diesem bash-Skript weitestgehend automatisiert durchgeführt.
## 1. Installationsskript herunterladen
Zunächst wird das aktuelle Installationsskript heruntergeladen
Öffne ein Terminal und führe folgenden Befehl aus:

```bash
wget https://github.com/BOSWatch/BW3-Core/raw/master/install.sh
```

## 2. Installationsskript ausführen
Im Anschluss wird das Skript mit dem Kommando

```bash
sudo bash install.sh
```

ausgeführt.

### 2a. Optionale Parameter beim Installieren
Standardmäßig wird das Programm nach /opt/boswatch3 installiert. Folgende Parameter stehen zur Installation zur Verfügung:

| Parameter | Zulässige Werte | Beschreibung |
| ---------------- | ----------------------- | --------------------------------------------------------------------------------------------------- |
| `-r`, `--reboot` | *(kein Wert notwendig)* | Führt nach der Installation automatisch einen Neustart durch. Ohne Angabe erfolgt **kein** Reboot. |
| `-b`, `--branch` | `master`, `develop` | Wählt den zu installierenden Branch. `master` ist stabil (empfohlen), `develop` ist für Entwickler. |
| `-p`, `--path` | z. B. `/opt/boswatch3` | Installiert BOSWatch3 in ein anderes Verzeichnis (**nicht empfohlen**). Standard ist `/opt/boswatch3`. |

**ACHTUNG:**
Eine Installation von BOSWatch3 in ein anderes Verzeichnis erfordert viele Anpassungen in den Skripten und erhöht das Risiko, dass das Programm zu Fehlern führt. Es wird dazu geraten, das Standardverzeichnis zu benutzen.

Falls eine Installation mit Parameter gewünscht wird, so kann dies wie in folgendem Beispiel gestartet werden:

```bash
sudo bash install.sh --branch master --path /opt/boswatch3 --reboot
```

## 3. Konfiguration nach der Installation
Nach der Installation muss die Konfiguration der Dateien `/opt/boswatch3/config/client.yaml`
und `/opt/boswatch3/config/server.yaml` angepasst werden (z.B. mit nano, WinSCP,...):

```bash
sudo nano /opt/boswatch3/config/client.yaml
```

und

```bash
sudo nano /opt/boswatch3/config/server.yaml
```

Passe die Einstellungen nach deinen Anforderungen an. Bei einem Upgrade einer bestehenden Version kann dieser Schritt ggf. entfallen.

**INFORMATION:**
Weitere Informationen zur Konfiguration:
[Konfiguration](/docu/docs/config.md)

## 4. Neustart
**WICHTIG:**
Bitte starte das System neu, bevor du BOSWatch3 zum ersten Mal startest!

```bash
sudo reboot
```

## 5. Start von BOSWatch3
weiter gehts bei [BOSWatch benutzen](usage.md)

---

# 🇬🇧 BOSWatch3 Installation Guide
The installation of BOSWatch3 is largely automated using this bash script.

## 1. Download the Installation Script
First, download the latest installation script.
Open a terminal and run the following command:

```bash
wget https://github.com/BOSWatch/BW3-Core/raw/master/install.sh
```

## 2. Run the Installation Script
Then run the script with the command:

```bash
sudo bash install.sh
```

### 2a. Optional Parameters for Installation
By default, the program is installed to `/opt/boswatch3`. The following parameters are available for installation:

| Parameter | Allowed Values | Description |
| ---------------- | -----------------------| --------------------------------------------------------------------------------------------------- |
| `-r`, `--reboot` | *(no value needed)* | Automatically reboots the system after installation. Without this, **no** reboot will be performed. |
| `-b`, `--branch` | `master`, `develop` | Selects the branch to install. `master` is stable (recommended), `develop` is for developers. |
| `-p`, `--path` | e.g. `/opt/boswatch3` | Installs BOSWatch3 to a different directory (**not recommended**). Default is `/opt/boswatch3`. |

**WARNING:**
Installing BOSWatch3 to a different directory requires many adjustments in the scripts and increases the risk of errors. It is recommended to use the default directory.

If you want to install with parameters, you can run the following example command:

```bash
sudo bash install.sh --branch master --path /opt/boswatch3 --reboot
```

## 3. Configuration After Installation
After installation, the configuration files `/opt/boswatch3/config/client.yaml`
and `/opt/boswatch3/config/server.yaml` must be adjusted (e.g. using nano, WinSCP, ...):

```bash
sudo nano /opt/boswatch3/config/client.yaml
```

and

```bash
sudo nano /opt/boswatch3/config/server.yaml
```

Adjust the settings according to your requirements. If upgrading from an existing version, this step might be skipped.

**INFORMATION:**
More information about configuration:
[Configuration](/docu/docs/config.md)

## 4. Reboot
**IMPORTANT:**
Please reboot the system before starting BOSWatch3 for the first time!

```bash
sudo reboot
```

## 5. Starting BOSWatch3
Continue with [Using BOSWatch](usage.md)
166 changes: 166 additions & 0 deletions docu/docs/service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# BOSWatch – Dienstinstallation (Service Setup)

## 🇩🇪 BOSWatch als Dienst verwenden
Es wird vorausgesetzt, dass BOSWatch unter `/opt/boswatch3` installiert ist.
Falls du einen anderen Installationspfad nutzt, müssen alle Pfadangaben in dieser Anleitung, im Skript sowie in den generierten Service-Dateien entsprechend angepasst werden.

Für jeden Dienst muss eine eigene `*.yaml`-Datei im Ordner `config/` vorhanden sein.
Beim Ausführen des Skripts wirst du interaktiv gefragt, welche dieser YAML-Dateien installiert oder übersprungen werden sollen.

### Dienst installieren
Als Erstes wechseln wir ins BOSWatch Verzeichnis:

```bash
cd /opt/boswatch3
```

Das Installationsskript `install_service.py` wird anschließend mit Root-Rechten ausgeführt:
```bash
sudo python3 install_service.py
```
Es folgt ein interaktiver Ablauf, bei dem du gefragt wirst, welche YAML-Dateien installiert oder entfernt werden sollen.

### Zusätzliche Optionen (fortgeschrittene Anwender)
Das Skript bietet zusätzliche CLI-Optionen für mehr Kontrolle:

```bash
usage: install_service.py [-h] [--verbose] [--quiet]

Installiert oder entfernt systemd-Services für BOSWatch basierend auf YAML-Konfigurationsdateien.

optional arguments:
-h, --help zeigt diese Hilfe an
--dry-run für Entwickler: führt keine echten Änderungen aus (Simulation)
--verbose zeigt ausführliche Debug-Ausgaben
--quiet unterdrückt alle Ausgaben außer Warnungen und Fehlern
-l, --lang [de|en] Sprache für alle Ausgaben (Standard: de)
```

### Neustart nach Serviceinstallation
Nach Durchlaufen des Skripts boote dein System erneut durch, um den korrekten Startvorgang zu überprüfen:
```bash
sudo reboot
```

### Kontrolle, ob alles funktioniert hat
Um zu kontrollieren, ob alles ordnungsgemäß hochgefahren ist, kannst du die zwei Services mit folgenden Befehlen abfragen und die letzten Log-Einträge ansehen:

1. Client-Service
```bash
sudo systemctl status bw3_[clientname].service
```

Ersetze [clientname] mit dem Namen, den deine client.yaml hat (Standardmäßig: client)

Um das Log zu schließen, "q" drücken.

2. Server-Service
```bash
sudo systemctl status bw3_[servername].service
```

Ersetze [servername] mit dem Namen, den deine server.yaml hat (Standardmäßig: server)

Um das Log zu schließen, "q" drücken.

**Beide Outputs sollten so ähnlich beginnen:**
```text
bw3_client.service - BOSWatch Client
Loaded: loaded (/etc/systemd/system/bw3_client.service; enabled; preset: enabled)
Active: active (running) since Mon 1971-01-01 01:01:01 CEST; 15min 53s ago
```

Falls du in deinen letzten Logzeilen keine Error vorfinden kannst, die auf einen Stopp des Clients bzw. Server hinweisen, läuft das Programm wie gewünscht, sobald du deinen Rechner startest.

### Logdatei
Alle Aktionen des Installationsskripts werden in der Datei log/install/service_install.log protokolliert.

### Hinweis
Nach der Installation oder Entfernung wird systemctl daemon-reexec automatisch aufgerufen, damit systemd die neuen oder entfernten Units korrekt verarbeitet.

---

## 🇬🇧 Use BOSWatch as a Service

We assume that BOSWatch is installed to `/opt/boswatch3`.
If you are using a different path, please adjust all paths in this guide, in the script and in the generated service files accordingly.

Each service requires its own `*.yaml` file inside the `config/` folder.
The script will interactively ask which YAML files to install or skip.

### Install the Service

First, change directory to BOSWatch folder:

```bash
cd /opt/boswatch3
```

After that, run the install script `install_service.py` with root permissions:

```bash
sudo python3 install_service.py -l en
```

You will be guided through an interactive selection to install or remove desired services.

### Additional Options

The script supports additional CLI arguments for advanced usage:

```bash
usage: install_service.py [-h] [--dry-run] [--verbose] [--quiet]

Installs or removes BOSWatch systemd services based on YAML config files.

optional arguments:
-h, --help show this help message and exit
--dry-run simulate actions without making real changes
--verbose show detailed debug output
--quiet suppress all output except warnings and errors
-l, --lang [de|en] Language for all output (default: de)
```

### Reboot After Setup
After running the script, reboot your system to verify that the services start correctly:
```bash
sudo reboot
```

### Verifying Successful Setup
To check if everything started properly, you can query the two services and inspect the most recent log entries:

1. Client Service
```bash
sudo systemctl status bw3_[clientname].service
```

Replace [clientname] with the name of your client.yaml file (default: client).

To close the log, press "q".

2. Server Service
```bash
sudo systemctl status bw3_[servername].service
```

Replace [servername] with the name of your server.yaml file (default: server).

To close the log, press "q".

**Both outputs should start similarly to this:**
```text
bw3_client.service - BOSWatch Client
Loaded: loaded (/etc/systemd/system/bw3_client.service; enabled; preset: enabled)
Active: active (running) since Mon 1971-01-01 01:01:01 CEST; 15min 53s ago
```

If the latest log entries do not show any errors indicating a client or server crash, then the services are running correctly and will automatically start on boot.

### Log File

All actions of the installation script are logged to `log/install/service_install.log`.

### Note

After installation or removal, `systemctl daemon-reexec` is automatically triggered to reload unit files properly.
25 changes: 25 additions & 0 deletions docu/docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 🇩🇪 Start von BOSWatch3
Nach dem Neustart kannst du BOSWatch3 wie folgt starten:

```bash
cd /opt/boswatch3
sudo python3 bw_client.py -c config/client.yaml
sudo python3 bw_server.py -c config/server.yaml
```

## Optional: Als Dienst einrichten
Weiter gehts mit [als Service einrichten](service.md)

---

# 🇬🇧 Starting BOSWatch3
After reboot, you can start BOSWatch3 as follows:

```bash
cd /opt/boswatch3
sudo python3 bw_client.py -c config/client.yaml
sudo python3 bw_server.py -c config/server.yaml
```

## Optional: Setup as a Service
For further instructions, see [Setup as a Service](service.md)
6 changes: 3 additions & 3 deletions docu/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ edit_uri: edit/develop/docu/docs/
nav:
# - BW3: index.md
- Quick Start:
- Installation: tbd.md
- Installation: install.md
- Konfiguration: config.md
# - BOSWatch benutzen: tbd.md
# - Als Service einrichten: tbd.md
- BOSWatch benutzen: usage.md
- Als Service einrichten: service.md
- Informationen:
- Server/Client Prinzip: information/serverclient.md
- Broadcast Service: information/broadcast.md
Expand Down
Loading