5 Commits

Author SHA1 Message Date
Alex
3ce9021143 Merge pull request #877 from its-wizza/optional-chown-download-dir
Add environment variable to skip changing ownership of directories on startup
2026-01-29 23:10:41 +02:00
Lachlan Wisdom
c7ce543704 Update ownership settings in README 2026-01-13 22:53:15 +11:00
Lachlan Wisdom
6b9461c8a8 Simplify directory ownership changes in entrypoint
Refactor ownership change logic for directories.
2026-01-13 22:47:56 +11:00
Lachlan Wisdom
38a77d19f5 Add CHOWN_DOWNLOAD_DIR option to README 2026-01-13 22:27:24 +11:00
Lachlan Wisdom
6a9098ab32 Update ownership handling in docker-entrypoint.sh
Refactor ownership change logic for directories
2026-01-13 22:21:27 +11:00
2 changed files with 5 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ Certain values can be set via environment variables, using the `-e` parameter on
* __TEMP_DIR__: Path where intermediary download files will be saved. Defaults to `/downloads` in the Docker image, and `.` otherwise.
* Set this to an SSD or RAM filesystem (e.g., `tmpfs`) for better performance.
* __Note__: Using a RAM filesystem may prevent downloads from being resumed.
* __CHOWN_DIRS__: If `false`, ownership of `DOWNLOAD_DIR`, `STATE_DIR`, and `TEMP_DIR` (and their contents) will not be set on container start. Ensure user under which MeTube runs has necessary access to these directories already. Defaults to `true`.
### 📝 File Naming & yt-dlp

View File

@@ -9,8 +9,10 @@ if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then
if [ "${UID}" -eq 0 ]; then
echo "Warning: it is not recommended to run as root user, please check your setting of the UID environment variable"
fi
if [ "${CHOWN_DIRS:-true}" != "false" ]; then
echo "Changing ownership of download and state directories to ${UID}:${GID}"
chown -R "${UID}":"${GID}" /app "${DOWNLOAD_DIR}" "${STATE_DIR}" "${TEMP_DIR}"
fi
echo "Running MeTube as user ${UID}:${GID}"
exec su-exec "${UID}":"${GID}" python3 app/main.py
else