Skip to content

Commit

Permalink
Add ability to skip chown /data folder (#233)
Browse files Browse the repository at this point in the history
* Add env FIX_DATA_VOLUME_PERMISSIONS to allow user to choose whether to chown the data folder

* Add another log
  • Loading branch information
wahyd4 authored Apr 20, 2023
1 parent 7597acf commit 1e6c885
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ENV RCLONE_AUTO_UPLOAD_PROVIDER=
ENV RCLONE_AUTO_UPLOAD_REMOTE_PATH=/downloads
ENV RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE=1K
ENV RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE=100G
ENV FIX_DATA_VOLUME_PERMISSIONS=false

ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
ADD conf /app/conf
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Then simply run `docker-compose up -d`, that's it!
| `RCLONE_AUTO_UPLOAD_REMOTE_PATH` | The file folder in remote cloud storage provider, default `/downloads`|
| `RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE` | Set the minimum file size of auto uploader, files smaller than it won't be uploaded, default `1K` |
| `RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE` | Set the limit of the Max file can be uploaded to 3rd party storage provider, default `100G`. |
| `FIX_DATA_VOLUME_PERMISSIONS` | Default value is `false`. When set to `true`, the container will run `chown -R` command against `/data` folder and `PUID` and `PGID` you set. Please set it to `true` when container complains you don't have enough permissions to manage the files and folders you mounted.|


### Supported Volumes
Expand Down
10 changes: 8 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ mkdir -p /app/.caddy
mkdir -p /app/.cache
mkdir -p /app/.cache/aria2

echo "[INFO] Run chown against app related folders and user ${PUID}"

chown -R junv:junv \
/app \
/app/.caddy \
/app/.cache \
/usr/local \
/var/log \
/data
/var/log

if [[ "${FIX_DATA_VOLUME_PERMISSIONS}" = "true" ]]; then
echo "[INFO] Setup user ${PUID} proper permissions for /data"
chown -R junv:junv /data
fi

chmod +x /app/caddy.sh \
/app/rclone.sh \
Expand Down

0 comments on commit 1e6c885

Please sign in to comment.