Files
shopdb-flask/open-firewall-for-vm.ps1
Proudlock d59cc89c48 Add VM connectivity troubleshooting and HTTP workaround
VM cannot connect via HTTPS due to self-signed certificate errors.

Added:
- test-vm-connectivity.ps1: 5-step diagnostic for VM
- agent/QUICK-FIX-VM.md: Use HTTP for Hyper-V local network
- open-firewall-for-vm.ps1: Open Windows Firewall

Since VM and host are on same physical machine (Hyper-V internal
network), HTTP is acceptable for local monitoring.

For production: Use proper TLS certificates.
2026-09-07 01:26:16 -04:00

32 lines
1.1 KiB
PowerShell

# Open Windows Firewall for ShopDB VM Access
# Run this as Administrator on the Host PC
Write-Host "Adding Windows Firewall rule for ShopDB API..." -ForegroundColor Cyan
try {
New-NetFirewallRule `
-DisplayName "ShopDB API - Port 5001" `
-Direction Inbound `
-LocalPort 5001 `
-Protocol TCP `
-Action Allow `
-Profile Any `
-ErrorAction Stop
Write-Host "SUCCESS: Firewall rule added!" -ForegroundColor Green
Write-Host ""
Write-Host "ShopDB is now accessible from VMs at:" -ForegroundColor Yellow
Write-Host " https://172.31.96.1:5001" -ForegroundColor White
Write-Host " https://172.30.0.1:5001" -ForegroundColor White
Write-Host ""
Write-Host "Test from VM with:" -ForegroundColor Yellow
Write-Host " Test-NetConnection -ComputerName 172.31.96.1 -Port 5001" -ForegroundColor White
Write-Host ""
} catch {
Write-Host "ERROR: Failed to add firewall rule" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host ""
Write-Host "Make sure you're running PowerShell as Administrator!" -ForegroundColor Yellow
exit 1
}