"feat: Implement SSL Manager for enhanced security in backend"
This commit is contained in:
245
README.md
245
README.md
@ -1 +1,244 @@
|
||||
|
||||
# MYP (Mercedes-Benz Yard Printing) Platform
|
||||
|
||||
Eine vollständige 3D-Drucker-Management-Plattform für Mercedes-Benz Werk 040 Berlin.
|
||||
|
||||
## Schnellstart
|
||||
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
.\myp_installer.ps1
|
||||
```
|
||||
|
||||
### Linux/Unix/macOS
|
||||
|
||||
```bash
|
||||
chmod +x myp_installer.sh
|
||||
./myp_installer.sh
|
||||
```
|
||||
|
||||
## Übersicht
|
||||
|
||||
Die MYP-Plattform ist eine moderne, webbasierte Lösung zur Verwaltung von 3D-Druckern in einer Unternehmensumgebung. Sie bietet:
|
||||
|
||||
- **Drucker-Management**: Überwachung und Steuerung von 3D-Druckern
|
||||
- **Auftragsverwaltung**: Verwaltung von Druckaufträgen und Warteschlangen
|
||||
- **Benutzerauthentifizierung**: GitHub OAuth und lokale Benutzerkonten
|
||||
- **Smart-Plug-Integration**: Automatische Stromsteuerung über TP-Link Tapo-Steckdosen
|
||||
- **SSL/HTTPS-Unterstützung**: Sichere Kommunikation mit selbstsignierten Zertifikaten
|
||||
|
||||
## Architektur
|
||||
|
||||
### Backend
|
||||
|
||||
- **Framework**: Flask (Python)
|
||||
- **Datenbank**: SQLite
|
||||
- **API**: RESTful API mit JSON
|
||||
- **Authentifizierung**: Session-basiert mit Flask-Login
|
||||
- **SSL**: Selbstsignierte Zertifikate
|
||||
|
||||
### Frontend
|
||||
|
||||
- **Framework**: Next.js (React)
|
||||
- **Styling**: Tailwind CSS
|
||||
- **Authentifizierung**: GitHub OAuth
|
||||
- **API-Kommunikation**: Fetch API
|
||||
|
||||
## Installation
|
||||
|
||||
### Automatische Installation
|
||||
|
||||
Die einfachste Methode ist die Verwendung der konsolidierten Installer-Skripte:
|
||||
|
||||
#### Windows (PowerShell)
|
||||
|
||||
```powershell
|
||||
# Als Administrator ausführen für vollständige Funktionalität
|
||||
.\myp_installer.ps1
|
||||
```
|
||||
|
||||
#### Linux/Unix/macOS (Bash)
|
||||
|
||||
```bash
|
||||
# Ausführbar machen
|
||||
chmod +x myp_installer.sh
|
||||
|
||||
# Als Root für vollständige Funktionalität
|
||||
sudo ./myp_installer.sh
|
||||
```
|
||||
|
||||
### Manuelle Installation
|
||||
|
||||
#### Voraussetzungen
|
||||
|
||||
- Python 3.6+ mit pip
|
||||
- Node.js 16+ mit npm
|
||||
- Docker und Docker Compose (optional)
|
||||
- Git
|
||||
|
||||
#### Backend-Setup
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
pip install -r requirements.txt
|
||||
python app/app.py
|
||||
```
|
||||
|
||||
#### Frontend-Setup
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Konfiguration
|
||||
|
||||
### Standard-Zugangsdaten
|
||||
|
||||
- **Admin E-Mail**: admin@mercedes-benz.com
|
||||
- **Admin Passwort**: 744563017196A
|
||||
|
||||
### Umgebungsvariablen
|
||||
|
||||
#### Backend (.env)
|
||||
|
||||
```
|
||||
SECRET_KEY=7445630171969DFAC92C53CEC92E67A9CB2E00B3CB2F
|
||||
DATABASE_PATH=database/myp.db
|
||||
TAPO_USERNAME=till.tomczak@mercedes-benz.com
|
||||
TAPO_PASSWORD=744563017196A
|
||||
SSL_ENABLED=True
|
||||
```
|
||||
|
||||
#### Frontend (.env.local)
|
||||
|
||||
```
|
||||
NEXT_PUBLIC_API_URL=https://localhost:443
|
||||
NEXT_PUBLIC_BACKEND_HOST=localhost
|
||||
NEXT_PUBLIC_BACKEND_PROTOCOL=https
|
||||
GITHUB_CLIENT_ID=7c5d8bef1a5519ec1fdc
|
||||
GITHUB_CLIENT_SECRET=5f1e586204358fbd53cf5fb7d418b3f06ccab8fd
|
||||
```
|
||||
|
||||
## SSL-Zertifikate
|
||||
|
||||
Die Plattform verwendet selbstsignierte SSL-Zertifikate für sichere Kommunikation. Diese werden automatisch von den Installer-Skripten erstellt.
|
||||
|
||||
### Manuelle Zertifikatserstellung
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
python app/create_ssl_cert.py -c instance/ssl/myp.crt -k instance/ssl/myp.key -n localhost
|
||||
```
|
||||
|
||||
## Docker-Deployment
|
||||
|
||||
```bash
|
||||
# Entwicklung
|
||||
docker-compose up -d
|
||||
|
||||
# Produktion
|
||||
docker-compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
## Entwicklung
|
||||
|
||||
### Backend-Entwicklung
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
python app/app.py --debug
|
||||
```
|
||||
|
||||
### Frontend-Entwicklung
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Tests ausführen
|
||||
|
||||
```bash
|
||||
# Backend-Tests
|
||||
cd backend
|
||||
python -m pytest
|
||||
|
||||
# Frontend-Tests
|
||||
cd frontend
|
||||
npm test
|
||||
```
|
||||
|
||||
## API-Dokumentation
|
||||
|
||||
Die REST API ist unter `/api/docs` verfügbar, wenn der Backend-Server läuft.
|
||||
|
||||
### Wichtige Endpunkte
|
||||
|
||||
- `GET /api/printers` - Liste aller Drucker
|
||||
- `POST /api/jobs` - Neuen Druckauftrag erstellen
|
||||
- `GET /api/jobs/{id}` - Auftragsstatus abrufen
|
||||
- `POST /api/auth/login` - Benutzeranmeldung
|
||||
|
||||
## Fehlerbehebung
|
||||
|
||||
### Häufige Probleme
|
||||
|
||||
#### SSL-Zertifikatsfehler
|
||||
|
||||
```bash
|
||||
# Zertifikate neu erstellen
|
||||
python backend/app/create_ssl_cert.py -c backend/instance/ssl/myp.crt -k backend/instance/ssl/myp.key -n localhost
|
||||
```
|
||||
|
||||
#### Port bereits in Verwendung
|
||||
|
||||
```bash
|
||||
# Prozesse auf Port 443 beenden
|
||||
sudo lsof -ti:443 | xargs kill -9
|
||||
```
|
||||
|
||||
#### Datenbankfehler
|
||||
|
||||
```bash
|
||||
# Datenbank zurücksetzen
|
||||
rm backend/database/myp.db
|
||||
python backend/app/models.py
|
||||
```
|
||||
|
||||
## Sicherheit
|
||||
|
||||
- Alle Passwörter sind in `CREDENTIALS.md` dokumentiert
|
||||
- SSL/TLS-Verschlüsselung für alle Verbindungen
|
||||
- Session-basierte Authentifizierung
|
||||
- Rate Limiting für API-Endpunkte
|
||||
|
||||
## Lizenz
|
||||
|
||||
Dieses Projekt ist für den internen Gebrauch bei Mercedes-Benz AG bestimmt.
|
||||
|
||||
## Support
|
||||
|
||||
Bei Problemen oder Fragen wenden Sie sich an das Entwicklungsteam oder erstellen Sie ein Issue im Repository.
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version 3.0
|
||||
|
||||
- Konsolidierte Installer-Skripte
|
||||
- Verbesserte SSL-Unterstützung
|
||||
- GitHub OAuth-Integration
|
||||
- Erweiterte Drucker-Management-Funktionen
|
||||
|
||||
### Version 2.0
|
||||
|
||||
- Frontend-Neugestaltung mit Next.js
|
||||
- REST API-Implementierung
|
||||
- Docker-Unterstützung
|
||||
|
||||
### Version 1.0
|
||||
|
||||
- Grundlegende Drucker-Management-Funktionen
|
||||
- Flask-Backend
|
||||
- SQLite-Datenbank
|
||||
|
Reference in New Issue
Block a user