9a87d7a328
Second slice of the 2026-09-09 whole-system review remediation
(docs/plans/2026-09-09-arch-review.md §10), on top of the High slice 146a1323.
Runtime/devices: SR-2 alarm on-trigger integration scope; SR-3 correlated NativeAlarmActor
subscribe retry; SR-4 immutable audited DB target; SR-5 ordered InstanceActor stop/flush;
SR-12 rehydration fence; SR-13 S&F gate recheck per delivery; DC-4 no OPC UA security
downgrade; DC-5 alarm snapshot for every new subscriber; ORCH-1 sync-dispose joins the pump.
Management/UI: MG-2 site scope on audit tree + Flow Debugger Replay; MG-3 stale-probe memo
removed; MG-4 server-owned bulk-deploy deadline; UI-5 sandbox runs in a killable child
process (new CentralUI.SandboxWorker project); UI-14 bounded sandbox output/IPC.
Edge/audit: EI-1 relay audit ownership; EI-2 SkipBodyCapture suppresses error text; EI-3/EI-11
error-field redaction + caps; EI-4 single relay deadline, pre-execution-only retry; EI-5
authenticated relay provenance; EI-10 body cap before audit read.
Persistence/contracts: DL-1 global Instance.UniqueName unique index + conflict translation;
DL-2 DataConnection protocol config encrypted at rest (migration
20260909203046_EnforceGlobalInstanceNamesAndProtectProtocolConfiguration — coordinated
central upgrade, old binaries cannot read protected rows); DL-3 bounded Replay paging;
DL-6 cross-site Overwrite of a deployed instance rejected; XC-4 proto descriptor contract test.
Config/hygiene: XC-1 central listener isolation by local port; XC-2/XC-3 inert SMTP + cron
keys removed from rig settings; CM-2 env2 bootstrap guard enabled; DC-6 deploy site exit code;
DC-7 notifier retries only explicit standby rejection; XC-5 ClusterClient purged from docs.
Gates recorded in the report: build 0/0, 9 397 passed / 0 failed, rig redeployed on all
eight nodes with the migration applied. 46 Low findings remain open.
64 lines
4.3 KiB
Docker
64 lines
4.3 KiB
Docker
# Stage 1: Restore (cached when .csproj/.slnx files don't change)
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS restore
|
|
WORKDIR /src
|
|
|
|
# Copy all .csproj files first (rarely change) for restore layer caching
|
|
COPY src/ZB.MOM.WW.ScadaBridge.Commons/ZB.MOM.WW.ScadaBridge.Commons.csproj src/ZB.MOM.WW.ScadaBridge.Commons/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj src/ZB.MOM.WW.ScadaBridge.Host/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ZB.MOM.WW.ScadaBridge.TemplateEngine.csproj src/ZB.MOM.WW.ScadaBridge.TemplateEngine/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ZB.MOM.WW.ScadaBridge.DeploymentManager.csproj src/ZB.MOM.WW.ScadaBridge.DeploymentManager/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ZB.MOM.WW.ScadaBridge.SiteRuntime.csproj src/ZB.MOM.WW.ScadaBridge.SiteRuntime/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.csproj src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.Communication/ZB.MOM.WW.ScadaBridge.Communication.csproj src/ZB.MOM.WW.ScadaBridge.Communication/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ZB.MOM.WW.ScadaBridge.StoreAndForward.csproj src/ZB.MOM.WW.ScadaBridge.StoreAndForward/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.csproj src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.NotificationService/ZB.MOM.WW.ScadaBridge.NotificationService.csproj src/ZB.MOM.WW.ScadaBridge.NotificationService/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.CentralUI/ZB.MOM.WW.ScadaBridge.CentralUI.csproj src/ZB.MOM.WW.ScadaBridge.CentralUI/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.CentralUI.SandboxWorker/ZB.MOM.WW.ScadaBridge.CentralUI.SandboxWorker.csproj src/ZB.MOM.WW.ScadaBridge.CentralUI.SandboxWorker/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.Security/ZB.MOM.WW.ScadaBridge.Security.csproj src/ZB.MOM.WW.ScadaBridge.Security/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ZB.MOM.WW.ScadaBridge.HealthMonitoring.csproj src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ZB.MOM.WW.ScadaBridge.SiteEventLogging.csproj src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.csproj src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.InboundAPI/ZB.MOM.WW.ScadaBridge.InboundAPI.csproj src/ZB.MOM.WW.ScadaBridge.InboundAPI/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.csproj src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/
|
|
COPY src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj src/ZB.MOM.WW.ScadaBridge.ManagementService/
|
|
|
|
# Central Package Management: every .csproj declares versionless PackageReferences
|
|
# and the versions live in Directory.Packages.props. It must be present (above the
|
|
# projects) for `dotnet restore` to resolve versions — without it restore fails NU1015.
|
|
COPY Directory.Packages.props ./
|
|
|
|
# nuget.config declares the Gitea feed (and package-source mapping) that serves the
|
|
# ZB.MOM.WW.MxGateway.* packages used by the Data Connection Layer.
|
|
COPY nuget.config ./
|
|
|
|
# Optional credentials for the private Gitea feed, supplied at build time via
|
|
# --build-arg (see docker/build.sh). Left blank for an anonymous feed. NuGet reads
|
|
# per-source credentials from the NuGetPackageSourceCredentials_<sourceName> env var.
|
|
ARG NUGET_GITEA_USER=
|
|
ARG NUGET_GITEA_PASS=
|
|
ENV NuGetPackageSourceCredentials_dohertj2-gitea="Username=${NUGET_GITEA_USER};Password=${NUGET_GITEA_PASS}"
|
|
|
|
# Restore NuGet packages via Host project (follows ProjectReferences to all dependencies)
|
|
# This layer is cached until any .csproj changes — source-only changes skip restore entirely
|
|
RUN dotnet restore src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj
|
|
|
|
# Stage 2: Build + Publish
|
|
FROM restore AS build
|
|
COPY src/ src/
|
|
RUN dotnet publish src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj \
|
|
-c Release -o /app/publish
|
|
|
|
# Stage 3: Runtime (minimal image, no SDK)
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|
WORKDIR /app
|
|
|
|
# Create data directory for SQLite databases (site nodes)
|
|
RUN mkdir -p /app/data /app/logs
|
|
|
|
COPY --from=build /app/publish .
|
|
|
|
EXPOSE 5000 8081 8082
|
|
|
|
ENTRYPOINT ["dotnet", "ZB.MOM.WW.ScadaBridge.Host.dll"]
|