Files
Rezept0r/entrypoint.sh
T
Andre 9451c6e6d3 fix: self-update yt-dlp on container start
Instagram and TikTok extraction silently breaks whenever yt-dlp falls
behind upstream API changes, and fixing it required a manual image
rebuild each time. Updating at container start ties the fix to the Pi's
weekly reboot instead, so the extractor stays current without operator
intervention. A failed update never blocks startup, because the network
may not be up yet right after boot.

.gitattributes pins LF for shell scripts: a CRLF checkout on Windows
would make the entrypoint unrunnable inside the Linux container.

Claude-Session: https://claude.ai/code/session_01QkiLqAtFamcbFXDnCtZSPm
2026-07-18 15:06:36 +02:00

16 lines
558 B
Bash

#!/bin/sh
set -e
APP_UID=${APP_UID:-1000}
APP_GID=${APP_GID:-1000}
# Fix ownership of mounted volumes so the app user can write to them
chown "${APP_UID}:${APP_GID}" /app/tmp /app/data /app/data/images
# Self-update yt-dlp on every container start (Instagram/TikTok break old versions).
# Must not block or fail the boot: network may not be up yet after a Pi reboot.
timeout 60 yt-dlp -U || echo "yt-dlp self-update failed, continuing with installed version"
# Drop from root to app user and run the actual command
exec gosu "${APP_UID}:${APP_GID}" "$@"