From 10d6ddead98b44562d6460c0e12c5d5ecf4bf3c8 Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Mon, 27 Oct 2025 00:34:30 +0200 Subject: [PATCH] Fix default BACKEND_URL port from 8001 to 8000 for production MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change hardcoded default backend URL from development port (8001) to production port (8000) in Telegram bot API client. This fixes the issue where Telegram bot would try to connect to wrong port when BACKEND_URL environment variable is not properly loaded from .env file, causing "Cannot connect to backend" errors during account linking. Root cause: When .env file is not loaded correctly by Windows Service, the code falls back to the hardcoded default value which was incorrectly set to the development port 8001 instead of production port 8000. Changes: - reports-app/telegram-bot/app/api/client.py: Change default from 8001 to 8000 - Add comment explaining this is for production deployment This ensures the bot connects to the correct backend port even if .env configuration has issues during service startup on Windows Server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- reports-app/telegram-bot/app/api/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reports-app/telegram-bot/app/api/client.py b/reports-app/telegram-bot/app/api/client.py index 6ba46db..a802d7b 100644 --- a/reports-app/telegram-bot/app/api/client.py +++ b/reports-app/telegram-bot/app/api/client.py @@ -16,7 +16,8 @@ from httpx import AsyncClient, Response, HTTPError, ConnectError logger = logging.getLogger(__name__) # Backend configuration from environment -BACKEND_URL = os.getenv("BACKEND_URL", "http://localhost:8001") +# Default to port 8000 (production) instead of 8001 (development) +BACKEND_URL = os.getenv("BACKEND_URL", "http://localhost:8000") REQUEST_TIMEOUT = float(os.getenv("API_TIMEOUT", "30.0")) # 30 seconds default