feat: update deployment scripts and README for improved setup and configuration

This commit is contained in:
2026-02-22 03:05:15 +05:00
parent da463e6375
commit 14890b6875
5 changed files with 234 additions and 22 deletions

43
update-domain.sh Normal file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "Usage: ./update-domain.sh <domain>"
echo ""
echo "Examples:"
echo " ./update-domain.sh 192.168.2.175:3000"
echo " ./update-domain.sh fairreview.example.com"
exit 1
fi
NEW_DOMAIN="$1"
echo "=== Updating Domain ==="
echo "New domain: $NEW_DOMAIN"
# Check if .env.local exists
if [ ! -f .env.local ]; then
echo "Error: .env.local not found. Run deploy.sh first."
exit 1
fi
# Load database credentials
if [ -f .postgres-env ]; then
source .postgres-env
fi
# Update NEXTAUTH_URL in .env.local
sed -i "s|NEXTAUTH_URL=.*|NEXTAUTH_URL=\"http://$NEW_DOMAIN\"|" .env.local
echo "Updated NEXTAUTH_URL in .env.local"
# Rebuild and restart
echo "Rebuilding application..."
npm run build
echo "Restarting application..."
pm2 restart fairreview
echo ""
echo "=== Domain Update Complete ==="
echo "Application running at: http://$NEW_DOMAIN"