diff --git a/backend/services/config_service.py b/backend/services/config_service.py index 7775dd1..7d9144d 100644 --- a/backend/services/config_service.py +++ b/backend/services/config_service.py @@ -23,9 +23,10 @@ class AppConfig: @dataclass class PhotoboothConfig: - base_url: str = "http://localhost:8083" + base_url: str = "http://localhost:8000" + public_url: str = "" # URL publique pour les medias (ex: https://photobooth.lessapinsduweb.com) data_dir: str = "/home/pi/photobooth-data" - config_file: str = "/home/pi/.config/photobooth-app/config.json" + config_file: str = "/home/pi/photobooth-data/config/config.json" media_dir: str = "/home/pi/photobooth-data/media/processed_full" userdata_dir: str = "/home/pi/photobooth-data/userdata" show_delete_button: bool = False diff --git a/backend/services/photobooth_service.py b/backend/services/photobooth_service.py index 5d8f2d6..c207161 100644 --- a/backend/services/photobooth_service.py +++ b/backend/services/photobooth_service.py @@ -71,10 +71,12 @@ class PhotoboothService: return False def media_url(self, identifier: str) -> str: - return f"{self._base}/media/full/{identifier}" + base = (self._cfg.public_url.rstrip("/") or self._base) + return f"{base}/media/full/{identifier}" def thumbnail_url(self, identifier: str) -> str: - return f"{self._base}/media/thumbnail/{identifier}" + base = (self._cfg.public_url.rstrip("/") or self._base) + return f"{base}/media/thumbnail/{identifier}" async def read_pb_config(self) -> dict: """Lit le fichier config.json de photobooth-app.""" diff --git a/config/settings.yaml b/config/settings.yaml index 899f56e..59b00e3 100644 --- a/config/settings.yaml +++ b/config/settings.yaml @@ -14,6 +14,7 @@ app: # --- Integration photobooth-app --- photobooth: base_url: "http://localhost:8000" + public_url: "https://photobooth.lessapinsduweb.com" # URL publique pour les medias dans la galerie data_dir: "/home/pi/photobooth-data" config_file: "/home/pi/photobooth-data/config/config.json" media_dir: "/home/pi/photobooth-data/media/processed_full"