refactor: Remove deprecated INTERNAL_API_PORT (ultrathin monolith cleanup)
Architecture cleanup after migration to ultrathin monolith: - Remove INTERNAL_API_PORT from .env files (was port 8002) - Clean up bot_main.py: remove uvicorn, Thread, run_internal_api() - Update validate.md to check /api/telegram/health instead of port 8002 - Add deprecation notices to old Windows deployment docs - Update docs/telegram/README.md with architecture note The Telegram internal API is now served at /api/telegram/internal/* on the main backend port (8000/8001) instead of separate port 8002. Also includes: menu updates, ServerLogsView improvements, script fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
|
||||
set -e # Exit on any error
|
||||
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -164,13 +167,18 @@ else
|
||||
source .env
|
||||
set +a
|
||||
|
||||
# Clear old log files
|
||||
> /tmp/unified_backend_prod.log
|
||||
# Create logs directory if not exists
|
||||
mkdir -p "$SCRIPT_DIR/logs"
|
||||
|
||||
# Clear old log files (use logs/ for ServerLogs UI, keep /tmp for quick access)
|
||||
> "$SCRIPT_DIR/logs/backend-stdout.log"
|
||||
> "$SCRIPT_DIR/logs/backend-stderr.log"
|
||||
> /tmp/unified_frontend_prod.log
|
||||
|
||||
# Start backend with auto-restart on crash (OOM protection)
|
||||
# Logs go to logs/backend-stderr.log for ServerLogs UI
|
||||
print_message "Starting unified backend with auto-restart (includes Reports, Data Entry, and Telegram bot)..."
|
||||
nohup ./run-with-restart.sh 8000 /tmp/unified_backend_prod.log > /dev/null 2>&1 &
|
||||
nohup ./run-with-restart.sh 8000 "$SCRIPT_DIR/logs/backend-stderr.log" > /dev/null 2>&1 &
|
||||
|
||||
cd - > /dev/null
|
||||
|
||||
@@ -192,8 +200,8 @@ else
|
||||
done
|
||||
|
||||
if ! check_port 8000; then
|
||||
print_error "Unified Backend failed to start - check /tmp/unified_backend_prod.log"
|
||||
tail -n 30 /tmp/unified_backend_prod.log
|
||||
print_error "Unified Backend failed to start - check logs/backend-stderr.log"
|
||||
tail -n 30 "$SCRIPT_DIR/logs/backend-stderr.log"
|
||||
cleanup
|
||||
fi
|
||||
fi
|
||||
@@ -253,7 +261,7 @@ echo " • Unified API Docs: http://localhost:8000/docs"
|
||||
echo " • Health Check: http://localhost:8000/health"
|
||||
echo
|
||||
echo -e "${BLUE}Log Files:${NC}"
|
||||
echo " • Unified Backend: /tmp/unified_backend_prod.log"
|
||||
echo " • Unified Backend: logs/backend-stderr.log"
|
||||
echo " • Unified Frontend: /tmp/unified_frontend_prod.log"
|
||||
echo
|
||||
echo -e "${YELLOW}Press Ctrl+C to stop all services${NC}"
|
||||
|
||||
Reference in New Issue
Block a user