Harden Web/PWA image and gate publishes on web CalVer bumps #250
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#250
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow up the Web/PWA container publish path by moving the runtime image itself
onto Docker Hardened Images Caddy, keeping the web package version on CalVer,
and making automatic image publishes run when the web package manifest changes
or when the web Dockerfile changes.
Problem
The current
docker/web/Dockerfilecopies the Caddy binary from the upstreamcaddy:2.11.3-alpineimage. Registry scanners are reporting vulnerabilities inthat layer. The current publish workflow also auto-runs for a broad set of web
package, script, and Docker inputs, which means publishing is coupled to source
changes instead of an explicit release/version bump. The web package version is
still
0.0.1, so the versioned image tags do not yet communicate a useful webrelease date.
Goal
Publish the Web/PWA image from a hardened Caddy source image, use
YYYY.M.DCalVer in
packages/web/package.json, and treat that manifest version bump asthe automatic publish trigger while keeping manual workflow dispatch available.
Scope
docker/web/Dockerfilewith DockerHardened Images Caddy instead of the current distroless final stage.
packages/web/package.jsonfrom0.0.1to CalVer inYYYY.M.Dformat.
.forgejo/workflows/publish-web.ymlso automatic publishes run whenpackages/web/package.jsonordocker/web/Dockerfilechanges onmain,while preserving manual dispatch.
and manifest-driven release semantics.
Non-goals
unrelated Docker images.
metadata, and publish trigger semantics.
Acceptance Criteria
docker/web/Dockerfileno longer relies on the upstream Alpine Caddy image orthe distroless final stage, and instead uses Docker Hardened Images Caddy for
the Web/PWA runtime image while staying compatible with the existing
linux/amd64andlinux/arm64publish matrix.packages/web/package.jsonusesYYYY.M.DCalVer and that value continuesto drive the versioned Docker tags and OCI image metadata.
.forgejo/workflows/publish-web.ymlauto-runs onmainwhenpackages/web/package.jsonordocker/web/Dockerfilechanges, while stillsupporting manual dispatch.
v<version>, andlatesttags.source and the manifest-gated publish model.
Implementation Notes
dhi.io/caddy:2unless a more specificcompatible stream is confirmed during implementation.
packages/web/package.jsonso the manifest remains the single release sourceof truth.
packages/web/package.jsonas the web releasesource of truth for version tags, but Dockerfile-only image fixes should also
trigger the publish workflow on
main. Keep that distinction explicit in thespecs.
Suggested Files or Specs To Inspect
docker/web/Dockerfilepackages/web/package.json.forgejo/workflows/publish-web.ymlspec/src/20-packages/web/index.mdpackages/web/spec.mdspec/src/80-maintenance/release-management.mdValidation Commands
docker manifest inspect dhi.io/caddy:2docker buildx build --platform linux/amd64 --file docker/web/Dockerfile --build-arg LAPIS_BUILD_COMMIT=<sha> --build-arg LAPIS_WEB_VERSION=<version> --tag lapisnotes/web:test --load .docker run --rm --read-only --cap-drop=ALL --security-opt no-new-privileges -p 8080:8080 lapisnotes/web:testcurl http://localhost:8080/healthzpnpm check:allmake spec-lintmdbook build specRelated Issues
Follow-up Tasks
Implementation Summary
Moved the Web/PWA runtime to dhi.io/caddy:2, kept DHI and Docker Hub auth in publish-web, preserved CalVer tags and Dockerfile-triggered publishes, and scoped the Docker build install to the web dependency closure.
Reopen Reason
Follow-up:
docker/web/Dockerfilestill uses a distroless final stage, but theruntime image itself should also move to Docker Hardened Images Caddy.