@echo off
REM Configure Windows Firewall for No-IP External Access
REM Run this script as Administrator

echo ========================================
echo CHURCH APP FIREWALL CONFIGURATION
echo ========================================
echo.

echo Creating firewall rule for Frontend (Port 3000)...
netsh advfirewall firewall add rule name="Church App Frontend" dir=in action=allow protocol=TCP localport=3000 profile=any
if %errorlevel% equ 0 (
    echo [OK] Frontend rule created
) else (
    echo [ERROR] Failed to create frontend rule
)

echo.
echo Creating firewall rule for Backend (Port 5000)...
netsh advfirewall firewall add rule name="Church App Backend" dir=in action=allow protocol=TCP localport=5000 profile=any
if %errorlevel% equ 0 (
    echo [OK] Backend rule created
) else (
    echo [ERROR] Failed to create backend rule
)

echo.
echo ========================================
echo FIREWALL RULES CONFIGURED
echo ========================================
echo.
echo To verify, run: netsh advfirewall firewall show rule name=all
echo.
pause
