Skip to content

Commit

Permalink
Add skip permissions check feature (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
otherguy authored Jun 25, 2021
1 parent 64c347f commit 9759ba8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ LABEL org.label-schema.vcs-ref "${VCS_REF}"

# Configurable sleep delay
ENV POLLING_INTERVAL=5
# Possibility to skip permission check
ENV SKIP_SET_PERMISSIONS=false

# Install init script and dropbox command line wrapper
COPY docker-entrypoint.sh /
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ are explained in the sections below.

### Checking Dropbox Version

Dropbox will return incorrect information (`Dropbox daemon version: Not installed`) when you run `dropbox version` in
Dropbox will return incorrect information (`Dropbox daemon version: Not installed`) when you run `dropbox version` in
the container. In case you ever need to know which version you have installed, instead run the following:

$ docker exec -it dropbox cat /opt/dropbox/bin/VERSION
Expand Down Expand Up @@ -170,6 +170,11 @@ Needs to be set to a positive integer value. The Dropbox daemon is polled for it
which can be configured to reduce load on the system. This is the number in seconds to wait between polling the
Dropbox daemon. Defaults to `5`.

- `SKIP_SET_PERMISSIONS`
If this is set to `true`, the container skips setting the permissions on all files in the `/opt/dropbox` folder
in order to prevent long startup times. _Note:_ please make sure to have correct permissions on all files before
you do this! Implemented for [#25](https://github.com/otherguy/docker-dropbox/issues/25).

### Exposed Volumes

- `/opt/dropbox/Dropbox`
Expand All @@ -186,9 +191,9 @@ every time you restart the container.
From [Troubleshoot Dropbox syncing issues](https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing):

> The Linux version of the Dropbox desktop app is limited from monitoring more than 10,000 folders by default. Anything more than that is not watched and, therefore, ignored when syncing. There's an easy fix for this. Open a terminal and enter the following:
>
>
> `echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p`
>
>
> This command will tell your system to watch up to 100,000 folders. Once the command is entered and you enter your password, Dropbox will immediately resume syncing.

Expand Down
7 changes: 6 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ fi
usermod -u ${DROPBOX_UID} -g ${DROPBOX_GID} --non-unique dropbox > /dev/null 2>&1

# Change ownership to dropbox account on all working folders.
chown -R ${DROPBOX_UID}:${DROPBOX_GID} /opt/dropbox
if [[ $(echo "${SKIP_SET_PERMISSIONS:-false}" | tr '[:upper:]' '[:lower:]' | tr -d " ") == "true" ]]; then
echo "Skipping permissions check, ensure the dropbox user owns all files!"
chown ${DROPBOX_UID}:${DROPBOX_GID} /opt/dropbox
else
chown -R ${DROPBOX_UID}:${DROPBOX_GID} /opt/dropbox
fi

# Change permissions on Dropbox folder
chmod 755 /opt/dropbox/Dropbox
Expand Down

0 comments on commit 9759ba8

Please sign in to comment.