Skip to content

Commit

Permalink
feat!: default to nobody:nogroup in containers (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p authored May 14, 2024
1 parent a0dd346 commit 85811a6
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 21 deletions.
4 changes: 4 additions & 0 deletions apps/bazarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ RUN \
COPY ./apps/bazarr/entrypoint.sh /entrypoint.sh
COPY --from=ghcr.io/linuxserver/unrar:7.0.7 /usr/bin/unrar-alpine /usr/bin/unrar

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/bazarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

#shellcheck disable=SC2086
exec \
/usr/bin/python3 \
Expand Down
2 changes: 2 additions & 0 deletions apps/jbops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ RUN apk add --no-cache \

COPY ./apps/jbops/entrypoint.sh /entrypoint.sh

USER nobody:nogroup

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
4 changes: 4 additions & 0 deletions apps/lidarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ COPY ./apps/lidarr/config.xml.tmpl /app/config.xml.tmpl
COPY ./apps/lidarr/entrypoint.sh /entrypoint.sh
COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/lidarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

# Discover existing configuration settings for backwards compatibility
if [[ -f /config/config.xml ]]; then
current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)"
Expand Down
4 changes: 4 additions & 0 deletions apps/plex/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,9 @@ RUN \

COPY ./apps/plex/entrypoint.sh /entrypoint.sh

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT [ "/usr/bin/catatonit", "--" ]
CMD ["/entrypoint.sh"]
4 changes: 4 additions & 0 deletions apps/prowlarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ COPY ./apps/prowlarr/config.xml.tmpl /app/config.xml.tmpl
COPY ./apps/prowlarr/entrypoint.sh /entrypoint.sh
COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/prowlarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

# Discover existing configuration settings for backwards compatibility
if [[ -f /config/config.xml ]]; then
current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)"
Expand Down
4 changes: 4 additions & 0 deletions apps/qbittorrent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ RUN \
COPY ./apps/qbittorrent/scripts/config.py /scripts/config.py
COPY ./apps/qbittorrent/entrypoint.sh /entrypoint.sh

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
4 changes: 4 additions & 0 deletions apps/radarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ COPY ./apps/radarr/config.xml.tmpl /app/config.xml.tmpl
COPY ./apps/radarr/entrypoint.sh /entrypoint.sh
COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/radarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

# Discover existing configuration settings for backwards compatibility
if [[ -f /config/config.xml ]]; then
current_analytics_enabled="$(xmlstarlet sel -t -v "//AnalyticsEnabled" -nl /config/config.xml)"
Expand Down
4 changes: 4 additions & 0 deletions apps/readarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ COPY ./apps/readarr/config.xml.tmpl /app/config.xml.tmpl
COPY ./apps/readarr/entrypoint.sh /entrypoint.sh
COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/readarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

# Discover existing configuration settings for backwards compatibility
if [[ -f /config/config.xml ]]; then
current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)"
Expand Down
4 changes: 4 additions & 0 deletions apps/sabnzbd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ RUN ln -s /usr/local/bin/par2 /usr/local/bin/par2create \
&& ln -s /usr/local/bin/par2 /usr/local/bin/par2verify
COPY --from=ghcr.io/linuxserver/unrar:7.0.7 /usr/bin/unrar-alpine /usr/bin/unrar

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/sabnzbd/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

if [[ ! -f "/config/sabnzbd.ini" ]]; then
printf "Copying over default configuration ...\n"
mkdir -p /config/sabnzbd
Expand Down
4 changes: 4 additions & 0 deletions apps/sonarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ COPY ./apps/sonarr/config.xml.tmpl /app/config.xml.tmpl
COPY ./apps/sonarr/entrypoint.sh /entrypoint.sh
COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
2 changes: 0 additions & 2 deletions apps/sonarr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

mkdir -p /config

# Discover existing configuration settings for backwards compatibility
if [[ -f /config/config.xml ]]; then
current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)"
Expand Down
13 changes: 6 additions & 7 deletions apps/theme-park/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG VERSION
ARG CHANNEL

USER root
ENV NGINX_WEB_ROOT "/usr/share/nginx/html"

#hadolint ignore=DL3008
RUN \
Expand All @@ -20,18 +19,18 @@ RUN \
&& \
grep -rl 'https://theme-park.dev' /tmp | xargs sed -i 's/https\:\/\/theme-park.dev//g' \
&& \
cp -r /tmp/css/ "${NGINX_WEB_ROOT}" \
&& cp -r /tmp/resources/ "${NGINX_WEB_ROOT}" \
&& cp /tmp/index.html "${NGINX_WEB_ROOT}" \
cp -r /tmp/css/ /usr/share/nginx/html \
&& cp -r /tmp/resources/ /usr/share/nginx/html \
&& cp /tmp/index.html /usr/share/nginx/html \
&& apt-get remove -y python3 \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt-get autoremove -y \
&& apt-get clean \
&& chown -R nginx:nginx "${NGINX_WEB_ROOT}" \
&& chmod -R 755 "${NGINX_WEB_ROOT}" \
&& chown -R nginx:nginx /usr/share/nginx/html \
&& chmod -R 755 /usr/share/nginx/html \
&& rm -rf /tmp/*

USER nginx
WORKDIR ${NGINX_WEB_ROOT}
WORKDIR /usr/share/nginx/html

LABEL org.opencontainers.image.source="https://github.com/themepark-dev/theme.park"

0 comments on commit 85811a6

Please sign in to comment.