Skip to content

Fix for Dropbox v95.4.441 (fixes #4) #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ ENV DEBIAN_FRONTEND noninteractive

# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl gnupg2 software-properties-common gosu locales locales-all unzip build-essential
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl gnupg2 \
software-properties-common gosu locales locales-all \
libc6 libglapi-mesa libxdamage1 libxfixes3 libxcb-glx0 \
libxcb-dri2-0 libxcb-dri3-0 libxcb-present0 libxcb-sync1 \
libxshmfence1 libxxf86vm1 tzdata

# Create user and group
RUN mkdir -p /opt/dropbox /opt/dropbox/.dropbox /opt/dropbox/Dropbox \
Expand All @@ -46,16 +50,9 @@ EXPOSE 17500
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FC918B335044912E \
&& add-apt-repository 'deb http://linux.dropbox.com/debian buster main' \
&& apt-get update \
&& apt-get install -y --no-install-recommends libatomic1 python3-gpg dropbox \
&& rm -rf /var/lib/apt/lists/*

RUN curl --location https://github.com/dark/dropbox-filesystem-fix/archive/master.zip > /tmp/dropbox-filesystem-fix.zip \
&& unzip /tmp/dropbox-filesystem-fix.zip -d /opt \
&& rm /tmp/dropbox-filesystem-fix.zip \
&& mv /opt/dropbox-filesystem-fix-master/ /opt/dropbox-filesystem-fix/ \
&& cd /opt/dropbox-filesystem-fix/ \
&& make \
&& chmod +x /opt/dropbox-filesystem-fix/dropbox_start.py
&& apt-get -qqy install python3-gpg dropbox \
&& apt-get -qqy autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Dropbox insists on downloading its binaries itself via 'dropbox start -i'
RUN echo "y" | gosu dropbox dropbox start -i
Expand All @@ -80,4 +77,4 @@ COPY docker-entrypoint.sh /

# Set entrypoint and command
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/opt/dropbox-filesystem-fix/dropbox_start.py"]
CMD ["/opt/dropbox/bin/dropboxd"]
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ For example, to get an overview of the commands possible, use `help`:
### Environment Variables

- `DROPBOX_UID`
If set, runs Dropbox with a custom user id. This must matching the user id of the owner of the mounted
If set, runs Dropbox with a custom user id. This **must** match the user id of the owner of the mounted
files. Defaults to `1000`.

- `DROPBOX_GID`
If set, runs Dropbox with a custom user id. This must matching the group id of the owner of the mounted
If set, runs Dropbox with a custom user id. This **must** match the group id of the owner of the mounted
files. Defaults to `1000`.

- `DROPBOX_SKIP_UPDATE`
Expand All @@ -103,10 +103,9 @@ every time you restart the container.

## Note 📝

It appears that as of `December 2019`, Dropbox (version `87.4.138`) is now finally enforcing its
[file system requirements](https://help.dropbox.com/installs-integrations/desktop/system-requirements#linux).
Because this causes problems with Docker volume mounts, this container now includes the
[`dropbox-filesystem-fix` patch](https://github.com/dark/dropbox-filesystem-fix/).
It appears that as of Dropbox version `81.3.183`, the [`dropbox-filesystem-fix` patch](https://github.com/dark/dropbox-filesystem-fix/)
is [unable to get around the filesystem detection](https://github.com/dark/dropbox-filesystem-fix/issues/13).


## Inspiration 💅

Expand Down
23 changes: 5 additions & 18 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ if [[ -z "$DROPBOX_SKIP_UPDATE" ]]; then
rm -rf /opt/dropbox/bin/*
mv $tmpdir/.dropbox-dist/* /opt/dropbox/bin/
rm -rf $tmpdir
find /opt/dropbox/bin -type f -name "*.so" -exec chmod a+rx {} \;
find /opt/dropbox/bin -type f -name "*.so" -exec chown dropbox {} \;
find /opt/dropbox/bin/ -type f -name "*.so" -exec chown ${DROPBOX_UID}:${DROPBOX_GID} {} \; -exec chmod a+rx {} \;
echo "Dropbox updated to v$Latest"
else
echo "Dropbox is up-to-date"
Expand All @@ -77,20 +76,8 @@ fi
echo ""
umask 002

echo "Patching dropbox_start.py for updated dropboxd path"
sed -i "s:~/.dropbox-dist/dropboxd:/opt/dropbox/bin/dropboxd:g" /opt/dropbox-filesystem-fix/dropbox_start.py
sed -i "s:/usr/bin/python:$(which python3):g" /opt/dropbox-filesystem-fix/dropbox_start.py

echo ""

echo "Starting dropboxd ($(cat /opt/dropbox/bin/VERSION))..."
gosu dropbox /opt/dropbox-filesystem-fix/dropbox_start.py
export DROPBOX_PID=$(pidof dropbox)
trap "kill -SIGQUIT ${DROPBOX_PID}" INT

# Dropbox likes to restart itself. In that case, the container will exit!
while kill -0 ${DROPBOX_PID} 2> /dev/null; do
gosu dropbox dropbox status
sleep 1
done

exec gosu dropbox "$@" &
pid="$!"
trap "kill -SIGQUIT $pid" INT
wait