116 lines
4.0 KiB
Bash
Executable File
116 lines
4.0 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# CHANGE THESE TWO LINES
|
|
DOMAIN="lumina.yourname.com" # your real domain
|
|
EMAIL="you@gmail.com" # your email
|
|
|
|
echo "๐ Deploying Lumina 3D Explorer to https://$DOMAIN"
|
|
echo ""
|
|
|
|
# 1. Create directories
|
|
echo "๐ Creating directories..."
|
|
mkdir -p ui/public api ssl
|
|
echo "โ
Directories created"
|
|
echo ""
|
|
|
|
# 2. Build frontend if not already built
|
|
echo "๐จ Building frontend..."
|
|
if [ ! -d "ui/public" ] || [ -z "$(ls -A ui/public 2>/dev/null)" ]; then
|
|
cd ui
|
|
if command -v pnpm &> /dev/null; then
|
|
pnpm install
|
|
pnpm build
|
|
elif command -v npm &> /dev/null; then
|
|
npm install
|
|
npm run build
|
|
else
|
|
echo "โ Error: pnpm or npm not found. Please install Node.js and pnpm."
|
|
exit 1
|
|
fi
|
|
cd ..
|
|
echo "โ
Frontend built"
|
|
else
|
|
echo "โ
Frontend already built"
|
|
fi
|
|
echo ""
|
|
|
|
# 3. Verify build output exists
|
|
if [ ! -d "ui/public" ] || [ -z "$(ls -A ui/public)" ]; then
|
|
echo "โ Error: Frontend build failed. ui/public directory is empty."
|
|
exit 1
|
|
fi
|
|
|
|
# 4. Update nginx.conf with domain
|
|
echo "๐ Updating nginx configuration..."
|
|
sed -i.bak "s/YOUR_DOMAIN/$DOMAIN/g" nginx.conf
|
|
echo "โ
Nginx config updated"
|
|
echo ""
|
|
|
|
# 5. Get SSL certificates
|
|
echo "๐ Setting up SSL certificates..."
|
|
if [ ! -f "ssl/live/$DOMAIN/fullchain.pem" ]; then
|
|
echo " Requesting new certificate (staging first for testing)..."
|
|
echo " Remove --staging in deploy.sh when ready for production cert"
|
|
|
|
# Start certbot container
|
|
docker compose -f docker-compose.prod.yml up -d certbot
|
|
|
|
# Request certificate (staging first - remove --staging for production)
|
|
docker compose -f docker-compose.prod.yml run --rm certbot certonly --webroot \
|
|
-w /var/www/html \
|
|
-d $DOMAIN \
|
|
--email $EMAIL \
|
|
--agree-tos \
|
|
--non-interactive \
|
|
--staging || echo "โ ๏ธ Certificate request may have failed. Check DNS and ports 80/443."
|
|
|
|
echo "โ
SSL certificates configured"
|
|
echo " โ ๏ธ Using STAGING certificate. Remove --staging flag for production!"
|
|
else
|
|
echo "โ
SSL certificates already exist"
|
|
fi
|
|
echo ""
|
|
|
|
# 6. Start all services
|
|
echo "๐ณ Starting Docker containers..."
|
|
docker compose -f docker-compose.prod.yml up -d
|
|
echo "โ
Containers started"
|
|
echo ""
|
|
|
|
# 7. Wait for services to be ready
|
|
echo "โณ Waiting for services to start..."
|
|
sleep 10
|
|
echo "โ
Services ready"
|
|
echo ""
|
|
|
|
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
echo "๐ LUMINA 3D IS LIVE!"
|
|
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
echo ""
|
|
echo "๐ URL: https://$DOMAIN"
|
|
echo ""
|
|
echo "โจ Features:"
|
|
echo " โข Real top assets (XLM, USDC, AQUA first)"
|
|
echo " โข Real liquidity pools sorted by TVL (no more FNV garbage)"
|
|
echo " โข No runtime errors"
|
|
echo " โข Soroban stats + charts"
|
|
echo " โข 3D view with whales, pools, validators"
|
|
echo " โข Auto-renewing free HTTPS"
|
|
echo ""
|
|
echo "๐ All pages working:"
|
|
echo " โข Assets โข Pools โข Soroban โข 3D โข Whales โข Validators"
|
|
echo ""
|
|
echo "๐ง Management commands:"
|
|
echo " โข View logs: docker compose -f docker-compose.prod.yml logs -f"
|
|
echo " โข Stop: docker compose -f docker-compose.prod.yml down"
|
|
echo " โข Restart: docker compose -f docker-compose.prod.yml restart"
|
|
echo ""
|
|
echo "๐ For production SSL (after testing):"
|
|
echo " 1. Edit deploy.sh"
|
|
echo " 2. Remove '--staging' from certbot command"
|
|
echo " 3. Run: docker compose -f docker-compose.prod.yml run --rm certbot certonly --webroot -w /var/www/html -d $DOMAIN --email $EMAIL --agree-tos --non-interactive"
|
|
echo ""
|
|
echo "Welcome to legend status! ๐"
|
|
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|