Fix: TeleBot order deletion and bot activity tracking

**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 <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-10-06 11:16:32 +01:00
parent 217de2a5ab
commit 9206067e9c
5 changed files with 8 additions and 7 deletions

View File

@ -157,6 +157,7 @@ public class OrdersController : ControllerBase
}
[HttpPost("{id}/cancel")]
[AllowAnonymous]
public async Task<ActionResult> CancelOrder(Guid id, [FromBody] CancelOrderDto cancelOrderDto)
{
var success = await _orderService.CancelOrderAsync(id, cancelOrderDto.IdentityReference);

View File

@ -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

View File

@ -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(

View File

@ -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",

View File

@ -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: