mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-21 06:03:50 +00:00
[enh/venv]: feat(install): introduce venv-based runtime setup with proper permissions
Replace the implicit dependency on system-wide Python packages with a dedicated virtual environment and explicit runtime dependency management. Changes: - Create a project-local Python venv during installation - Install runtime dependencies explicitly via requirements-runtime.txt - Fix ModuleNotFoundError issues in isolated environments (e.g. requests) - Detect the actual user when running via sudo (SUDO_USER) - Assign correct ownership to the BOSWatch directory for venv usage - Apply setgid (2775) to the log directory so files created with sudo remain manageable by the user - Set explicit permissions for Python scripts and config files This ensures a reproducible, system-independent installation and prevents permission issues during runtime and log creation.
This commit is contained in:
parent
7d4cb57a6e
commit
a3f429cbf4
7 changed files with 108 additions and 44 deletions
|
|
@ -79,7 +79,8 @@ Eine Auflistung der bereitgestellten Informationen findet sich im entsprechenden
|
|||
**Bitte beachten:**
|
||||
|
||||
- Selbst vom Modul hinzugefügte Felder **müssen** in der Modul Dokumentation unter `Paket Modifikation` aufgeführt werden.
|
||||
- Sollte ein Modul oder Plugin Felder benutzen, welche in einem anderen Modul erstellt werden, **muss** dies im Punkt `Abhänigkeiten` des jeweiligen Moduls oder Plugins dokumentiert werden.
|
||||
- Sollte ein Modul oder Plugin Felder benutzen, welche in einem anderen Modul erstellt werden, **muss** dies im Punkt `Abhängigkeiten` des jeweiligen Moduls oder Plugins dokumentiert werden.
|
||||
- Benötigt das Modul Bibliotheken, welche **nicht** standardmäßig in Python geliefert werden, **muss** dies unter `Externe Abhängigkeiten` vermerkt sein. ZUSÄTZLICH **muss** die Bibliothek in die `requirements-runtime.txt` eingetragen werden.
|
||||
|
||||
### Rückgabewert bei Modulen
|
||||
Module können Pakete beliebig verändern. Diese Änderungen werden im Router entsprechend weitergeleitet.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ cd /opt/boswatch3
|
|||
|
||||
Das Installationsskript `install_service.py` wird anschließend mit Root-Rechten ausgeführt:
|
||||
```bash
|
||||
sudo python3 install_service.py
|
||||
sudo /opt/boswatch3/venv/bin/python3 install_service.py
|
||||
```
|
||||
Es folgt ein interaktiver Ablauf, bei dem du gefragt wirst, welche YAML-Dateien installiert oder entfernt werden sollen.
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ cd /opt/boswatch3
|
|||
After that, run the install script `install_service.py` with root permissions:
|
||||
|
||||
```bash
|
||||
sudo python3 install_service.py -l en
|
||||
sudo /opt/boswatch3/venv/bin/python3 install_service.py -l en
|
||||
```
|
||||
|
||||
You will be guided through an interactive selection to install or remove desired services.
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ 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
|
||||
sudo /opt/boswatch3/venv/bin/python3 bw_client.py -c client.yaml
|
||||
sudo /opt/boswatch3/venv/bin/python3 bw_server.py -c server.yaml
|
||||
```
|
||||
|
||||
## Optional: Als Dienst einrichten
|
||||
|
|
@ -17,8 +17,8 @@ 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
|
||||
sudo /opt/boswatch3/venv/bin/python3 bw_client.py -c client.yaml
|
||||
sudo /opt/boswatch3/venv/bin/python3 bw_server.py -c server.yaml
|
||||
```
|
||||
|
||||
## Optional: Setup as a Service
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue