fix(updater): stop false-positive "update available" loop when commit is unknown
Dockerfile never received DASHCADDY_COMMIT at build, so /app/VERSION held
'unknown'. _isNewer then treated same-version-different-commit as newer,
making the auto-updater rebuild the container indefinitely (each rebuild
still produced commit='unknown').
- self-updater._isNewer: normalize commits; treat unknown/null/empty as no
commit info and fall back to pure version comparison
- self-updater._autoCheckAndApply + routes/updates: refuse to apply when
local version >= remote version (belt-and-suspenders)
- update-management.js: hide '(unknown)' from version label
- Dockerfile: COPY VERSION instead of writing from build arg
- VERSION: committed placeholder ('dev'); scripts/release.sh now writes
the real short SHA into the tarball's VERSION before tar-ing, so every
published release ships with an accurate commit
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,10 @@ COPY src/ ./src/
|
||||
COPY routes/ ./routes/
|
||||
COPY openapi.yaml ./
|
||||
|
||||
ARG DASHCADDY_COMMIT=unknown
|
||||
RUN echo "${DASHCADDY_COMMIT}" > VERSION
|
||||
# VERSION file holds the short git SHA the image was built from. Committed as
|
||||
# 'dev' for source builds; the release script (scripts/release.sh) overwrites it
|
||||
# with the actual commit hash before tarballing each release.
|
||||
COPY VERSION ./
|
||||
|
||||
# Note: Running as root because container needs Docker socket access
|
||||
# (which is root-equivalent anyway). Socket access required for container management.
|
||||
|
||||
Reference in New Issue
Block a user