CRITICAL FIXES: - Fixed JWT key configuration issue causing HTTP 500 on login - Changed environment variable from JWT_SECRET_KEY to Jwt__Key (double underscore) - Increased JWT key length to >32 bytes (256 bits) as required by HMAC-SHA256 - Fixed ASPNETCORE_URLS configuration (not ASPNETCORE_HTTP_PORTS) DOCUMENTATION CREATED: - TROUBLESHOOTING.md: Complete troubleshooting guide with common issues and solutions - deploy-littleshop.sh: Automated deployment script with working configuration - docker-compose.hostinger.yml: Docker Compose file with all correct environment variables - Updated WORKING_BASELINE_2024-09-24.md: Added HTTP 500 fix details ROOT CAUSES IDENTIFIED: 1. JWT key environment variable naming mismatch (Jwt__Key vs JWT_SECRET_KEY) 2. JWT key too short (was 17 bytes, needs >32 bytes) 3. ASP.NET Core URL configuration issue (ASPNETCORE_URLS vs HTTP_PORTS) 4. Database file permissions (must be owned by UID 1654) WORKING CONFIGURATION: - Jwt__Key with 79-byte key - ASPNETCORE_URLS=http://+:8080 - Proper Docker network configuration (littleshop-network) - SilverPay integration on port 8000 (not 8001) This commit ensures we have a stable, documented baseline for future updates and addresses the concern about "one step forward, two steps back" by providing comprehensive documentation of all fixes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
6.5 KiB
6.5 KiB
Working Baseline - September 24, 2024
🎯 System Status: FULLY OPERATIONAL
This document captures the current working state of the LittleShop/TeleBot/SilverPay integrated system.
✅ All Systems Working
1. TeleBot - Telegram Bot Interface
- Status: ✅ Operational
- Container:
telebot:latest - Bot: @Littleshop_tom_bot
- Key Fixes Applied:
- ✅ Checkout flow collects all address details in one message (not Step 1/5)
- ✅ No duplicate
/reviewcommands - ✅ Currency display shows proper conversion notes
- ✅ Connected to LittleShop API successfully
- ✅ Tor proxy available via
telebot-torcontainer
2. LittleShop Admin - E-commerce Backend
- Status: ✅ Operational
- URL: https://admin.thebankofdebbie.giize.com
- Container:
littleshop-admin - Key Fixes Applied:
- ✅ CSRF tokens on all forms (delete, update status)
- ✅ Pending Payment orders tab
- ✅ Rebranded to "TeleShop Admin"
- ✅ SilverPay integration fixed (fiat_amount field)
- ✅ Connected to both
littleshop-networkandbridgenetworks - ✅ HTTP 500 Login Fixed: Username parameter case-insensitive
- ✅ JWT Configuration Fixed: Use Jwt__Key environment variable (not JWT_SECRET_KEY)
- ✅ JWT Key Length: Must be > 32 bytes/256 bits
3. SilverPay - Cryptocurrency Payment Gateway
- Status: ✅ Operational
- URL: https://pay.thebankofdebbie.giize.com
- Container:
silverpay-api - Key Fixes Applied:
- ✅ Connected to
littleshop-networkfor container name resolution - ✅ API accepting orders with correct field names
- ✅ Currency conversion working (GBP → BTC/ETH)
- ✅ Generating payment addresses successfully
- ✅ Connected to
🔧 Critical Configuration
Docker Networks
All containers must be on littleshop-network for inter-container communication:
docker network connect littleshop-network [container-name]
Environment Variables (LittleShop) - CRITICAL
ASPNETCORE_ENVIRONMENT=Production
ASPNETCORE_URLS=http://+:8080
ConnectionStrings__DefaultConnection=Data Source=/app/data/littleshop-production.db
Jwt__Key=ThisIsAVeryLongSecretKeyThatIsDefinitelyLongerThan32BytesForSure123456789ABCDEF
SilverPay__BaseUrl=http://silverpay-api:8000
SilverPay__ApiKey=7703aa7a62fa4b40a87e9cfd867f5407147515c0986116ea54fc00c0a0bc30d8
SilverPay__WebhookSecret=Thefa1r1esd1d1twebhooks2024
IMPORTANT: Use Jwt__Key (double underscore) NOT JWT_SECRET_KEY!
API Field Names (SilverPay)
Request must include:
fiat_amount(notamount)fiat_currency(e.g., "GBP")currency(crypto: "BTC", "ETH")external_idwebhook_url
📊 Recent Fixes (Git Commits)
7809b6e- Fix SilverPay payment creation - use fiat_amount instead of amount5013e60- Fix TeleBot compilation errors - use RequiredAmount propertyddff649- Fix TeleBot checkout flow and currency displaybc708bb- Fix missing CSRF tokens in all delete forms6e3c11a- Add Pending Payment tab and rebrand to TeleShop Admin
🧪 Verification Tests
Test 1: Payment Creation
curl -X POST http://silverpay-api:8000/api/v1/orders \
-H "Content-Type: application/json" \
-H "X-API-Key: 7703aa7a62fa4b40a87e9cfd867f5407147515c0986116ea54fc00c0a0bc30d8" \
-d '{
"external_id": "test-001",
"fiat_amount": 10.00,
"fiat_currency": "GBP",
"currency": "BTC",
"webhook_url": "https://admin.thebankofdebbie.giize.com/webhook"
}'
Expected: 200 OK with crypto_amount and payment_address
Test 2: Container Connectivity
docker exec littleshop-admin curl http://silverpay-api:8000/health
Expected: {"status":"healthy"...}
Test 3: TeleBot Order Flow
- Message @Littleshop_tom_bot
- Browse products and add to cart
- Checkout - provides all address details in one message
- Select payment method (BTC/ETH)
- Receive payment address with converted crypto amount
🚀 Deployment Commands
Working Docker Run Command (LittleShop Admin)
docker run -d \
--name littleshop-admin \
--restart unless-stopped \
--network littleshop-network \
-p 127.0.0.1:5100:8080 \
-v /opt/littleshop/data:/app/data \
-v /opt/littleshop/logs:/app/logs \
-v /opt/littleshop/uploads:/app/wwwroot/uploads \
-e ASPNETCORE_ENVIRONMENT=Production \
-e ASPNETCORE_URLS="http://+:8080" \
-e ConnectionStrings__DefaultConnection="Data Source=/app/data/littleshop-production.db" \
-e Jwt__Key="ThisIsAVeryLongSecretKeyThatIsDefinitelyLongerThan32BytesForSure123456789ABCDEF" \
-e SilverPay__BaseUrl="http://silverpay-api:8000" \
-e SilverPay__ApiKey="7703aa7a62fa4b40a87e9cfd867f5407147515c0986116ea54fc00c0a0bc30d8" \
-e SilverPay__WebhookSecret="Thefa1r1esd1d1twebhooks2024" \
littleshop:latest
Restart All Services
# On Hostinger server (srv1002428.hstgr.cloud)
docker restart littleshop-admin
docker restart telebot
docker restart silverpay-api
Check Status
docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "littleshop|telebot|silverpay"
View Logs
docker logs --tail 50 littleshop-admin
docker logs --tail 50 telebot
docker logs --tail 50 silverpay-api
📝 Known Working Configuration
Container Versions (as of Sept 24, 2024)
- LittleShop: Built from commit
7809b6e - TeleBot: Built from commit
7809b6e - SilverPay: localhost:5000/silverpay:latest
Database
- LittleShop: SQLite at
/opt/littleshop/data/littleshop-production.db - SilverPay: PostgreSQL (silverpay-postgres container)
File Permissions
- LittleShop data: owned by UID 1654
- TeleBot data: owned by UID 1001
- Use
chown -R [uid]:[uid] /pathto fix permission issues
⚠️ Critical Points to Remember
- Network Connectivity: Containers must be on the same Docker network
- Field Names: SilverPay expects
fiat_amount, notamount - CSRF Tokens: All forms need
@Html.AntiForgeryToken() - Currency Display: Shows GBP with conversion note for amounts > 1.0
- Checkout Flow: Single message for address, not multi-step
🎉 System Capabilities
Users can now:
- ✅ Browse products via TeleBot
- ✅ Add items to cart
- ✅ Complete checkout with single address entry
- ✅ Select cryptocurrency for payment
- ✅ Receive correct crypto amounts with live exchange rates
- ✅ Get unique payment addresses for each order
- ✅ Admin can manage orders through TeleShop Admin panel
- ✅ View pending payments in dedicated tab
📅 Baseline Date: September 24, 2024, 20:15 UTC
All systems confirmed working at this timestamp.