Skip to content

Commit

Permalink
[Enhancement] Add support for UMASK environment variable (#582)
Browse files Browse the repository at this point in the history
* Add umask setting to docker start

* Testing adding umask env var

* Added umask to README
  • Loading branch information
kieraneglin authored Jan 21, 2025
1 parent 3dd2014 commit 704d29d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ If you change this setting and it works well for you, please leave a comment on
| --------------------------- | --------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `TZ` | No | `UTC` | Must follow IANA TZ format |
| `LOG_LEVEL` | No | `debug` | Can be set to `info` but `debug` is strongly recommended |
| `UMASK` | No | `022` | Unraid users may want to set this to `000` |
| `BASIC_AUTH_USERNAME` | No | | See [authentication docs](https://github.com/kieraneglin/pinchflat/wiki/Username-and-Password) |
| `BASIC_AUTH_PASSWORD` | No | | See [authentication docs](https://github.com/kieraneglin/pinchflat/wiki/Username-and-Password) |
| `EXPOSE_FEED_ENDPOINTS` | No | `false` | See [RSS feed docs](https://github.com/kieraneglin/pinchflat/wiki/Podcast-RSS-Feeds) |
Expand Down
9 changes: 5 additions & 4 deletions docker/selfhosted.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG DEBIAN_VERSION=bookworm-20240612-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"

FROM ${BUILDER_IMAGE} as builder
FROM ${BUILDER_IMAGE} AS builder

ARG TARGETPLATFORM
RUN echo "Building for ${TARGETPLATFORM:?}"
Expand Down Expand Up @@ -110,9 +110,9 @@ RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/*

# More locale setup
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

WORKDIR "/app"

Expand All @@ -124,6 +124,7 @@ RUN mkdir -p /config /downloads /etc/elixir_tzdata_data /etc/yt-dlp/plugins && \
ENV MIX_ENV="prod"
ENV PORT=${PORT}
ENV RUN_CONTEXT="selfhosted"
ENV UMASK=022
EXPOSE ${PORT}

# Only copy the final release from the build stage
Expand Down
3 changes: 3 additions & 0 deletions rel/overlays/bin/docker_start
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if [ $? -ne 0 ]; then
exit 1
fi

echo "Setting umask to ${UMASK}"
umask ${UMASK}

/app/bin/migrate

cd -P -- "$(dirname -- "$0")"
Expand Down

0 comments on commit 704d29d

Please sign in to comment.