Skip to content

feat(docker): enhance sharing, multi-platform support, and release security - #295

Merged
ThisIs-Developer merged 1 commit into
mainfrom
fix/docker-scout-security-20261115
Nov 21, 2026
Merged

ThisIs-Developer merged 1 commit into
mainfrom
fix/docker-scout-security-20261115

Conversation

@ThisIs-Developer

@ThisIs-Developer ThisIs-Developer commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Enhance Markdown Viewer's Docker distribution with working Share Snapshot and Live Share on localhost, native AMD64/ARM64 delivery, a smaller HTTP-only runtime, and stronger release verification.

This resolves missing assets, blocked sharing connections, stale code caching, and offline/service-worker issues while making installation and maintenance clearer.

New features and advantages

  • Share Snapshot in Docker: generate and open embedded snapshots and stored snapshots in view/edit modes through the existing hosted service.
  • Live Share in Docker: support read-only guests, bidirectional editing, session termination, and collaboration between a local Docker host and the public web app.
  • AMD64 and ARM64 images: build and validate both architectures on native runners, avoiding emulated compilation in CI.
  • Pull-first installation: Docker Compose uses a prebuilt image by default, so normal installation avoids compiling NGINX. An explicit override remains available for source builds.
  • Smaller HTTP runtime: compile source-pinned NGINX without TLS/OpenSSL and leave compilers, Git, and the APK CLI out of the final image.
  • Verified release artifacts: test and scan each architecture, preserve SBOM/provenance attestations, and promote the exact verified image index without rebuilding.
  • Operational improvements: add container health checks, graceful shutdown, localhost port binding, and rotated logs.

Issues fixed

Issue Resolution
Docker blocked the hosted snapshot API and collaboration library. Update the content security policy to permit the specific hosted HTTPS/WSS endpoints and esm.sh, without a wildcard connection policy.
Live Share tried to connect to the local static NGINX server instead of a relay. Derive the default WebSocket endpoint from the sharing-service base. Localhost/127.0.0.1 and desktop/file contexts use the hosted relay; deployed web retains its same-origin behavior. Preserve the explicit relay override.
Some required browser assets were missing from the image. Package browser helpers, the preview worker, sample Markdown, and the guide.
JavaScript modules and missing assets could receive incorrect responses. Correct module MIME types and return proper missing-asset 404 responses.
Cached application code could remain stale after an update. Revalidate mutable code and test document persistence across cache revalidation.
Late service-worker registration and offline navigation were unreliable. Fix registration timing and offline navigation behavior, and synchronize generated desktop resources.
Security headers and shutdown behavior were inconsistent. Track NGINX configuration and header inheritance, restore SIGQUIT, and configure a 20-second Compose shutdown grace period.
Release handling could lose platform manifests or attestations. Validate architecture, SBOM/provenance linkage, complete manifest sets, and digest preservation through archive transfer, assembly, and promotion rehearsal.
Windows checkouts could introduce incompatible shell-script line endings. Enforce LF for Docker shell scripts.

Implementation and documentation

  • Pin NGINX 1.31.9 source in a disposable Alpine builder; retain runtime package inventory and include the NGINX license and SPDX component metadata.
  • Separate compiler dependency installation from source compilation so NGINX pin updates can reuse downloaded dependencies and web-source changes can reuse the server build.
  • Add endpoint-selection unit tests and actual-container browser tests using the pinned Yjs implementation.
  • Keep routine CI independent of production storage by using the actual snapshot handler and a test relay. Add an opt-in acceptance mode against the real hosted API, CDN, and WebSocket service.
  • Update Docker deployment documentation with installation, source-build commands, supported host/CPU configurations, sharing dependencies, privacy boundaries, custom-host requirements, and verification commands.
  • Synchronize desktop resources through the project's preparation script.
  • Restrict GHCR publication to successful main-branch runs.

Validation

Validated on November 21, 2026, at commit ca5833c6ea4722ab71ec45c3bf468f7a42576748:

  • 270 local unit tests passed, including sharing endpoint selection.
  • Application build and desktop-resource preparation passed.
  • 14 actual-container Chromium tests passed on each of AMD64 and ARM64, alongside runtime, security-header, cache, graceful-stop, vulnerability-policy, SBOM/provenance, and release-integrity checks.
  • 6 real hosted-service acceptance tests passed against the downloaded CI image on the local Windows Docker installation, covering embedded snapshots, stored view/edit snapshots, live view/edit synchronization, and session ending. The public-web guest test verified Docker-to-web interoperability. Tests deleted their synthetic stored snapshots and ended their sessions.
  • GitHub reported 25 successful checks and 2 intentionally skipped publication jobs, with no failed or pending checks.
  • Desktop packaging/acceptance, Windows native validation, CodeQL, GitGuardian, and preview deployments passed.

