From 9206067e9cfa41f557b10529377cf4af9d8b25c2 Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Mon, 6 Oct 2025 11:16:32 +0100 Subject: [PATCH] Fix: TeleBot order deletion and bot activity tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Fixes Applied:** 1. **Order Deletion Authorization (HTTP 401)** - Added [AllowAnonymous] to CancelOrder endpoint - Allows customers to cancel orders using IdentityReference - File: LittleShop/Controllers/OrdersController.cs:160 2. **Bot Activity Tracking Hostname** - Changed littleshop-admin:8080 → littleshop:5000 - Fixed DNS resolution errors in production - Files: TeleBot/appsettings.json, BotActivityTracker.cs, docker-compose.hostinger.yml 3. **Tor Proxy Investigation** - Analyzed SOCKS connection failures - Tor is working correctly, API blocks exit nodes (expected) - Fallback to default currencies working as designed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- LittleShop/Controllers/OrdersController.cs | 1 + TeleBot/.env.production.example | 2 +- TeleBot/TeleBot/Services/BotActivityTracker.cs | 2 +- TeleBot/TeleBot/appsettings.json | 2 +- TeleBot/docker-compose.hostinger.yml | 8 ++++---- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/LittleShop/Controllers/OrdersController.cs b/LittleShop/Controllers/OrdersController.cs index 8c0462b..cf0c440 100644 --- a/LittleShop/Controllers/OrdersController.cs +++ b/LittleShop/Controllers/OrdersController.cs @@ -157,6 +157,7 @@ public class OrdersController : ControllerBase } [HttpPost("{id}/cancel")] + [AllowAnonymous] public async Task CancelOrder(Guid id, [FromBody] CancelOrderDto cancelOrderDto) { var success = await _orderService.CancelOrderAsync(id, cancelOrderDto.IdentityReference); diff --git a/TeleBot/.env.production.example b/TeleBot/.env.production.example index ef33da0..e7df67b 100644 --- a/TeleBot/.env.production.example +++ b/TeleBot/.env.production.example @@ -6,7 +6,7 @@ TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here TELEGRAM_ADMIN_CHAT_ID=your_admin_chat_id_here # LittleShop API Configuration -LITTLESHOP_API_URL=http://littleshop-admin:8080 +LITTLESHOP_API_URL=http://littleshop:5000 LITTLESHOP_USERNAME=admin LITTLESHOP_PASSWORD=your_admin_password_here diff --git a/TeleBot/TeleBot/Services/BotActivityTracker.cs b/TeleBot/TeleBot/Services/BotActivityTracker.cs index 2dd76c3..2e22035 100644 --- a/TeleBot/TeleBot/Services/BotActivityTracker.cs +++ b/TeleBot/TeleBot/Services/BotActivityTracker.cs @@ -36,7 +36,7 @@ namespace TeleBot.Services _httpClient = httpClient; _configuration = configuration; _logger = logger; - _littleShopUrl = configuration["LittleShop:BaseUrl"] ?? "http://littleshop-admin:8080"; + _littleShopUrl = configuration["LittleShop:BaseUrl"] ?? "http://littleshop:5000"; } public async Task TrackActivityAsync( diff --git a/TeleBot/TeleBot/appsettings.json b/TeleBot/TeleBot/appsettings.json index 6504299..b7a4ef2 100644 --- a/TeleBot/TeleBot/appsettings.json +++ b/TeleBot/TeleBot/appsettings.json @@ -20,7 +20,7 @@ "Comment": "Optional secret key for webhook authentication" }, "LittleShop": { - "ApiUrl": "http://littleshop-admin:8080", + "ApiUrl": "http://littleshop:5000", "OnionUrl": "", "Username": "admin", "Password": "admin", diff --git a/TeleBot/docker-compose.hostinger.yml b/TeleBot/docker-compose.hostinger.yml index b86df25..258afa9 100644 --- a/TeleBot/docker-compose.hostinger.yml +++ b/TeleBot/docker-compose.hostinger.yml @@ -13,7 +13,7 @@ services: - TelegramBot__BotToken=${BOT_TOKEN} - TelegramBot__WebhookUrl=${WEBHOOK_URL} - TelegramBot__UseWebhook=false - - LittleShopApi__BaseUrl=http://littleshop-admin:8080 + - LittleShopApi__BaseUrl=http://littleshop:5000 - LittleShopApi__ApiKey=${LITTLESHOP_API_KEY} - Logging__LogLevel__Default=Information - Logging__LogLevel__Microsoft=Warning @@ -25,7 +25,7 @@ services: networks: - littleshop-network depends_on: - - littleshop-admin + - littleshop healthcheck: test: ["CMD", "pgrep", "-f", "dotnet.*TeleBot"] interval: 30s @@ -33,9 +33,9 @@ services: retries: 3 start_period: 60s - littleshop-admin: + littleshop: external: true - name: littleshop-admin + name: littleshop networks: littleshop-network: