Add option to change permissions on upload dir

Since some people serve their static data by uploads directory, unhandy
to set the permissions of the upload directory to 0700 by default.

In order to allow everyone to set the permissions themselves, an option
`UPLOADS_MODE` is introduced that will allow to define the default mode
set to the directory.
Signed-off-by: 's avatarSheogorath <sheogorath@shivering-isles.com>
parent 2ecef1c3
......@@ -27,6 +27,7 @@ RUN yarn install --production=true --pure-lockfile
FROM base
ARG UID=10000
ENV NODE_ENV=production
ENV UPLOADS_MODE=0700
COPY --chown=$UID --from=builder /hedgedoc /hedgedoc
......
......@@ -27,6 +27,7 @@ RUN yarn install --production=true --pure-lockfile
FROM base
ARG UID=10000
ENV NODE_ENV=production
ENV UPLOADS_MODE=0700
RUN apt-get update && \
apt-get install --no-install-recommends -y gosu && \
......
......@@ -30,7 +30,7 @@ fi
if [ "$UID" -eq 0 ] && [ "$CMD_IMAGE_UPLOAD_TYPE" = "filesystem" ]; then
if [ "$UID" -eq 0 ]; then
chown -R hedgedoc ./public/uploads
chmod 700 ./public/uploads
chmod -R $UPLOADS_MODE ./public/uploads
else
echo "
#################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment