mirror of
https://github.com/alexta69/metube.git
synced 2026-03-03 03:07:02 +00:00
Merge pull request #877 from its-wizza/optional-chown-download-dir
Add environment variable to skip changing ownership of directories on startup
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user