#!/bin/bash echo "╔════════════════════════════════════════════════════════════════╗" echo "║ 🎯 TRUSTOS LOCAL INSTANCE STATUS DASHBOARD ║" echo "╚════════════════════════════════════════════════════════════════╝" echo "" MACHINE_IP="10.30.20.38" echo "📍 MACHINE IP: $MACHINE_IP" echo "" # Check Docker services echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🐳 DOCKER SERVICES" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" cd /root/trustos docker-compose ps | tail -5 echo "" # Check Nginx echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🌐 NGINX REVERSE PROXY" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" if systemctl is-active --quiet nginx; then echo "✅ Status: RUNNING" echo " URL: http://$MACHINE_IP" else echo "❌ Status: STOPPED" fi echo "" # Check API Health echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🚀 BACKEND API" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" HEALTH=$(curl -s http://$MACHINE_IP:8000/health | jq -r '.status' 2>/dev/null) if [ "$HEALTH" = "ok" ]; then echo "✅ Status: HEALTHY" echo " URL: http://$MACHINE_IP/api" echo " Docs: http://$MACHINE_IP/docs" curl -s http://$MACHINE_IP:8000/health | jq . else echo "❌ Status: NOT RESPONDING" fi echo "" # Check Frontend echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "💻 FRONTEND" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" FRONTEND=$(curl -s -o /dev/null -w "%{http_code}" http://$MACHINE_IP:3000) if [ "$FRONTEND" = "200" ]; then echo "✅ Status: RUNNING" echo " URL: http://$MACHINE_IP" else echo "❌ Status: NOT RESPONDING (code: $FRONTEND)" fi echo "" # Check Database echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🗄️ DATABASE" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" PSQL_CHECK=$(docker exec trustos_postgres psql -U trustos -d trustos -c "SELECT COUNT(*) FROM users;" 2>/dev/null) if [ $? -eq 0 ]; then USER_COUNT=$(echo "$PSQL_CHECK" | tail -1 | xargs) echo "✅ Status: CONNECTED" echo " Users in system: $USER_COUNT" else echo "❌ Status: NOT RESPONDING" fi echo "" # Check Cloudflare Tunnel echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "☁️ CLOUDFLARE TUNNEL" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" if command -v cloudflared &> /dev/null; then echo "✅ Installed: cloudflared" if systemctl is-active --quiet trustos-tunnel; then echo "✅ Service: RUNNING" TUNNEL_INFO=$(cloudflared tunnel info trustos 2>/dev/null | head -3) echo "$TUNNEL_INFO" else echo "⚠️ Service: STOPPED (run: systemctl start trustos-tunnel)" echo "" echo "To set up tunnel:" echo " 1. cloudflared tunnel login" echo " 2. cloudflared tunnel create trustos" echo " 3. cloudflared tunnel route dns trustos yourcompany.com" echo " 4. systemctl start trustos-tunnel" fi else echo "⚠️ Not installed" fi echo "" # Access Information echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🔗 ACCESS INFORMATION" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Local Access (On-Network):" echo " 📲 Frontend: http://$MACHINE_IP" echo " 🔌 Backend API: http://$MACHINE_IP/api" echo " 📚 API Docs: http://$MACHINE_IP/docs" echo "" echo "Remote Access (Via Cloudflare):" if systemctl is-active --quiet trustos-tunnel; then TUNNEL_ID=$(cloudflared tunnel list 2>/dev/null | grep trustos | awk '{print $1}') echo " 🌐 Tunnel Active: $TUNNEL_ID" echo " 🔗 URL: https://trustos.yourcompany.com (configure DNS)" else echo " ⚠️ Tunnel Not Started" fi echo "" # Demo Credentials echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🔐 DEMO CREDENTIALS" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Executive:" echo " 📧 executive@acmecorp.io" echo " 🔑 TrustOS2024!" echo "" echo "IT Admin:" echo " 📧 it@acmecorp.io" echo " 🔑 TrustOS2024!" echo "" echo "Admin:" echo " 📧 admin@trustos.com" echo " 🔑 TrustOS-Admin-2024!" echo "" # Premium Features Status echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✨ PREMIUM FEATURES" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✅ Board Presentation Autopilot" echo "✅ Insurance Savings Calculator" echo "✅ Predictive Risk Modeling" echo "✅ Workflow Integration (Jira/ServiceNow)" echo "✅ Executive Digital Footprint Monitoring" echo "" echo "╔════════════════════════════════════════════════════════════════╗" echo "║ ✅ SETUP COMPLETE ║" echo "╚════════════════════════════════════════════════════════════════╝"