diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:32:40 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:32:40 +0100 |
| commit | 9281c7e48405e8db94194f33af9e3bce60840929 (patch) | |
| tree | 6658755f2c4844963cef5fccbd456a84760509c5 | |
| parent | leaderboard: use competition ranks consistently (diff) | |
| download | senator-sperma-9281c7e48405e8db94194f33af9e3bce60840929.tar.gz senator-sperma-9281c7e48405e8db94194f33af9e3bce60840929.zip | |
docker: pin and verify a week-old yt-dlp release
| -rw-r--r-- | Dockerfile | 14 | ||||
| -rw-r--r-- | README.md | 5 |
2 files changed, 13 insertions, 6 deletions
| @@ -60,10 +60,16 @@ RUN apt-get update \ | |||
| 60 | tzdata \ | 60 | tzdata \ |
| 61 | && rm -rf /var/lib/apt/lists/* | 61 | && rm -rf /var/lib/apt/lists/* |
| 62 | 62 | ||
| 63 | # yt-dlp is distributed as a self-contained Python zipapp; using the latest | 63 | # yt-dlp is distributed as a self-contained Python zipapp. Pin a release that |
| 64 | # release avoids the stale Debian package breaking on YouTube changes. | 64 | # is at least a week old (and verify its checksum) so a compromised or broken |
| 65 | ADD https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp /usr/local/bin/yt-dlp | 65 | # upstream release cannot silently enter the image. |
| 66 | RUN chmod 755 /usr/local/bin/yt-dlp | 66 | ARG YTDLP_VERSION=2026.10.26 |
| 67 | ADD https://github.com/yt-dlp/yt-dlp/releases/download/${YTDLP_VERSION}/yt-dlp /usr/local/bin/yt-dlp | ||
| 68 | ADD https://github.com/yt-dlp/yt-dlp/releases/download/${YTDLP_VERSION}/SHA2-256SUMS /tmp/yt-dlp-sums | ||
| 69 | RUN cd /usr/local/bin \ | ||
| 70 | && grep ' yt-dlp$' /tmp/yt-dlp-sums | sha256sum -c - \ | ||
| 71 | && chmod 755 yt-dlp \ | ||
| 72 | && rm /tmp/yt-dlp-sums | ||
| 67 | 73 | ||
| 68 | RUN useradd --create-home --uid 1000 --shell /usr/sbin/nologin bot \ | 74 | RUN useradd --create-home --uid 1000 --shell /usr/sbin/nologin bot \ |
| 69 | && mkdir -p /app/data /app/piper /tmp/senator_sperma \ | 75 | && mkdir -p /app/data /app/piper /tmp/senator_sperma \ |
| @@ -111,8 +111,9 @@ Notes: | |||
| 111 | - If the build fails to resolve `crates.io` or `deb.debian.org`, run | 111 | - If the build fails to resolve `crates.io` or `deb.debian.org`, run |
| 112 | `docker buildx build --load --network=host -t senator-sperma:latest .`; | 112 | `docker buildx build --load --network=host -t senator-sperma:latest .`; |
| 113 | `compose.yaml` already sets `network: host` for builds on this host. | 113 | `compose.yaml` already sets `network: host` for builds on this host. |
| 114 | - yt-dlp is fetched from the latest upstream release at image build time. | 114 | - yt-dlp is pinned to a specific upstream release and verified against the |
| 115 | Rebuild with `--no-cache` (`docker compose build --no-cache`) to refresh it. | 115 | release checksum at image build time. Bump `YTDLP_VERSION` in the Dockerfile |
| 116 | to update it; pick a release that is at least a week old. | ||
| 116 | 117 | ||
| 117 | ## Commands | 118 | ## Commands |
| 118 | 119 | ||
