mbproxy: fix dashboard review findings, add named BCD tags + fleet config
Reviewed the new SignalR dashboard and fixed its two top findings: a stored XSS on the connection-detail page (unescaped tag name / direction / timestamp rendered into innerHTML) and FC03/FC04 cache hits bypassing the debug-view capture, which left cached tags frozen while their age climbed. Also adds an optional human-friendly Name to BCD tags surfaced on the debug view, and loads the real fleet config from tags.txt (12 named BCD tags, PLC Z28061) so the published appsettings.json is deploy-ready. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
framework-dependent\ ~1.6 MB — requires the .NET 10 + ASP.NET Core runtime
|
||||
preinstalled on the target.
|
||||
|
||||
Each folder also receives a current appsettings.json — the platform-appropriate
|
||||
install template (Windows or Linux, selected by -Rid) — so every publish-out
|
||||
flavour is a complete, deployable folder.
|
||||
|
||||
The runtime is selected with -Rid (default win-x64). The binary is Mbproxy.exe on
|
||||
Windows RIDs and Mbproxy on Linux/macOS RIDs.
|
||||
|
||||
@@ -70,6 +74,25 @@ Write-Host "`n=== Publishing framework-dependent ($Rid, ~1.6 MB) ===" -Foregroun
|
||||
& dotnet publish $csproj -c Release -r $Rid -p:SelfContained=false -p:PublishSingleFile=true -o $frameworkDependentOut --nologo
|
||||
if ($LASTEXITCODE -ne 0) { throw "framework-dependent publish failed (exit $LASTEXITCODE)" }
|
||||
|
||||
# ── Ship the platform-appropriate config template as appsettings.json ──────────
|
||||
# dotnet publish already copies it via the Mbproxy.csproj <Content> link, but that
|
||||
# link uses PreserveNewest — an incremental (non-Clean) run can leave a stale
|
||||
# config behind. Copy it explicitly so every publish-out flavour is guaranteed a
|
||||
# current appsettings.json, and so the config's source is obvious.
|
||||
$configTemplate = if ($Rid -like 'win-*') {
|
||||
Join-Path $repoRoot 'install\mbproxy.config.template.json'
|
||||
} else {
|
||||
Join-Path $repoRoot 'install\mbproxy.linux.config.template.json'
|
||||
}
|
||||
if (-not (Test-Path $configTemplate)) { throw "Cannot find config template: $configTemplate" }
|
||||
|
||||
Write-Host "`n=== Config (appsettings.json) ===" -ForegroundColor Cyan
|
||||
foreach ($flavour in 'self-contained','framework-dependent') {
|
||||
$dest = Join-Path $OutputDir "$flavour\appsettings.json"
|
||||
Copy-Item -LiteralPath $configTemplate -Destination $dest -Force
|
||||
Write-Host (" {0,-22} <- {1}" -f $flavour, $configTemplate)
|
||||
}
|
||||
|
||||
function Format-Size {
|
||||
param([long]$Bytes)
|
||||
if ($Bytes -ge 1MB) { '{0:N1} MB' -f ($Bytes / 1MB) }
|
||||
|
||||
Reference in New Issue
Block a user