#!/bin/bash

# Install script for DNS Management System
echo "Installing DNS Management System..."

# Install PHP and dependencies
sudo apt update
sudo apt install -y php8.2 php8.2-cli php8.2-fpm php8.2-mysql php8.2-xml php8.2-curl composer nginx mysql-server

# Install Laravel dependencies
composer create-project laravel/laravel dns-manager
cd dns-manager

# Set permissions
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache

# Install additional packages
composer require google/cloud-dns
composer require spatie/laravel-permission

# Run migrations
php artisan migrate

echo "Installation complete. Please configure config/google.php with your credentials." 