Skip to content

Commit 1e6c885

Browse files
authored
Add ability to skip chown /data folder (#233)
* Add env FIX_DATA_VOLUME_PERMISSIONS to allow user to choose whether to chown the data folder * Add another log
1 parent 7597acf commit 1e6c885

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ENV RCLONE_AUTO_UPLOAD_PROVIDER=
3939
ENV RCLONE_AUTO_UPLOAD_REMOTE_PATH=/downloads
4040
ENV RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE=1K
4141
ENV RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE=100G
42+
ENV FIX_DATA_VOLUME_PERMISSIONS=false
4243

4344
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
4445
ADD conf /app/conf

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ Then simply run `docker-compose up -d`, that's it!
139139
| `RCLONE_AUTO_UPLOAD_REMOTE_PATH` | The file folder in remote cloud storage provider, default `/downloads`|
140140
| `RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE` | Set the minimum file size of auto uploader, files smaller than it won't be uploaded, default `1K` |
141141
| `RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE` | Set the limit of the Max file can be uploaded to 3rd party storage provider, default `100G`. |
142+
| `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.|
142143

143144

144145
### Supported Volumes

init.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ mkdir -p /app/.caddy
88
mkdir -p /app/.cache
99
mkdir -p /app/.cache/aria2
1010

11+
echo "[INFO] Run chown against app related folders and user ${PUID}"
12+
1113
chown -R junv:junv \
1214
/app \
1315
/app/.caddy \
1416
/app/.cache \
1517
/usr/local \
16-
/var/log \
17-
/data
18+
/var/log
19+
20+
if [[ "${FIX_DATA_VOLUME_PERMISSIONS}" = "true" ]]; then
21+
echo "[INFO] Setup user ${PUID} proper permissions for /data"
22+
chown -R junv:junv /data
23+
fi
1824

1925
chmod +x /app/caddy.sh \
2026
/app/rclone.sh \

0 commit comments

Comments
 (0)