Evidence: Docker CI, desktop CI, and Windows native validation.

Verified combined OCI index: sha256:95c43d1c6e60f11b912848de29e8782ca42016ea155dc862c81b0c9954e3c9fa.

Build performance and deployment considerations

  • Cold source builds remain slower than pulling precompiled NGINX. They download a compiler toolchain and compile C code, consuming time and build-cache space. Cache separation improves reuse; pulling the published image avoids compilation. These changes do not claim a universal rendering-speed improvement.
  • Hosted sharing needs internet access. Localhost/127.0.0.1 use the existing services. Custom LAN/public hostnames need compatible backend and origin-policy configuration. The backend origin allowlist is unchanged.
  • The image serves HTTP. Remote HTTPS belongs at an external reverse proxy; the container does not include Cloudflare KV, Durable Objects, or a collaboration backend.
  • Platform support has defined boundaries. Documentation covers Linux/Ubuntu, Windows with Linux containers, Intel Mac, Apple Silicon, and ARM64 Linux. Native Windows containers, 32-bit devices, and every physical host/browser combination are not covered.
  • Custom NGINX needs ongoing maintenance. Source pins and upstream advisories must be reviewed. The root master/unprivileged-worker model remains; a fully non-root/read-only runtime is not part of this change.
  • Existing browser caches may need one hard refresh. Document storage should be preserved.
  • Production-load sizing, full separate-image cross-release migration, and exhaustive browser/CDN coverage remain outside this acceptance scope. GHCR publication runs after merge; this validation did not publish a production release.

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markdown-viewer Ready Ready Preview Nov 21, 2026 7:23am UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: ca5833c
Status: ✅  Deploy successful!
Preview URL: https://a0e2376e.markdownviewer.pages.dev
Branch Preview URL: https://fix-docker-scout-security-20.markdownviewer.pages.dev

View logs

@ThisIs-Developer ThisIs-Developer changed the title fix(docker): reduce Docker Scout CVEs with slim stable Nginx base fix(docker): eliminate OpenSSL runtime CVEs with HTTP-only NGINX Nov 15, 2026
@ThisIs-Developer ThisIs-Developer changed the title fix(docker): eliminate OpenSSL runtime CVEs with HTTP-only NGINX fix(docker): review-harden HTTP-only NGINX and verify immutable release candidate Nov 16, 2026
@ThisIs-Developer
ThisIs-Developer force-pushed the fix/docker-scout-security-20261115 branch from 76d28ce to b353127 Compare November 20, 2026 18:12
@ThisIs-Developer ThisIs-Developer changed the title fix(docker): review-harden HTTP-only NGINX and verify immutable release candidate fix(docker): harden HTTP runtime and verify immutable releases Nov 20, 2026
@ThisIs-Developer
ThisIs-Developer force-pushed the fix/docker-scout-security-20261115 branch from b353127 to b7a11ef Compare November 20, 2026 18:15
@ThisIs-Developer
ThisIs-Developer force-pushed the fix/docker-scout-security-20261115 branch from f44f9e4 to ca5833c Compare November 21, 2026 07:23
@ThisIs-Developer ThisIs-Developer changed the title fix(docker): harden HTTP runtime and verify immutable releases feat(docker): enhance sharing, multi-platform support, and release security Nov 21, 2026
@ThisIs-Developer
ThisIs-Developer merged commit 4b58866 into main Nov 21, 2026
27 checks passed
@ThisIs-Developer ThisIs-Developer added ⚡ performance Speed, rendering, memory, loading, storage, or performance optimization. ✨ enhancement New feature, improvement, or usability enhancement. 🔒 security Security vulnerabilities, hardening, CSP, API protection, or related fixes. labels Nov 21, 2026 — with ChatGPT Codex Connector

This branch was successfully deployed

1 active deployment
Preview — ca5833c6 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature, improvement, or usability enhancement. ⚡ performance Speed, rendering, memory, loading, storage, or performance optimization. 🔒 security Security vulnerabilities, hardening, CSP, API protection, or related fixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant