Phase 3.1: Enhanced Chore Logging and Reporting System
This commit is contained in:
89
setup_network_access.bat
Normal file
89
setup_network_access.bat
Normal file
@@ -0,0 +1,89 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
echo ========================================
|
||||
echo Family Hub - Network Access Setup
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Detect network IP
|
||||
set "FOUND_IP="
|
||||
for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /c:"IPv4 Address"') do (
|
||||
set "IP=%%a"
|
||||
set "IP=!IP:~1!"
|
||||
|
||||
echo !IP! | findstr /b "127\." >nul
|
||||
if errorlevel 1 (
|
||||
echo !IP! | findstr /b "169\.254\." >nul
|
||||
if errorlevel 1 (
|
||||
if not "!IP!"=="" (
|
||||
if not defined FOUND_IP (
|
||||
set "FOUND_IP=!IP!"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "!FOUND_IP!"=="" (
|
||||
echo ERROR: Could not detect network IP address
|
||||
echo Make sure you are connected to a network
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Detected Network IP: !FOUND_IP!
|
||||
echo.
|
||||
|
||||
REM Update frontend .env
|
||||
echo Updating frontend\.env...
|
||||
echo VITE_API_URL=http://!FOUND_IP!:8001 > frontend\.env
|
||||
echo Done!
|
||||
echo.
|
||||
|
||||
REM Update backend .env CORS
|
||||
echo Updating backend\.env for network access...
|
||||
echo # Family Hub Backend Configuration - Windows > backend\.env
|
||||
echo. >> backend\.env
|
||||
echo # Database Configuration >> backend\.env
|
||||
echo DATABASE_URL=sqlite:///./data/family_hub.db >> backend\.env
|
||||
echo. >> backend\.env
|
||||
echo # JWT Secret (change in production!) >> backend\.env
|
||||
echo SECRET_KEY=your-secret-key-change-this-in-production-please-make-it-long-and-random >> backend\.env
|
||||
echo ALGORITHM=HS256 >> backend\.env
|
||||
echo ACCESS_TOKEN_EXPIRE_MINUTES=10080 >> backend\.env
|
||||
echo. >> backend\.env
|
||||
echo # CORS Origins - Allow all for network access >> backend\.env
|
||||
echo ALLOWED_ORIGINS=* >> backend\.env
|
||||
echo. >> backend\.env
|
||||
echo # Environment >> backend\.env
|
||||
echo ENVIRONMENT=development >> backend\.env
|
||||
echo Done!
|
||||
echo.
|
||||
|
||||
echo ========================================
|
||||
echo CONFIGURATION COMPLETE!
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Server IP: !FOUND_IP!
|
||||
echo Backend URL: http://!FOUND_IP!:8001
|
||||
echo Frontend URL: http://!FOUND_IP!:5173
|
||||
echo.
|
||||
echo NEXT STEPS:
|
||||
echo.
|
||||
echo 1. Configure Windows Firewall (Run as Administrator):
|
||||
echo PowerShell command:
|
||||
echo.
|
||||
echo New-NetFirewallRule -DisplayName "Family Hub Backend" -Direction Inbound -Protocol TCP -LocalPort 8001 -Action Allow; New-NetFirewallRule -DisplayName "Family Hub Frontend" -Direction Inbound -Protocol TCP -LocalPort 5173 -Action Allow
|
||||
echo.
|
||||
echo 2. Restart backend:
|
||||
echo D:\Hosted\familyhub\restart_backend.bat
|
||||
echo.
|
||||
echo 3. Restart frontend:
|
||||
echo cd D:\Hosted\familyhub\frontend
|
||||
echo npm run dev
|
||||
echo.
|
||||
echo 4. Access from any device on your network:
|
||||
echo http://!FOUND_IP!:5173
|
||||
echo.
|
||||
echo ========================================
|
||||
pause
|
||||
Reference in New Issue
Block a user