Files
roa2web-service-auto/status.sh
Claude Agent b137e80b71 feat: multi-Oracle server support with runtime switching
Complete implementation of multi-server Oracle database support:

Backend:
- Multi-pool Oracle with lazy loading per server
- Email-to-server cache for automatic server discovery
- JWT tokens include server_id claim
- /auth/check-identity and /auth/check-email endpoints
- /auth/my-servers endpoint for listing user's accessible servers
- Server switch with password re-authentication

Frontend:
- New ServerSelector component for header dropdown
- Multi-step login flow (identity → server → password)
- Server switching from header with password modal
- Mobile drawer menu with server selection
- Dark mode support for all new components
- URL bookmark support with ?server= query param

Scripts:
- Unified start.sh replacing start-prod.sh/start-test.sh
- Unified ssh-tunnel.sh with multi-server support
- Updated status.sh for new architecture

Tests:
- E2E tests for multi-server and single-server login flows
- Backend unit tests for all new endpoints
- Oracle multi-pool integration tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:39:06 +00:00

107 lines
3.6 KiB
Bash
Executable File

#!/bin/bash
# ROA2WEB Ultrathin Monolith - Services Status Overview
# Shows status of unified backend and frontend
# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Source helper functions
source "$SCRIPT_DIR/scripts/service-helpers.sh"
print_header "ROA2WEB Ultrathin Monolith - Services Status"
# SSH Tunnel check
echo -e "${BLUE}━━━ Infrastructure ━━━${NC}"
if check_service_status 1521 "SSH Tunnel (Oracle)"; then
:
else
print_warning "SSH Tunnel not running - Oracle DB connection will fail"
print_info "Start with: ./ssh-tunnel.sh start"
fi
echo ""
# Unified Backend
echo -e "${BLUE}━━━ Unified Backend (port 8000) ━━━${NC}"
if check_service_status 8000 "Unified Backend"; then
# Try health check
echo -e "${CYAN}Health check:${NC}"
health=$(curl -s http://localhost:8000/health 2>&1)
if echo "$health" | grep -q "api"; then
echo "$health" | python3 -m json.tool 2>/dev/null || echo "$health"
print_success "Backend is healthy"
else
print_warning "Health check: Not responding properly"
echo "$health"
fi
# Show module status
echo ""
echo -e "${CYAN}Modules:${NC}"
echo " • Reports API: http://localhost:8000/api/reports/*"
echo " • Data Entry API: http://localhost:8000/api/data-entry/*"
echo " • Telegram API: http://localhost:8000/api/telegram/*"
echo " • Telegram Bot: Running as background task"
else
print_info "Start with: ./start.sh prod (or ./start.sh test for TEST)"
fi
echo ""
# Frontend
echo -e "${BLUE}━━━ Frontend Unified ━━━${NC}"
if check_service_status 3000 "Frontend Unified"; then
print_info "Access at: http://localhost:3000"
else
print_info "Start with: ./start.sh prod (or ./start.sh test for TEST)"
fi
echo ""
# Log files summary
print_header "Log Files"
echo -e "${BLUE}Recent logs (last modified):${NC}"
ls -lht /tmp/unified_backend*.log /tmp/unified_frontend*.log 2>/dev/null | head -10 || print_warning "No log files found"
echo ""
# Quick stats
print_header "Quick Stats"
running_count=0
for port in 1521 8000 3000; do
if netstat -tuln 2>/dev/null | grep -q ":${port} " || ss -tuln 2>/dev/null | grep -q ":${port} "; then
running_count=$((running_count + 1))
fi
done
echo -e "${BLUE}Services running: ${GREEN}${running_count}/3${NC}"
if [ $running_count -eq 3 ]; then
print_success "All services are running!"
elif [ $running_count -ge 2 ]; then
print_warning "Some services are not running"
else
print_error "Most services are offline"
fi
echo ""
# Helpful commands
echo -e "${BLUE}━━━ Helpful Commands ━━━${NC}"
echo " ./status.sh # Show this status"
echo " ./start.sh prod # Start all services (PROD)"
echo " ./start.sh test # Start all services (TEST)"
echo " ./start.sh prod stop # Stop all services"
echo " ./start-backend.sh status # Detailed backend status"
echo " ./start-backend.sh restart # Restart backend only"
echo " ./start-frontend.sh restart # Restart frontend (quick!)"
echo " tail -f /tmp/unified_backend_prod.log # Watch backend logs (PROD)"
echo " tail -f /tmp/unified_backend_test.log # Watch backend logs (TEST)"
echo " tail -f /tmp/unified_frontend_prod.log # Watch frontend logs (PROD)"
echo ""
# API Documentation links
echo -e "${BLUE}━━━ API Documentation ━━━${NC}"
if check_service_status 8000 ""; then
echo " • Unified API Docs: http://localhost:8000/docs"
echo " • Health Endpoint: http://localhost:8000/health"
echo " • Root Endpoint: http://localhost:8000/"
else
echo " (Backend not running)"
fi
echo ""