Zeilenenden vereinheitlicht (LF)

This commit is contained in:
Till Tomczak 2025-05-22 10:08:12 +02:00
parent c0adbad773
commit d457a8d86b
7 changed files with 1253 additions and 188 deletions

9
.gitattributes vendored
View File

@ -1,4 +1,11 @@
frontend/docker/images/*.tar.xz filter=lfs diff=lfs merge=lfs -text
# Standard: alles als Text behandeln und LF speichern
* text=auto eol=lf
# Beispiel für Ausnahmen
*.png binary
*.jpg binary
# Shell-Skripte: immer LF
*.sh text eol=lf

View File

@ -50,3 +50,90 @@ MYP *(Manage your Printer)* ist eine Plattform zur Reservierung von 3D-Druckern,
- `User` ist verknüpft mit `PrintJob`, `Account` und `Session` über Benutzer-ID.
- `Printer` ist verknüpft mit `PrintJob` über die Drucker-ID.
## Installation und Start
### Windows
1. Stellen Sie sicher, dass Docker Desktop installiert und gestartet ist.
2. Öffnen Sie PowerShell und navigieren Sie zum Projektverzeichnis.
3. Führen Sie das Start-Skript aus:
```
.\start.ps1
```
### Linux/Mac
1. Stellen Sie sicher, dass Docker installiert und gestartet ist.
2. Öffnen Sie ein Terminal und navigieren Sie zum Projektverzeichnis.
3. Machen Sie die Skripte ausführbar:
```
chmod +x start.sh cleanup.sh
```
4. Führen Sie das Start-Skript aus:
```
./start.sh
```
## Bereinigung der Umgebung
Um eine vollständige Bereinigung aller Container, Images und Volumes durchzuführen, können Sie folgende Skripte verwenden:
### Windows
```
.\cleanup.ps1
```
### Linux/Mac
```
./cleanup.sh
```
Die Bereinigung kann auch während des Starts der Anwendung durchgeführt werden, wenn alte Container erkannt werden.
## Backend-Interface
Das Backend-Interface ist unter folgenden URLs erreichbar:
- Produktionsumgebung: http://localhost:5000
- Debug-Server: http://localhost:5555
## Frontend-Interface
Das Frontend-Interface ist unter folgenden URLs erreichbar:
- Produktionsumgebung: http://localhost:80 oder https://localhost:443
- Debug-Server: http://localhost:8081
## SSH-Server
Die Start-Skripte sorgen automatisch dafür, dass ein SSH-Server installiert, aktiviert und gestartet wird:
- Unter Linux: Verwendet systemd, um den OpenSSH-Server zu aktivieren und zu starten
- Unter Windows: Installiert und konfiguriert den Windows OpenSSH-Server
Der SSH-Server wird so konfiguriert, dass er automatisch beim Systemstart aktiviert wird, um einen Fernzugriff auf das System zu ermöglichen. Auf Windows-Systemen wird auch eine entsprechende Firewall-Regel erstellt.
### Manuelles Einrichten des SSH-Servers
Falls die automatische Installation fehlschlägt:
#### Linux (Debian/Ubuntu)
```
sudo apt-get update
sudo apt-get install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
```
#### Windows 10/11
1. Öffnen Sie "Einstellungen" > "Apps" > "Optionale Features"
2. Klicken Sie auf "Feature hinzufügen" und wählen Sie "OpenSSH Server"
3. Nach der Installation öffnen Sie PowerShell als Administrator und führen Sie folgende Befehle aus:
```
Set-Service -Name sshd -StartupType Automatic
Start-Service sshd
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (TCP-In)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
```

View File

@ -17,6 +17,9 @@ from datetime import timedelta
from PyP100 import PyP100
from dotenv import load_dotenv
# Importiere Netzwerkkonfiguration
from network_config import NetworkConfig
# Lade Umgebungsvariablen
load_dotenv()
@ -24,6 +27,9 @@ load_dotenv()
app = Flask(__name__)
CORS(app, supports_credentials=True)
# Initialisiere Netzwerkkonfiguration
network_config = NetworkConfig(app)
# Konfiguration
app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'dev_secret_key')
app.config['DATABASE'] = os.environ.get('DATABASE_PATH', 'instance/myp.db')

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,15 @@
Flask==2.0.1
psutil==5.9.0
netifaces==0.11.0
flask==2.2.3
flask-cors==3.0.10
psutil==5.9.4
matplotlib==3.7.1
pandas==1.5.3
requests==2.28.2
netifaces==0.11.0
Werkzeug==2.2.3
docker==6.1.2
pillow==9.4.0
send_file==0.2.0
python-dotenv>=1.0.0
python-logging-loki>=0.3.1
colorama>=0.4.6
pygal>=3.0.0

View File

@ -4,7 +4,9 @@ services:
backend:
build: .
container_name: myp-backend
network_mode: host
networks:
backend_network:
ipv4_address: 192.168.0.5
environment:
- SECRET_KEY=${SECRET_KEY:-7445630171969DFAC92C53CEC92E67A9CB2E00B3CB2F}
- DATABASE_PATH=${DATABASE_PATH:-instance/myp.db}
@ -13,13 +15,25 @@ services:
- "PRINTERS=${PRINTERS:-{\"Printer 1\": {\"ip\": \"192.168.0.100\"}, \"Printer 2\": {\"ip\": \"192.168.0.101\"}, \"Printer 3\": {\"ip\": \"192.168.0.102\"}, \"Printer 4\": {\"ip\": \"192.168.0.103\"}, \"Printer 5\": {\"ip\": \"192.168.0.104\"}, \"Printer 6\": {\"ip\": \"192.168.0.106\"}}}"
- FLASK_APP=app.py
- PYTHONUNBUFFERED=1
- HOST=0.0.0.0
- PORT=5000
ports:
- "5000:5000"
volumes:
- ./logs:/app/logs
- ./instance:/app/instance
restart: unless-stopped
restart: always
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
start_period: 40s
networks:
backend_network:
driver: bridge
ipam:
config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.1

View File

@ -4,4 +4,6 @@ pyjwt==2.8.0
python-dotenv==1.0.0
werkzeug==2.3.7
gunicorn==21.2.0
PyP100==0.0.19
PyP100==0.0.19
netifaces==0.11.0
requests==2.31.0