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:
Joseph Doherty
2026-05-16 03:39:39 -04:00
parent e719dd51c1
commit 554b05d28c
27 changed files with 964 additions and 83 deletions
+26
View File
@@ -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 -r RID) — so every publish-out
# flavour is a complete, deployable folder.
#
# Both builds use the Release configuration and inherit the publish settings in
# src/Mbproxy/Mbproxy.csproj (those settings are gated on an explicit RID, which
# is supplied here). The framework-dependent build overrides SelfContained=false.
@@ -68,6 +72,28 @@ echo "=== Publishing framework-dependent ($rid, ~1.6 MB) ==="
dotnet publish "$csproj" -c Release -r "$rid" \
-p:SelfContained=false -p:PublishSingleFile=true -o "$framework_dependent_out" --nologo
# 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.
if [[ "$rid" == win-* ]]; then
config_template="$repo_root/install/mbproxy.config.template.json"
else
config_template="$repo_root/install/mbproxy.linux.config.template.json"
fi
if [[ ! -f "$config_template" ]]; then
echo "Cannot find config template: $config_template" >&2
exit 1
fi
echo
echo "=== Config (appsettings.json) ==="
for flavour in self-contained framework-dependent; do
cp -f "$config_template" "$output_dir/$flavour/appsettings.json"
printf ' %-22s <- %s\n' "$flavour" "$config_template"
done
echo
echo "=== Result ($rid) ==="
for flavour in self-contained framework-dependent; do