Fix missing config properties for Windows services: add port, display name, and description

## Bug Fix

### Problem
Deployment failed with error:
```
[INSTALLATION FAILED] You cannot call a method on a null-valued expression.
at Install-BackendFirstTime, line 611
```

The error occurred at line 611:
```powershell
& nssm install $Config.BackendServiceName $pythonPath "-m" "uvicorn" ... "--port" $Config.BackendPort.ToString()
```

### Root Cause
Global configuration was missing required properties used by service installation functions:
- `$Config.BackendPort` - used in NSSM service creation (line 611)
- `$Config.BackendServiceDisplayName` - used for service display name (line 612)
- `$Config.BackendServiceDescription` - used for service description (line 613)
- `$Config.TelegramBotServiceDisplayName` - used in telegram bot service (line 816)
- `$Config.TelegramBotServiceDescription` - used in telegram bot service (line 817)
- `$Config.TelegramBotPort` - added for consistency (not yet used)

When the script tried to call `.ToString()` on `$Config.BackendPort`, it was null, causing the error.

### Solution
Added missing properties to `$script:Config` hashtable (lines 63-96):

**Backend properties:**
- `BackendPort = 8000`
- `BackendServiceDisplayName = "ROA2WEB Backend API"`
- `BackendServiceDescription = "FastAPI backend service for ROA2WEB application"`

**Telegram Bot properties:**
- `TelegramBotPort = 8002`
- `TelegramBotServiceDisplayName = "ROA2WEB Telegram Bot"`
- `TelegramBotServiceDescription = "Telegram bot frontend for ROA2WEB application"`

### Impact
- Backend service creation now works correctly with proper port configuration
- Service display names and descriptions are properly set in Windows Services
- Configuration is now complete and consistent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-12 02:32:50 +02:00
parent ad5a16b8a3
commit 6c71f73740

View File

@@ -69,6 +69,9 @@ $script:Config = @{
# Backend
BackendPath = "C:\inetpub\wwwroot\roa2web\backend"
BackendServiceName = "ROA2WEB-Backend"
BackendServiceDisplayName = "ROA2WEB Backend API"
BackendServiceDescription = "FastAPI backend service for ROA2WEB application"
BackendPort = 8000
BackendHealthUrl = "http://localhost:8000/health"
BackendHealthTimeout = 5
@@ -78,6 +81,9 @@ $script:Config = @{
# Telegram Bot
TelegramBotPath = "C:\inetpub\wwwroot\roa2web\telegram-bot"
TelegramBotServiceName = "ROA2WEB-TelegramBot"
TelegramBotServiceDisplayName = "ROA2WEB Telegram Bot"
TelegramBotServiceDescription = "Telegram bot frontend for ROA2WEB application"
TelegramBotPort = 8002
TelegramBotHealthUrl = "http://localhost:8002/internal/health"
TelegramBotHealthTimeout = 10