- Default CORS_ORIGINS to http://localhost:5173 instead of "*" (still overridable) - Reject ".." and leading "/" in document keys/paths across get/save/delete/upload, mapped to HTTP 400 via new InvalidPathError - Add a delete button to DocumentEditor wired to deleteDocument + onDeleted, giving the existing DELETE API an actual UI entry point - Share a single lru_cache'd Meilisearch (and Minio) SDK client instance instead of constructing duplicates in dependencies.py - Add a startup check that creates the MinIO bucket if missing, tolerating MinIO being unreachable at boot without crashing the app
17 lines
734 B
Python
17 lines
734 B
Python
import os
|
|
|
|
|
|
class Settings:
|
|
def __init__(self):
|
|
self.minio_endpoint = os.environ.get("MINIO_ENDPOINT", "localhost:9000")
|
|
self.minio_access_key = os.environ.get("MINIO_ACCESS_KEY", "minioadmin")
|
|
self.minio_secret_key = os.environ.get("MINIO_SECRET_KEY", "minioadmin")
|
|
self.minio_bucket = os.environ.get("MINIO_BUCKET", "dochub")
|
|
self.meilisearch_host = os.environ.get("MEILISEARCH_HOST", "http://localhost:7700")
|
|
self.meilisearch_api_key = os.environ.get("MEILISEARCH_API_KEY", "")
|
|
self.meilisearch_index = os.environ.get("MEILISEARCH_INDEX", "documents")
|
|
self.cors_origins = os.environ.get("CORS_ORIGINS", "http://localhost:5173").split(",")
|
|
|
|
|
|
settings = Settings()
|