Skip to content

Commit

Permalink
Testing permissions and uid/gid
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Aug 19, 2024
1 parent 5eed18b commit 6811883
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ COPY clean_downloads.cron /home/wis2downloader/app/clean_downloads.cron
COPY clean_downloads.py /home/wis2downloader/app/clean_downloads.py

USER root
RUN chown -R wis2downloader:wis2 /home/wis2downloader/app
RUN chmod +x /home/wis2downloader/app/entrypoint.sh
RUN chmod 600 /home/wis2downloader/app/clean_downloads.py
RUN chmod 600 /home/wis2downloader/app/clean_downloads.cron
RUN chown -R wis2downloader:wis2 /home/wis2downloader/app && \
chmod +x /home/wis2downloader/app/entrypoint.sh && \
chmod 600 /home/wis2downloader/app/clean_downloads.py && \
chmod 600 /home/wis2downloader/app/clean_downloads.cron && \
usermod -aG sudo wis2downloader

USER wis2downloader
# Set the working directory to /app
Expand Down
6 changes: 3 additions & 3 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ echo "Before usermod"
echo "$(id -g):$(id -u)"
echo "$(whoami)"

su -c "usermod -u $(id -u) wis2downloader" root
su -c "groupmod -g $(id -g) wis2" root
sudo "usermod -u $(id -u) wis2downloader"
sudo "groupmod -g $(id -g) wis2"
sudo "usermode -g wis2 wis2downloader"

# switch to wis2downloader user
su - wis2downloader
echo "After usermod"
echo "$(id -g):$(id -u)"
echo "$(whoami)"
Expand Down

0 comments on commit 6811883

Please sign in to comment.