feat: improve app security and error handling
Improve overall app security by: - using dynamic statements for all sql querries - introducing environment variables for initial admin password - introducing enironment variable for cors address - improving error handling
This commit is contained in:
parent
95057c1b8d
commit
3ac1947106
11 changed files with 1333 additions and 453 deletions
22
README.md
22
README.md
|
|
@ -140,7 +140,7 @@ http://localhost:8080
|
|||
**Standard-Anmeldedaten:**
|
||||
|
||||
- Benutzername: `admin`
|
||||
- Passwort: `admin123`
|
||||
- Passwort: Das in `docker-compose.yml` unter `INITIAL_ADMIN_PASSWORD` festgelegte Passwort.
|
||||
|
||||
⚠️ **WICHTIG**: Ändern Sie das Admin-Passwort sofort nach der ersten Anmeldung!
|
||||
|
||||
|
|
@ -179,13 +179,15 @@ export JWT_SECRET=development-secret
|
|||
|
||||
### Umgebungsvariablen
|
||||
|
||||
| Variable | Beschreibung | Standard | Erforderlich |
|
||||
| ------------- | ------------------------------- | ------------------- | ------------ |
|
||||
| `PORT` | HTTP-Server Port | `8080` | Nein |
|
||||
| `DB_PATH` | Pfad zur SQLite-Datenbank | `./timetracking.db` | Nein |
|
||||
| `JWT_SECRET` | Geheimnis für JWT-Token | - | **Ja** |
|
||||
| `TZ` | Zeitzone | `Europe/Berlin` | Nein |
|
||||
| `ENVIRONMENT` | `production` für HTTPS-Redirect | - | Nein |
|
||||
| Variable | Beschreibung | Standard | Erforderlich |
|
||||
| ------------------------ | ------------------------------------------------ | --------------------------------- | ------------ |
|
||||
| `PORT` | HTTP-Server Port | `8080` | Nein |
|
||||
| `DB_PATH` | Pfad zur SQLite-Datenbank | `./timetracking.db` | Nein |
|
||||
| `JWT_SECRET` | Geheimnis für JWT-Token | - | **Ja** |
|
||||
| `INITIAL_ADMIN_PASSWORD` | Initiales Passwort für den Admin-Benutzer | `changeme` | **Ja** |
|
||||
| `TZ` | Zeitzone | `Europe/Berlin` | Nein |
|
||||
| `ENVIRONMENT` | `production` für HTTPS-Redirect und striktes CORS | `development` | Nein |
|
||||
| `CORS_ALLOWED_ORIGINS` | Komma-getrennte Liste von erlaubten Origins | `*` (in dev), `http://localhost:8080` (in prod) | Nein |
|
||||
|
||||
### Docker-Volumes
|
||||
|
||||
|
|
@ -203,7 +205,7 @@ Die Datenbank wird unter `/data/timetracking.db` im Container gespeichert.
|
|||
|
||||
### Ersteinrichtung als Administrator
|
||||
|
||||
1. **Anmelden** mit den Standard-Credentials (admin/admin123)
|
||||
1. **Anmelden** mit den Standard-Credentials (admin/das initiale Passwort aus der Konfiguration)
|
||||
|
||||
2. **Admin-Passwort ändern**:
|
||||
- Gehe zu "Benutzer" Tab
|
||||
|
|
@ -311,7 +313,7 @@ Benutzer-Anmeldung
|
|||
```json
|
||||
{
|
||||
"username": "admin",
|
||||
"password": "admin123"
|
||||
"password": "<your-initial-admin-password>"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue