/ scripts / diagnose-dev.sh.bak
diagnose-dev.sh.bak
  1  #!/bin/bash
  2  set -e
  3  
  4  echo "============================"
  5  echo "🩺 FOLD STACK DIAGNOSTICS"
  6  echo "============================"
  7  
  8  echo ""
  9  echo "📁 Current Directory:"
 10  pwd
 11  
 12  echo ""
 13  echo "📦 Docker Compose File Check: docker-compose.dev.yml"
 14  if grep -q "^services:" docker-compose.dev.yml; then
 15    echo "✅ docker-compose.dev.yml looks valid."
 16  else
 17    echo "⚠️  Missing 'services:' in docker-compose.dev.yml — check formatting."
 18  fi
 19  
 20  echo ""
 21  echo "📋 Containers Status:"
 22  docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
 23  
 24  echo ""
 25  echo "🪵 Nginx Logs (last 20 lines):"
 26  docker logs nginx_dev --tail=20 || echo "⚠️  Nginx container not found."
 27  
 28  echo ""
 29  echo "🪵 Flame Dashboard Logs (last 20 lines):"
 30  docker logs flame_dashboard_dev --tail=20 || echo "⚠️  Flame container not found."
 31  
 32  echo ""
 33  echo "🪵 Forgejo Logs (last 50 lines):"
 34  docker logs forgejo_dev --tail=50 || echo "⚠️  Forgejo container not found."
 35  
 36  echo ""
 37  echo "🪵 Ghost Logs (last 20 lines):"
 38  docker logs ghost_dev --tail=20 || echo "⚠️  Ghost container not found."
 39  
 40  echo ""
 41  echo "🪵 Trilium Logs (last 20 lines):"
 42  docker logs trilium_dev --tail=20 || echo "⚠️  Trilium container not found."
 43  
 44  echo ""
 45  echo "🪵 HedgeDoc Logs (last 20 lines):"
 46  docker logs hedgedoc_dev --tail=20 || echo "⚠️  HedgeDoc container not found."
 47  
 48  echo ""
 49  echo "🪵 MailHog Logs (last 20 lines):"
 50  docker logs mailhog_dev --tail=20 || echo "⚠️  MailHog container not found."
 51  
 52  echo ""
 53  echo "🪵 Nextcloud Logs (last 20 lines):"
 54  docker logs nextcloud_dev --tail=20 || echo "⚠️  Nextcloud container not found."
 55  
 56  echo ""
 57  echo "🪵 Rclone Logs (last 20 lines):"
 58  docker logs rclone_dev --tail=20 || echo "⚠️  Rclone container not found."
 59  
 60  echo ""
 61  echo "🌐 Port Bindings:"
 62  docker compose -f docker-compose.dev.yml port nginx 80 || echo "❌ Nginx not exposing port 80"
 63  docker compose -f docker-compose.dev.yml port flame_dashboard 5005 || echo "❌ Flame Dashboard not exposing port 5005"
 64  docker compose -f docker-compose.dev.yml port ghost 2368 || echo "❌ Ghost not exposing port 2368"
 65  docker compose -f docker-compose.dev.yml port forgejo 3000 || echo "❌ Forgejo not exposing port 3000"
 66  docker compose -f docker-compose.dev.yml port trilium 8080 || echo "❌ Trilium not exposing port 8080"
 67  docker compose -f docker-compose.dev.yml port hedgedoc 3000 || echo "❌ HedgeDoc not exposing port 3000"
 68  docker compose -f docker-compose.dev.yml port mailhog 8025 || echo "❌ MailHog not exposing port 8025"
 69  docker compose -f docker-compose.dev.yml port nextcloud 80 || echo "❌ Nextcloud not exposing port 80"
 70  
 71  echo ""
 72  echo "🔒 Forgejo Volume Permissions:"
 73  ls -ld ./volumes/forgejo || echo "❌ Missing volumes/forgejo"
 74  ls -la ./volumes/forgejo || echo "⚠️  Contents not accessible"
 75  
 76  echo ""
 77  echo "🔒 Trilium Volume Permissions:"
 78  ls -ld ./volumes/trilium || echo "❌ Missing volumes/trilium"
 79  ls -la ./volumes/trilium || echo "⚠️  Contents not accessible"
 80  
 81  echo ""
 82  echo "🔒 HedgeDoc Volume Permissions:"
 83  ls -ld ./volumes/hedgedoc/uploads || echo "❌ Missing volumes/hedgedoc/uploads"
 84  ls -la ./volumes/hedgedoc/uploads || echo "⚠️  Contents not accessible"
 85  
 86  echo ""
 87  echo "🔒 Nextcloud Volume Permissions:"
 88  ls -ld ./volumes/nextcloud/html || echo "❌ Missing volumes/nextcloud/html"
 89  ls -la ./volumes/nextcloud/html || echo "⚠️  Contents not accessible"
 90  ls -ld ./volumes/nextcloud/data || echo "❌ Missing volumes/nextcloud/data"
 91  ls -la ./volumes/nextcloud/data || echo "⚠️  Contents not accessible"
 92  
 93  echo ""
 94  echo "🔒 Flame Volume Permissions:"
 95  ls -ld ./volumes/flame || echo "❌ Missing volumes/flame"
 96  ls -la ./volumes/flame || echo "⚠️  Contents not accessible"
 97  
 98  echo ""
 99  echo "🧠 Entrypoint Script Check (forgejo-entrypoint.sh):"
100  head -n 10 scripts/forgejo-entrypoint.sh || echo "⚠️  Missing entrypoint script"
101  
102  echo ""
103  echo "📜 Environment Variables (.env.dev):"
104  if [ -f .env.dev ]; then
105    cat .env.dev | grep -v '^#'
106  else
107    echo "⚠️  .env.dev not found."
108  fi
109  
110  echo ""
111  echo "✅ All checks completed."
112  echo "If you're still seeing issues, review logs above or run:"
113  echo "  docker compose logs -f [service]"