Python
1.40.1: Publish the image only for new versions, reproducible builds
DerMilderJoghurtc05e28d41e02
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex 081e048..d86b4c3 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -1,7 +1,10 @@name: Image and release-# Builds the image and pushes it to the GitHub Container Registry:-# ghcr.io/dermilderjoghurt/mirrorsync:latest (every push to main)+# Builds the image and pushes it to the GitHub Container Registry, but only when app/VERSION contains a version+# that is not in the registry yet (or when started by hand with "force"). Pushes that only touch docs, workflows+# or the Android app therefore leave :latest unchanged, so update checkers (Dockhand, Watchtower, ...) only report+# a real new version.+# ghcr.io/dermilderjoghurt/mirrorsync:latest (newest version)# ghcr.io/dermilderjoghurt/mirrorsync:<version> (version from app/VERSION, e.g. 1.33.2)# ghcr.io/dermilderjoghurt/mirrorsync:1.33 (minor version, always the newest 1.33.x)on:@@ -9,6 +12,11 @@ on:branches: [main]tags: ["v*"]workflow_dispatch:+ inputs:+ force:+ description: "Build and push the image even if this version already exists"+ type: boolean+ default: falsepermissions:contents: write # create tag and release@@ -17,6 +25,8 @@ permissions:jobs:build:runs-on: ubuntu-latest+ outputs:+ publish: ${{ steps.check.outputs.publish }}steps:- uses: actions/checkout@v7@@ -26,17 +36,36 @@ jobs:v=$(tr -d ' \n\r' < app/VERSION)echo "version=$v" >> "$GITHUB_OUTPUT"echo "minor=${v%.*}" >> "$GITHUB_OUTPUT"+ # Commit time as build time: the same commit always gives the same image (reproducible build)+ echo "epoch=$(git log -1 --format=%ct)" >> "$GITHUB_OUTPUT"+ echo "created=$(git log -1 --format=%cI)" >> "$GITHUB_OUTPUT"- - uses: docker/setup-qemu-action@v4- - uses: docker/setup-buildx-action@v4+ - name: Is this version already published?+ id: check+ run: |+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.force }}" = "true" ]; then+ echo "Forced build."; echo "publish=true" >> "$GITHUB_OUTPUT"+ elif docker buildx imagetools inspect "ghcr.io/dermilderjoghurt/mirrorsync:${{ steps.ver.outputs.version }}" >/dev/null 2>&1; then+ echo "Version ${{ steps.ver.outputs.version }} is already in the registry, nothing to push."+ echo "publish=false" >> "$GITHUB_OUTPUT"+ else+ echo "New version ${{ steps.ver.outputs.version }}."; echo "publish=true" >> "$GITHUB_OUTPUT"+ fi- - uses: docker/login-action@v4+ - if: steps.check.outputs.publish == 'true'+ uses: docker/setup-qemu-action@v4+ - if: steps.check.outputs.publish == 'true'+ uses: docker/setup-buildx-action@v4++ - if: steps.check.outputs.publish == 'true'+ uses: docker/login-action@v4with:registry: ghcr.iousername: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}- id: meta+ if: steps.check.outputs.publish == 'true'uses: docker/metadata-action@v6with:images: ghcr.io/dermilderjoghurt/mirrorsync@@ -48,8 +77,12 @@ jobs:org.opencontainers.image.title=MirrorSyncorg.opencontainers.image.version=${{ steps.ver.outputs.version }}org.opencontainers.image.licenses=MIT+ org.opencontainers.image.created=${{ steps.ver.outputs.created }}- - uses: docker/build-push-action@v7+ - if: steps.check.outputs.publish == 'true'+ uses: docker/build-push-action@v7+ env:+ SOURCE_DATE_EPOCH: ${{ steps.ver.outputs.epoch }}with:context: .platforms: linux/amd64,linux/arm64@@ -59,11 +92,16 @@ jobs:labels: ${{ steps.meta.outputs.labels }}cache-from: type=ghacache-to: type=gha,mode=max+ # no extra attestation manifests and fixed timestamps: the digest only changes with the content+ provenance: false+ sbom: false+ outputs: type=image,push=true,rewrite-timestamp=true# Vulnerability scan of the freshly built image with Trivy. Results appear under Security → Code scanning# and in the job log. Does not block the release; new findings show up there and as Dependabot PRs.scan:needs: build+ if: needs.build.outputs.publish == 'true'runs-on: ubuntu-latestpermissions:contents: readdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9535042..9752193 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -3,6 +3,16 @@Version numbers follow [SemVer](https://semver.org/): MAJOR.MINOR.PATCH(MAJOR = incompatible change, MINOR = new feature, PATCH = bug fix).+## 1.40.1 – 2026-11-23+- **Fixed: update checkers kept reporting a pending update.** Until now every push to main rebuilt the image and+ pushed it as `:latest`, also for changes that do not affect the image (README, workflows, Android app,+ Dependabot). Each build also had a new build time and extra attestation data, so the image digest changed every+ time. Dockhand and similar tools compare that digest and therefore showed "update pending" although the version+ was the same. Now the image is only pushed when `app/VERSION` contains a version that is not in the registry+ yet, and builds are reproducible (build time = commit time, no provenance/SBOM manifests). A manual run of the+ workflow with "force" still rebuilds the current version.+- Base image is now `python:3.15-alpine` (Dependabot update).+## 1.40.0 – 2026-11-23- **Android app** (new, folder `android/`): MirrorSync as an app on the phone. A thin wrapper around the webinterface without browser bar, so every new feature is in the app right away. The APK is attached to eachdiff --git a/Dockerfile b/Dockerfileindex 5a99fee..7b8cb58 100644--- a/Dockerfile+++ b/Dockerfile@@ -23,7 +23,7 @@ RUN pip uninstall -y pip setuptools wheel >/dev/null 2>&1; \/usr/local/lib/python3*/site-packages/pip* /usr/local/bin/pip*COPY app/ .-ARG VERSION=1.40.0+ARG VERSION=1.40.1LABEL org.opencontainers.image.title="MirrorSync" org.opencontainers.image.version=$VERSIONENV TZ=Europe/Berlin CONFIG_DIR=/config LOG_DIR=/logs PORT=8080 PYTHONUNBUFFERED=1VOLUME ["/config", "/logs"]diff --git a/README.de.md b/README.de.mdindex 710f2a1..7b3e595 100644--- a/README.de.md+++ b/README.de.md@@ -4,7 +4,7 @@# MirrorSync – 1:1-Spiegelung mit Web-GUI und Zeitplänen-Version **1.39.0** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)+Version **1.40.1** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)Ein Docker-Container, der Ordner **einweg 1:1 spiegelt** (wie FreeFileSync „Spiegeln"):Das Ziel wird exakt wie die Quelle, inklusive Löschungen. Als Sync-Motor dient@@ -68,8 +68,9 @@ Geänderte Dateien werden komplett neu übertragen (kein Delta wie bei rsync).## InstallationDas fertige Image liegt in der GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`-(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.40.0` (feste Version),-`1.34` (neuester Patch dieser Version).+(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.40.1` (feste Version),+`1.40` (neuester Patch dieser Version). Das Image wird nur veröffentlicht, wenn sich die Versionsnummer ändert.+Update-Prüfer wie Dockhand oder Watchtower melden deshalb nur dann ein Update, wenn es wirklich eine neue Version gibt.### Mit Docker Compose (empfohlen)1. Ordner anlegen und die [`docker-compose.yml`](docker-compose.yml) hineinlegen, z. B. nach `/opt/mirrorsync/`.@@ -780,6 +781,6 @@ GUI und unter `/health`.- Beim Bearbeiten Passwortfelder leer lassen, dann bleibt das gespeicherte Passwort erhalten.- Daten liegen in `./config` (Datenbank `mirrorsync.db`, Speicherorte `rclone.conf`) und `./logs` (Lauf-Logs).- Die GUI nur im Heimnetz betreiben oder hinter einen Reverse-Proxy mit HTTPS stellen.-- Enthalten sind nur Alpine Linux mit Python 3.14, rclone 1.76 und wenige Python-Pakete (`app/requirements.txt`),+- Enthalten sind nur Alpine Linux mit Python 3.15, rclone 1.76 und wenige Python-Pakete (`app/requirements.txt`),kein PHP und kein Node.js. Auf GitHub prüft Dependabot jede Woche auf neue Versionen, und Trivy scannt jedesImage auf bekannte Schwachstellen (Ergebnisse unter „Security“ im Repo).diff --git a/README.md b/README.mdindex 81522b3..7d6a88a 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@# MirrorSync – 1:1 mirroring with a web GUI and schedules-Version **1.39.0** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)+Version **1.40.1** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)A Docker container that **mirrors folders one-way, 1:1** (like FreeFileSync "Mirror"):the destination becomes an exact copy of the source, including deletions. The sync engine is@@ -67,8 +67,9 @@ Changed files are transferred completely (no delta transfer like rsync).## InstallationThe ready-made image is in the GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`-(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.40.0` (fixed version),-`1.34` (newest patch of this version).+(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.40.1` (fixed version),+`1.40` (newest patch of this version). The image is only published when the version number changes, so+update checkers such as Dockhand or Watchtower only report an update when there really is a new version.### With Docker Compose (recommended)1. Create a folder and put the [`docker-compose.yml`](docker-compose.yml) into it, e.g. `/opt/mirrorsync/`.@@ -759,7 +760,7 @@ GUI and under `/health`.- When editing, leave password fields empty to keep the stored password.- Data lives in `./config` (database `mirrorsync.db`, storage locations `rclone.conf`) and `./logs` (run logs).- Run the GUI only in your home network or behind a reverse proxy with HTTPS.-- The image contains only Alpine Linux with Python 3.14, rclone 1.76 and a few Python packages+- The image contains only Alpine Linux with Python 3.15, rclone 1.76 and a few Python packages(`app/requirements.txt`), no PHP and no Node.js. On GitHub, Dependabot checks for new versions every week andTrivy scans every image for known vulnerabilities (results under "Security" in the repository).diff --git a/app/VERSION b/app/VERSIONindex 32b7211..53a714f 100644--- a/app/VERSION+++ b/app/VERSION@@ -1 +1 @@-1.40.0+1.40.1diff --git a/docker-compose.yml b/docker-compose.ymlindex ab36e36..68a954c 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -8,7 +8,7 @@services:mirrorsync:- image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.40.0+ image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.40.1# Build it yourself instead of pulling (Dockerfile and app/ in the same folder):# build: .container_name: mirrorsync