Update service port from 5000 to 2414 and adjust related configurations

This commit is contained in:
Phoenix
2025-08-07 17:53:54 +08:00
parent d6efa9163b
commit f2a0818d0e
11 changed files with 11 additions and 104 deletions
+7 -7
View File
@@ -138,11 +138,11 @@ try {
# Configure firewall rule
Write-Host "Configuring Windows Firewall..."
try {
New-NetFirewallRule -DisplayName "Resource Monitor Service" -Direction Inbound -Protocol TCP -LocalPort 5000 -Action Allow -Profile Any -ErrorAction Stop
New-NetFirewallRule -DisplayName "Resource Monitor Service" -Direction Inbound -Protocol TCP -LocalPort 2414 -Action Allow -Profile Any -ErrorAction Stop
Write-Host "Firewall rule created" -ForegroundColor Green
} catch {
Write-Host "WARNING: Failed to create firewall rule. You may need to configure manually." -ForegroundColor Yellow
Write-Host "Manual command: New-NetFirewallRule -DisplayName 'Resource Monitor Service' -Direction Inbound -Protocol TCP -LocalPort 5000 -Action Allow" -ForegroundColor Gray
Write-Host "Manual command: New-NetFirewallRule -DisplayName 'Resource Monitor Service' -Direction Inbound -Protocol TCP -LocalPort 2414 -Action Allow" -ForegroundColor Gray
}
# Start the service
@@ -165,8 +165,8 @@ Write-Host
Write-Host "=== Installation Complete ===" -ForegroundColor Cyan
Write-Host "Service Name: $SERVICE_NAME" -ForegroundColor White
Write-Host "Installation Path: $INSTALL_PATH" -ForegroundColor White
Write-Host "Service URL: http://localhost:5000" -ForegroundColor White
Write-Host "API Health Check: http://localhost:5000/api/health" -ForegroundColor White
Write-Host "Service URL: http://localhost:2414" -ForegroundColor White
Write-Host "API Health Check: http://localhost:2414/api/health" -ForegroundColor White
Write-Host
Write-Host "The service is now running and will start automatically with Windows." -ForegroundColor Green
Write-Host "You can manage it through Services.msc or using PowerShell commands:" -ForegroundColor White
@@ -182,12 +182,12 @@ Write-Host
Write-Host "Testing API endpoint..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
try {
$response = Invoke-RestMethod -Uri "http://localhost:5000/api/health" -TimeoutSec 10
$response = Invoke-RestMethod -Uri "http://localhost:2414/" -TimeoutSec 10
Write-Host "API Test Result: SUCCESS" -ForegroundColor Green
Write-Host "Service Version: $($response.Service)" -ForegroundColor White
Write-Host "Service Version: $($response.Service) v$($response.Version)" -ForegroundColor White
Write-Host "Status: $($response.Status)" -ForegroundColor White
} catch {
Write-Host "API Test Result: FAILED" -ForegroundColor Red
Write-Host "The service may still be starting up. Wait a few minutes and try accessing:" -ForegroundColor Yellow
Write-Host "http://localhost:5000/api/health" -ForegroundColor White
Write-Host "http://localhost:2414/api/health" -ForegroundColor White
}