Initial V2 commit
This commit is contained in:
63
setup.sh
Executable file
63
setup.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################
|
||||
# Intaleq V2 — Server Setup Script
|
||||
# Run this ONCE on the server after uploading
|
||||
###############################################
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Intaleq V2 Setup ==="
|
||||
|
||||
# 1. Install dependencies
|
||||
echo "[1/6] Installing Composer dependencies..."
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
# 2. Copy environment file
|
||||
if [ ! -f .env ]; then
|
||||
echo "[2/6] Creating .env from template..."
|
||||
cp .env.example .env
|
||||
echo "⚠️ IMPORTANT: Edit .env with your actual credentials!"
|
||||
else
|
||||
echo "[2/6] .env already exists, skipping..."
|
||||
fi
|
||||
|
||||
# 3. Generate app key
|
||||
echo "[3/6] Generating application key..."
|
||||
php artisan key:generate
|
||||
|
||||
# 4. Cache config for performance
|
||||
echo "[4/6] Caching configuration..."
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
|
||||
# 5. Set permissions
|
||||
echo "[5/6] Setting permissions..."
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
# 6. Run migrations (add indexes and api columns)
|
||||
echo "[6/6] Running database migrations..."
|
||||
echo "⚠️ This will add api_key/api_secret columns and missing indexes."
|
||||
echo "⚠️ It will NOT delete or modify existing data."
|
||||
read -p "Continue? (y/n): " confirm
|
||||
if [ "$confirm" = "y" ]; then
|
||||
php artisan migrate
|
||||
echo "✅ Migrations complete!"
|
||||
else
|
||||
echo "⏭️ Migrations skipped. Run 'php artisan migrate' manually."
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Setup Complete ==="
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Edit .env with real DB credentials, JWT secret, etc."
|
||||
echo "2. Configure Nginx to point to public/ directory"
|
||||
echo "3. Run: php artisan config:cache"
|
||||
echo "4. Test: curl https://your-domain/v2/auth/passenger/login"
|
||||
echo ""
|
||||
echo "Nginx config example:"
|
||||
echo " location /v2 {"
|
||||
echo " try_files \$uri \$uri/ /index.php?\$query_string;"
|
||||
echo " }"
|
||||
Reference in New Issue
Block a user