addon
This commit is contained in:
0
backend/app/core/__init__.py
Normal file → Executable file
0
backend/app/core/__init__.py
Normal file → Executable file
25
backend/app/core/config.py
Normal file → Executable file
25
backend/app/core/config.py
Normal file → Executable file
@@ -13,13 +13,29 @@ class Settings(BaseSettings):
|
||||
API_TOKEN: str = os.getenv("API_TOKEN", "CHANGE_ME_INSECURE_DEFAULT")
|
||||
API_PREFIX: str = "/api"
|
||||
|
||||
# Database
|
||||
# Database - Main (Benchmarks)
|
||||
DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite:///./backend/data/data.db")
|
||||
|
||||
# Database - Peripherals (Separate DB)
|
||||
PERIPHERALS_DB_URL: str = os.getenv("PERIPHERALS_DB_URL", "sqlite:///./backend/data/peripherals.db")
|
||||
|
||||
# Module Peripherals
|
||||
PERIPHERALS_MODULE_ENABLED: bool = os.getenv("PERIPHERALS_MODULE_ENABLED", "true").lower() == "true"
|
||||
|
||||
# Upload configuration
|
||||
UPLOAD_DIR: str = os.getenv("UPLOAD_DIR", "./uploads")
|
||||
PERIPHERALS_UPLOAD_DIR: str = os.getenv("PERIPHERALS_UPLOAD_DIR", "./uploads/peripherals")
|
||||
MAX_UPLOAD_SIZE: int = 50 * 1024 * 1024 # 50 MB
|
||||
|
||||
# Image compression
|
||||
IMAGE_COMPRESSION_ENABLED: bool = True
|
||||
IMAGE_COMPRESSION_QUALITY: int = 85
|
||||
IMAGE_MAX_WIDTH: int = 1920
|
||||
IMAGE_MAX_HEIGHT: int = 1080
|
||||
THUMBNAIL_SIZE: int = 48
|
||||
THUMBNAIL_QUALITY: int = 75
|
||||
THUMBNAIL_FORMAT: str = "webp"
|
||||
|
||||
# CORS
|
||||
CORS_ORIGINS: list = ["*"] # For local network access
|
||||
|
||||
@@ -29,10 +45,11 @@ class Settings(BaseSettings):
|
||||
APP_DESCRIPTION: str = "Self-hosted benchmarking and hardware inventory for Linux machines"
|
||||
|
||||
# Score weights for global score calculation
|
||||
SCORE_WEIGHT_CPU: float = 0.30
|
||||
# CPU weight is double the base weight (0.40 vs 0.20)
|
||||
SCORE_WEIGHT_CPU: float = 0.40
|
||||
SCORE_WEIGHT_MEMORY: float = 0.20
|
||||
SCORE_WEIGHT_DISK: float = 0.25
|
||||
SCORE_WEIGHT_NETWORK: float = 0.15
|
||||
SCORE_WEIGHT_DISK: float = 0.20
|
||||
SCORE_WEIGHT_NETWORK: float = 0.10
|
||||
SCORE_WEIGHT_GPU: float = 0.10
|
||||
|
||||
class Config:
|
||||
|
||||
0
backend/app/core/security.py
Normal file → Executable file
0
backend/app/core/security.py
Normal file → Executable file
Reference in New Issue
Block a user