OPS-1: startup scripts, autostart task, backup task, ops README, production config

- appsettings.Production.json: Photos:RootPath -> C:\gerbil-data\photos so
  photo files land on a stable host path when ASPNETCORE_ENVIRONMENT=Production
- Start-GerbilManager.ps1: creates data dirs, sets Production env, launches
  AppHost minimised; saves PID for Stop script
- Stop-GerbilManager.ps1: kills AppHost + Vite node processes by PID / port
- Register-AutoStart.ps1: Windows Scheduled Task on user logon (RunLevel Highest)
- Register-BackupTask.ps1: daily 03:00 Scheduled Task for Backup script
- deploy/README.md: Julian ops guide — start/stop commands, phone URL, DHCP
  reservation, firewall rule (Public-profile Wi-Fi), backup/restore procedures,
  prerequisites checklist, troubleshooting table (German)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 07:11:09 +02:00
parent 6a37f9e46e
commit dada3af968
6 changed files with 443 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<#
.SYNOPSIS
Stoppt alle laufenden GerbilManager-Prozesse (AppHost + Kindprozesse).
.NOTES
Beendet dotnet-AppHost-Prozesse und wartet darauf, dass Docker-Container
von Aspire selbst heruntergefahren werden.
#>
Set-StrictMode -Version Latest
$ErrorActionPreference = "SilentlyContinue"
$pidFile = Join-Path $PSScriptRoot "..\gerbilmanager.pid"
# Ueber gespeicherte PID stoppen (wenn vorhanden)
if (Test-Path $pidFile) {
$savedPid = Get-Content $pidFile -Raw | ForEach-Object { $_.Trim() }
$proc = Get-Process -Id $savedPid -ErrorAction SilentlyContinue
if ($proc) {
Write-Host "Beende Prozess PID $savedPid ($($proc.Name))..."
Stop-Process -Id $savedPid -Force
Remove-Item $pidFile -Force
}
}
# Alle dotnet-Prozesse stoppen, die den AppHost als Elternprozess haben
$appHostProcs = Get-Process -Name "dotnet" -ErrorAction SilentlyContinue |
Where-Object { $_.MainModule.FileName -like "*dotnet*" }
foreach ($p in $appHostProcs) {
$cmdLine = (Get-CimInstance Win32_Process -Filter "ProcessId = $($p.Id)").CommandLine
if ($cmdLine -like "*GerbilManager.AppHost*") {
Write-Host "Beende dotnet-AppHost (PID $($p.Id))..."
Stop-Process -Id $p.Id -Force
}
}
# Vite-Dev-Server stoppen (node-Prozess auf Port 5173)
$nodePids = (netstat -ano | Select-String ":5173").ToString() -split "\s+" |
Where-Object { $_ -match "^\d+$" } | Select-Object -Unique
foreach ($nPid in $nodePids) {
$np = Get-Process -Id $nPid -ErrorAction SilentlyContinue
if ($np -and $np.Name -in @("node", "npm")) {
Write-Host "Beende Vite-Dev-Server (PID $nPid)..."
Stop-Process -Id $nPid -Force
}
}
Write-Host "GerbilManager wurde gestoppt."
Write-Host "Hinweis: Der Postgres-Docker-Container laeuft weiterhin (Aspire managed ihn)."
Write-Host " Zum Stoppen: docker stop $(docker ps --filter 'name=postgres' --format '{{.Names}}' 2>$null)"