Skip to content

Commit 59c3fe8

Browse files
committed
fix(image): strip packaging tools for Trivy-clean GHCR (v2.2.2)
Merge PR #32
2 parents 806d5c1 + 7ebc9af commit 59c3fe8

8 files changed

Lines changed: 24 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.2.2] - 2026-07-17
11+
12+
### Security
13+
14+
- Runtime image uninstalls `setuptools`, `wheel`, and `pip` after the hashed
15+
requirement install so Trivy HIGH findings in setuptools-vendored
16+
`jaraco.context` / `wheel` (CVE-2026-23949, CVE-2026-24049) cannot block GHCR
17+
publication of an otherwise clean artifact.
18+
1019
## [2.2.1] - 2026-07-17
1120

1221
### Security

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ RUN apk add --no-cache \
2121
nginx=1.30.3-r0 \
2222
pcre2=10.47-r1
2323

24-
# Copy requirements and install
24+
# Copy requirements and install. Then strip packaging tooling that is only needed
25+
# to install wheels: setuptools/wheel/pip (and their vendored trees) are not used
26+
# by the runtime and have historically carried HIGH Trivy findings.
2527
COPY requirements.txt .
26-
RUN pip install --no-cache-dir --require-hashes --only-binary=:all: -r requirements.txt
28+
RUN pip install --no-cache-dir --require-hashes --only-binary=:all: -r requirements.txt \
29+
&& pip uninstall -y setuptools wheel pip \
30+
&& rm -rf /root/.cache /tmp/pip-*
2731

2832
# Copy only runtime modules; tests, benchmarks, and operator helpers do not
2933
# belong in the published execution artifact.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.1
1+
2.2.2

overlay/read.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<link rel="stylesheet" href="{{ url_for('static', filename='css/popup.css') }}">
2626
<link rel="stylesheet" href="{{ url_for('static', filename='css/reader.css') }}">
2727
<!-- book-translator: bilingual reading overlay -->
28-
<link rel="stylesheet" href="{{ url_for('static', filename='css/translator.css') }}?v=2.2.1">
28+
<link rel="stylesheet" href="{{ url_for('static', filename='css/translator.css') }}?v=2.2.2">
2929
<script>
3030
// book-translator configuration.
3131
// This legacy bind-mount template is HTTP-only as shipped: an empty
@@ -269,6 +269,6 @@ <h3>{{_('Settings')}}</h3>
269269
<script src="{{ url_for('static', filename='js/reading/epub.js') }}"></script>
270270
<script src="{{ url_for('static', filename='js/reading/epub-progress.js') }}"></script>
271271
<!-- book-translator: bilingual translation injection -->
272-
<script src="{{ url_for('static', filename='js/translator.js') }}?v=2.2.1"></script>
272+
<script src="{{ url_for('static', filename='js/translator.js') }}?v=2.2.2"></script>
273273
</body>
274274
</html>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cwa-ebook-translate-plugin",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "Bilingual LLM-powered translation overlay for Calibre-Web-Automated. Translate ebooks paragraph-by-paragraph while reading, in 100+ languages, using local LLMs (Gemma 4 via vLLM/LM Studio/Ollama) or any major cloud API.",
55
"main": "test_frontend.js",
66
"directories": {

static/translator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(function () {
66
'use strict';
77
// ── Version & Telemetry ──────────────────────────────────────────
8-
const BT_UI_VERSION = '2.2.1';
8+
const BT_UI_VERSION = '2.2.2';
99
console.log(`[BookTranslator] loaded version ${BT_UI_VERSION}`);
1010
const cfg = (typeof window !== 'undefined' && window.BOOK_TRANSLATOR) || {};
1111
const configuredAuthMode = cfg.authMode || (cfg.apiToken ? 'token' : 'cwa_session');

test_supply_chain_contract.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ def test_python_installs_require_the_reviewed_hashes_and_wheels(self):
216216
"--only-binary=:all: -r requirements.txt",
217217
dockerfile,
218218
)
219+
# Runtime image must not retain packaging tooling after install (Trivy).
220+
self.assertIn("pip uninstall -y setuptools wheel pip", dockerfile)
219221

220222
def test_python_lock_files_pin_and_hash_every_dependency(self):
221223
for name in (

0 commit comments

Comments
 (0)