From f5ba68fa3f7d6c513d3582dbd9c54610649b8123 Mon Sep 17 00:00:00 2001 From: Franz Haberfellner Date: Tue, 10 Nov 2026 20:59:08 +0100 Subject: [PATCH] fix(mcp,ci): add required MCP Registry OCI label and harden bootstrap retry (#141) --- .github/actions/live-verification/action.yml | 14 ++++++++++++++ .github/workflows/publish-dockerhub.yml | 4 ++++ CHANGELOG.md | 9 ++++++++- docker/Dockerfile | 5 +++-- docs/releases.md | 5 +++++ pyproject.toml | 2 +- server.json | 4 ++-- tests/unit/test_ci_workflows.py | 3 +++ tests/unit/test_contracts.py | 2 ++ uv.lock | 2 +- 10 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/actions/live-verification/action.yml b/.github/actions/live-verification/action.yml index a21697c..33e99f3 100644 --- a/.github/actions/live-verification/action.yml +++ b/.github/actions/live-verification/action.yml @@ -92,6 +92,10 @@ runs: BOOTSTRAPPED=true break fi + if [ "$i" -eq 12 ] || [ "$i" -eq 24 ]; then + echo "⚠️ Tor still at ${PROGRESS:-0}% after $((i * 5))s; restarting container to select a fresh directory mirror..." + docker restart torproxy-canary || true + fi sleep 5 done @@ -376,7 +380,9 @@ runs: # capped at 180s with bounded polls, like the PR gate. BOOTSTRAPPED=false START=$SECONDS + ATTEMPT=0 while [ $((SECONDS - START)) -lt 180 ]; do + ATTEMPT=$((ATTEMPT + 1)) # Bootstrap progress, not /status "connected": the latter # requires the external check.torproject.org egress probe, # whose intermittent unreachability flaked this step @@ -387,6 +393,10 @@ runs: BOOTSTRAPPED=true break fi + if [ "$ATTEMPT" -eq 12 ] || [ "$ATTEMPT" -eq 24 ]; then + echo "⚠️ Gateway Tor still at ${PROGRESS:-0}% after $((SECONDS - START))s; restarting container to select a fresh directory mirror..." + docker restart torproxy-canary-gateway || true + fi sleep 5 done if [ "$BOOTSTRAPPED" != "true" ]; then @@ -479,6 +489,10 @@ runs: fi break fi + if [ "$i" -eq 12 ] || [ "$i" -eq 24 ]; then + echo "⚠️ GeoIP Tor still at ${PROGRESS:-0}% after $((i * 5))s; restarting container to select a fresh directory mirror..." + docker restart torproxy-canary-geoip || true + fi sleep 5 done if [ "$BOOTSTRAPPED" != "true" ]; then diff --git a/.github/workflows/publish-dockerhub.yml b/.github/workflows/publish-dockerhub.yml index 5259eb6..c01f3e1 100644 --- a/.github/workflows/publish-dockerhub.yml +++ b/.github/workflows/publish-dockerhub.yml @@ -61,6 +61,8 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=ref,event=tag type=semver,pattern={{version}} + labels: | + io.modelcontextprotocol.server.name=io.github.hapheus/torproxy - name: Build and publish image uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 @@ -71,6 +73,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + annotations: | + index,manifest:io.modelcontextprotocol.server.name=io.github.hapheus/torproxy provenance: mode=max sbom: true cache-from: type=gha diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f4596..7c5338e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.7.4] — 2026-11-10 + +### Fixed +- **mcp**: Add required `io.modelcontextprotocol.server.name="io.github.hapheus/torproxy"` OCI label and annotations to Dockerfile and Docker Hub workflow (#141) +- **ci**: Add mid-window container restart fallback in live verification when Tor bootstrap stalls on a slow directory mirror (#141) + ## [2.7.3] — 2026-11-10 ### Fixed @@ -229,7 +235,8 @@ Sprint 1 security & contract correctness release. --- -[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.3...HEAD +[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.4...HEAD +[2.7.4]: https://github.com/hapheus/torproxy/compare/v2.7.3...v2.7.4 [2.7.3]: https://github.com/hapheus/torproxy/compare/v2.7.2...v2.7.3 [2.7.2]: https://github.com/hapheus/torproxy/compare/v2.7.1...v2.7.2 [2.7.1]: https://github.com/hapheus/torproxy/compare/v2.7.0...v2.7.1 diff --git a/docker/Dockerfile b/docker/Dockerfile index 248261f..f2abe07 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,10 +7,11 @@ ARG PYTHON_VERSION=3.14 LABEL org.opencontainers.image.title="torproxy" \ org.opencontainers.image.description="A minimal HTTP proxy routed through Tor" \ - org.opencontainers.image.version="2.7.3" \ + org.opencontainers.image.version="2.7.4" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.source="https://github.com/hapheus/torproxy" \ - org.opencontainers.image.url="https://github.com/hapheus/torproxy" + org.opencontainers.image.url="https://github.com/hapheus/torproxy" \ + io.modelcontextprotocol.server.name="io.github.hapheus/torproxy" RUN apk add --no-cache bash ca-certificates curl privoxy tini tor "python3~${PYTHON_VERSION}" iptables iptables-legacy libcap \ && python3 --version \ diff --git a/docs/releases.md b/docs/releases.md index 2f1801a..b388578 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -91,6 +91,11 @@ If an upgraded image exhibits unexpected behavior in your environment: ## 6. Release Notes +### 2.7.4 (MCP Registry OCI label requirement and live bootstrap resilience) + +- **MCP Registry OCI Label & Annotations (#141):** Added `LABEL io.modelcontextprotocol.server.name="io.github.hapheus/torproxy"` to `docker/Dockerfile` and OCI index/manifest annotations in `publish-dockerhub.yml`, satisfying the official MCP Registry verification requirement for OCI container packages. +- **Bootstrap Mirror Failover (#141):** Added mid-window container restart fallback in `live-verification/action.yml` when cold-start Tor consensus download stalls on an unresponsive directory mirror. + ### 2.7.3 (DockerHub SemVer tagging and MCP Registry publish coordination) - **DockerHub Tagging & MCP Publish Coordination (#138):** Added `type=semver,pattern={{version}}` to `publish-dockerhub.yml` so Docker Hub receives both `X.Y.Z` and `vX.Y.Z` tags. Added synchronization in `publish-mcp.yml` to wait for the target OCI container image to be verified on Docker Hub before publishing `server.json` to `registry.modelcontextprotocol.io`. diff --git a/pyproject.toml b/pyproject.toml index 34c9c70..362d44c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "torproxy" -version = "2.7.3" +version = "2.7.4" description = "A minimal HTTP and SOCKS5 proxy routed through the Tor network with local REST control API" readme = "README.md" requires-python = ">=3.10" diff --git a/server.json b/server.json index 049bd68..571c39d 100644 --- a/server.json +++ b/server.json @@ -3,7 +3,7 @@ "name": "io.github.hapheus/torproxy", "title": "torproxy", "description": "Tor HTTP and SOCKS5 proxy with REST API and built-in MCP server.", - "version": "2.7.3", + "version": "2.7.4", "repository": { "url": "https://github.com/hapheus/torproxy", "source": "github" @@ -11,7 +11,7 @@ "packages": [ { "registryType": "oci", - "identifier": "docker.io/hapheus/torproxy:2.7.3", + "identifier": "docker.io/hapheus/torproxy:2.7.4", "transport": { "type": "stdio" }, diff --git a/tests/unit/test_ci_workflows.py b/tests/unit/test_ci_workflows.py index c5178ef..7812d80 100644 --- a/tests/unit/test_ci_workflows.py +++ b/tests/unit/test_ci_workflows.py @@ -119,6 +119,9 @@ def test_publish_mcp_waits_for_live_verification() -> None: assert "needs: verify-live" in publish_mcp or "needs: [verify-live]" in publish_mcp assert "id-token: write" in publish_mcp assert "mcp-publisher login github-oidc" in publish_mcp + assert "docker manifest inspect" in publish_mcp + publish_dockerhub = _read("publish-dockerhub.yml") + assert "io.modelcontextprotocol.server.name=io.github.hapheus/torproxy" in publish_dockerhub def test_daily_canary_reuses_the_shared_action() -> None: diff --git a/tests/unit/test_contracts.py b/tests/unit/test_contracts.py index f4ebeab..ab63cae 100644 --- a/tests/unit/test_contracts.py +++ b/tests/unit/test_contracts.py @@ -322,6 +322,8 @@ def test_version_single_source_of_truth(self): with open(server_json_path, "r", encoding="utf-8") as f: server_data = json.load(f) assert server_data["version"] == project_version + server_name = server_data["name"] + assert f'io.modelcontextprotocol.server.name="{server_name}"' in dockerfile for pkg in server_data.get("packages", []): if pkg.get("registryType") == "oci": assert pkg["identifier"].endswith(f":{project_version}") diff --git a/uv.lock b/uv.lock index 9a0f318..77da3a9 100644 --- a/uv.lock +++ b/uv.lock @@ -842,7 +842,7 @@ wheels = [ [[package]] name = "torproxy" -version = "2.7.3" +version = "2.7.4" source = { editable = "." } [package.optional-dependencies]