proxy-oidcv2/setup-wizard.sh
2025-12-03 21:38:43 +01:00

131 lines
3.9 KiB
Bash

#!/bin/bash
# Interactive setup wizard for Secure Proxy
clear
cat << "EOF"
╔════════════════════════════════════════════════════════════════╗
║ ║
║ 🔐 SECURE PROXY - INTERACTIVE SETUP WIZARD ║
║ ║
║ This wizard will guide you through the setup process ║
║ ║
╚════════════════════════════════════════════════════════════════╝
EOF
echo ""
echo "Press ENTER to continue..."
read
# Check Node.js
clear
echo "Step 1/5: Checking Node.js"
echo "════════════════════════════════════════════════════════════"
echo ""
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed!"
echo ""
echo "Please install Node.js 16+ from: https://nodejs.org"
exit 1
else
NODE_VERSION=$(node --version)
echo "✓ Node.js found: $NODE_VERSION"
echo ""
fi
# Check npm
echo "Step 2/5: Checking npm"
echo "════════════════════════════════════════════════════════════"
echo ""
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed!"
exit 1
else
NPM_VERSION=$(npm --version)
echo "✓ npm found: $NPM_VERSION"
echo ""
fi
echo "Press ENTER to continue..."
read
# Install dependencies
clear
echo "Step 3/5: Installing Dependencies"
echo "════════════════════════════════════════════════════════════"
echo ""
echo "Running: npm install"
echo ""
npm install
if [ $? -ne 0 ]; then
echo "❌ Installation failed!"
exit 1
fi
echo ""
echo "✓ Dependencies installed successfully"
echo ""
echo "Press ENTER to continue..."
read
# Initialize database
clear
echo "Step 4/5: Initializing Database"
echo "════════════════════════════════════════════════════════════"
echo ""
echo "Running: npm run init-db"
echo ""
npm run init-db
if [ $? -ne 0 ]; then
echo "❌ Database initialization failed!"
exit 1
fi
echo ""
echo "✓ Database initialized successfully"
echo ""
echo "Press ENTER to continue..."
read
# Summary
clear
echo "Step 5/5: Setup Complete! ✅"
echo "════════════════════════════════════════════════════════════"
echo ""
echo "🎉 Your Secure Proxy is ready!"
echo ""
echo "📝 Next Steps:"
echo ""
echo " 1. Start the server:"
echo " npm run dev"
echo ""
echo " 2. Open in your browser:"
echo " http://localhost:3000"
echo ""
echo " 3. Access the admin panel:"
echo " http://localhost:3000/admin"
echo ""
echo "🔑 Admin Credentials:"
echo " Email: admin@example.com"
echo " Password: changeme"
echo ""
echo " (Can be changed in .env file)"
echo ""
echo "📖 Documentation:"
echo ""
echo " • QUICKSTART.md - Quick reference"
echo " • README.md - Full documentation"
echo " • 00-START-HERE.md - Overview"
echo ""
echo "════════════════════════════════════════════════════════════"
echo ""
echo "Ready? Run: npm run dev"
echo ""