Dashboard Finished

This commit is contained in:
2025-10-07 08:44:02 +02:00
parent 68d4fc9a36
commit b5a85c610a
6 changed files with 53 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
import os
from pathlib import Path
from typing import Any, Dict
@@ -10,7 +11,15 @@ class DatabaseConfig:
def _load_config(self) -> Dict[str, Any]:
if self.db_type.lower() == "sqlite":
return {"path": os.getenv("SQLITE_PATH", "databases/chatbot.db")}
# Standardpfad relativ zum Projektroot
default_path = Path(__file__).parent.parent / "databases" / "chatbot.db"
sqlite_path = os.getenv("SQLITE_PATH", str(default_path))
# Stelle sicher, dass wir einen absoluten Pfad haben
if not Path(sqlite_path).is_absolute():
sqlite_path = Path.cwd() / sqlite_path
return {"path": str(sqlite_path)}
elif self.db_type.lower() == "mysql":
return {
"host": os.getenv("MYSQL_HOST", "localhost"),