From 8e4a3119ab0ebc1cff470bcd663ca8b6d69c3e43 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Tue, 3 May 2022 08:25:38 +0200 Subject: [PATCH 01/21] =?UTF-8?q?=F0=9F=9A=80=20bye=20unnecessary=20build?= =?UTF-8?q?=20cleanups=20(not=20last=20stage)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fb263b..343dba0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,9 +20,6 @@ RUN apt-get update && apt-get -y install \ # spares us this spaghetti approach: https://stackoverflow.com/a/60547197 npm && \ apt-get install -f && \ - apt-get autoremove --purge && \ - apt-get autoremove && \ - apt-get clean && \ npm config set strict-ssl false && \ npm install -g @angular/cli From 06ca9cbe76af1deecc4f51679b834f4a9405d636 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Tue, 3 May 2022 08:26:37 +0200 Subject: [PATCH 02/21] build excludes: now matches ANY *.md :) --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 165b51b..6cd9cc6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,9 +8,9 @@ on: - '.vscode/**' - 'chrome-extension/**' - 'releases/**' + - '**/**.md' - '**.crx' - '**.pem' - - '**.md' - '.dockerignore' - '.gitignore' From 849c1927d336aac0a89d542861002823c01650dd Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Tue, 3 May 2022 08:27:42 +0200 Subject: [PATCH 03/21] Add fix script for interactive permission fixing. --- fix-scripts/001 - fix_download_permissions.sh | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 fix-scripts/001 - fix_download_permissions.sh diff --git a/fix-scripts/001 - fix_download_permissions.sh b/fix-scripts/001 - fix_download_permissions.sh new file mode 100644 index 0000000..6f7bad1 --- /dev/null +++ b/fix-scripts/001 - fix_download_permissions.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# INTERACTIVE PERMISSIONS FIX SCRIPT FOR YTDL-M +# Date: 2022-05-03 + +# If you want to run this script on a bare-metal installation instead of within Docker +# make sure that the paths configured below match your paths! (it's wise to use the full paths) + +# User defines / Docker env defaults +PATH_SUBS=/app/subscriptions +PATH_AUDIO=/app/audio +PATH_VIDS=/app/video + +echo "\n" +printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - # horizontal line +echo "Welcome to the INTERACTIVE PERMISSIONS FIX SCRIPT FOR YTDL-M." +echo "This script will set YTDL-M's download paths' owner to ${USER} (${UID}:${GID})" +echo "and permissions to the default of 644." +printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - # horizontal line +echo "\n" + +# check whether dirs exist +i=0 +[ -d $PATH_SUBS ] && i=$((i+1)) && echo "✔ (${i}/3) Found Subscriptions directory at ${PATH_SUBS}" +[ -d $PATH_AUDIO ] && i=$((i+1)) && echo "✔ (${i}/3) Found Audio directory at ${PATH_AUDIO}" +[ -d $PATH_VIDS ] && i=$((i+1)) && echo "✔ (${i}/3) Found Video directory at ${PATH_VIDS}" + +# Ask to proceed or cancel, exit on missing paths +case $i in + 0) + echo "\nCouldn't find any download path to fix permissions for! \nPlease edit this script to configure!" + exit 2;; + 3) + echo "\nFound all download paths to fix permissions for. \nProceed? (Y/N)";; + *) + echo "\nOnly found ${i} out of 3 download paths! Something about this script's config must be wrong. \nProceed anyways? (Y/N)";; +esac +old_stty_cfg=$(stty -g) +stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg # Careful playing with stty +if echo "$answer" | grep -iq "^y" ;then + echo "\n Running jobs now... (this may take a while)\n" + [ -d $PATH_SUBS ] && chown "$UID:$GID" -R $PATH_SUBS && echo "✔ Set owner of ${PATH_SUBS} to ${USER}." + [ -d $PATH_SUBS ] && chmod 644 -R $PATH_SUBS && echo "✔ Set permissions of ${PATH_SUBS} to 644." + [ -d $PATH_AUDIO ] && chown "$UID:$GID" -R $PATH_AUDIO && echo "✔ Set owner of ${PATH_AUDIO} to ${USER}." + [ -d $PATH_AUDIO ] && chmod 644 -R $PATH_AUDIO && echo "✔ Set permissions of ${PATH_AUDIO} to 644." + [ -d $PATH_VIDS ] && chown "$UID:$GID" -R $PATH_VIDS && echo "✔ Set owner of ${PATH_VIDS} to ${USER}." + [ -d $PATH_VIDS ] && chmod 644 -R $PATH_VIDS && echo "✔ Set permissions of ${PATH_VIDS} to 644." + echo "\n✔ Done." + exit +else + echo "\nOkay, bye." +fi From 713a97f75ab92f29dedc8954b353d4af8551cf88 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Tue, 3 May 2022 08:44:55 +0200 Subject: [PATCH 04/21] reintegrate suexec --- Dockerfile | 2 +- backend/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 343dba0..26f1d76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,5 +68,5 @@ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/ COPY --chown=$UID:$GID [ "/backend/", "/app/" ] EXPOSE 17442 -# ENTRYPOINT [ "/app/entrypoint.sh" ] +ENTRYPOINT [ "/app/entrypoint.sh" ] CMD [ "pm2-runtime", "pm2.config.js" ] diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 5074353..e563fb9 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -11,7 +11,7 @@ fi # chown current working directory to current user if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then find . \! -user "$UID" -exec chown "$UID:$GID" -R '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos." - exec su-exec "$UID:$GID" "$0" "$@" + exec /usr/lib/apache2/suexec-custom "$UID:$GID" "$0" "$@" fi exec "$@" From d0f5518d31e84ce571c8668719599277e87038c2 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Tue, 3 May 2022 09:44:43 +0200 Subject: [PATCH 05/21] suexec needs to be installed --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 26f1d76..fedfe72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,8 @@ RUN apt-get update && apt-get -y install \ npm \ python2 \ python3 \ - atomicparsley && \ + atomicparsley \ + apache2-suexec-custom && \ apt-get install -f && \ apt-get autoremove --purge && \ apt-get autoremove && \ From 8cc5c4f733dcf6195af6415e62a752d6e5185f0c Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 10:16:49 +0200 Subject: [PATCH 06/21] no need for suexec anymore apparently --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fedfe72..26f1d76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,8 +48,7 @@ RUN apt-get update && apt-get -y install \ npm \ python2 \ python3 \ - atomicparsley \ - apache2-suexec-custom && \ + atomicparsley && \ apt-get install -f && \ apt-get autoremove --purge && \ apt-get autoremove && \ From 7aca8ab060fb954ca65138feda466b1bfb485eaa Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 10:18:06 +0200 Subject: [PATCH 07/21] entrypoint updated for su --- backend/entrypoint.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index e563fb9..b804e66 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -3,15 +3,10 @@ set -eu CMD="pm2-runtime pm2.config.js" -# if the first arg starts with "-" pass it to program -if [ "${1#-}" != "$1" ]; then - set -- "$CMD" "$@" -fi - # chown current working directory to current user if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then find . \! -user "$UID" -exec chown "$UID:$GID" -R '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos." - exec /usr/lib/apache2/suexec-custom "$UID:$GID" "$0" "$@" + su -c "$0" "$(id -un $UID)" "$@" fi exec "$@" From 6a56b5b065cf7a205e61e6f566a2880ecfdc248c Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 11:59:45 +0200 Subject: [PATCH 08/21] add fix-scripts to docker image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 26f1d76..2977041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,6 +66,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] +COPY --chown=$UID:$GID [ "/fix-scripts/", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From 8336d886e98bbe72ca5a2e5bb806bd24e8a6b78e Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 12:16:58 +0200 Subject: [PATCH 09/21] fix-scripts need to be owned and run by root --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2977041..5cb2ac6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,7 +66,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=$UID:$GID [ "/fix-scripts/", "/app/" ] +COPY --chown=root:root [ "/fix-scripts/", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From a54f07e93a34ebf0e6939c278f5c4fff39f8d4bf Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 12:19:05 +0200 Subject: [PATCH 10/21] remove white spaces from script & add usage instr. --- ...download_permissions.sh => 001-fix_download_permissions.sh} | 3 +++ 1 file changed, 3 insertions(+) rename fix-scripts/{001 - fix_download_permissions.sh => 001-fix_download_permissions.sh} (95%) diff --git a/fix-scripts/001 - fix_download_permissions.sh b/fix-scripts/001-fix_download_permissions.sh similarity index 95% rename from fix-scripts/001 - fix_download_permissions.sh rename to fix-scripts/001-fix_download_permissions.sh index 6f7bad1..c64ab05 100644 --- a/fix-scripts/001 - fix_download_permissions.sh +++ b/fix-scripts/001-fix_download_permissions.sh @@ -5,6 +5,9 @@ # If you want to run this script on a bare-metal installation instead of within Docker # make sure that the paths configured below match your paths! (it's wise to use the full paths) +# USAGE: within your container's bash shell: +# su root +# ./fix-scripts/001-fix_download_permissions.sh # User defines / Docker env defaults PATH_SUBS=/app/subscriptions From e290dc0a25cc4f24e0599acc44fec7f4604363af Mon Sep 17 00:00:00 2001 From: Glassed Silver Date: Wed, 4 May 2022 15:11:35 +0200 Subject: [PATCH 11/21] Fixing permissions of ffmpeg and ffprobe Since we didn't specify UID and GID in copy command before, they were run as root causing permissions conflicts The ffmpeg stage doesn't need the env variables henceforth --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5cb2ac6..769f72d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,12 @@ FROM ubuntu:22.04 AS ffmpeg -ENV UID=1000 \ - GID=1000 \ - USER=youtube \ - DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND=noninteractive COPY docker-build.sh . RUN sh ./docker-build.sh +#--------------# Stage 2 + FROM ubuntu:22.04 as frontend ENV DEBIAN_FRONTEND=noninteractive @@ -31,7 +30,7 @@ COPY [ "angular.json", "tsconfig.json", "/build/" ] COPY [ "src/", "/build/src/" ] RUN npm run build -#--------------# +#--------------# Final Stage FROM ubuntu:22.04 @@ -56,8 +55,8 @@ RUN apt-get update && apt-get -y install \ rm -rf /var/lib/apt WORKDIR /app -COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg -COPY --from=ffmpeg /usr/local/bin/ffprobe /usr/local/bin/ffprobe +COPY --chown=$UID:$GID --from=ffmpeg [ "/usr/local/bin/ffmpeg", "/usr/local/bin/ffmpeg" ] +COPY --chown=$UID:$GID --from=ffmpeg [ "/usr/local/bin/ffprobe", "/usr/local/bin/ffprobe" ] COPY --chown=$UID:$GID [ "backend/package.json", "backend/package-lock.json", "/app/" ] ENV PM2_HOME=/app/pm2 RUN npm config set strict-ssl false && \ From 5b919b2b189e435fe6e5896e5f78fbf72bb8d053 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 16:55:22 +0200 Subject: [PATCH 12/21] Fix scripts folder: copy content AND parent folder --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5cb2ac6..c8fd040 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,7 +66,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=root:root [ "/fix-scripts/", "/app/" ] +COPY --chown=root:root [ "/fix-scripts", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From 84d33b0f8227aba87788a50fcae6fdd963693c20 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 17:21:06 +0200 Subject: [PATCH 13/21] fix missing execution permission for fix scripts --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 05a5bed..3869435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,7 +65,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=root:root [ "/fix-scripts", "/app/" ] +COPY --chown=$UID:$GID --chmod=+x [ "/fix-scripts", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From a94b8f376e7a8b3242826fd9f99f44105e4cab86 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 17:22:21 +0200 Subject: [PATCH 14/21] permission needs to be set with octal notation --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3869435..bbb424e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,7 +65,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=$UID:$GID --chmod=+x [ "/fix-scripts", "/app/" ] +COPY --chown=$UID:$GID --chmod=755 [ "/fix-scripts", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From 7c31a104981bd7d873d6ac96e734bf46ee75def5 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 17:23:04 +0200 Subject: [PATCH 15/21] ux/guidance improvements --- fix-scripts/001-fix_download_permissions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fix-scripts/001-fix_download_permissions.sh b/fix-scripts/001-fix_download_permissions.sh index c64ab05..45a96aa 100644 --- a/fix-scripts/001-fix_download_permissions.sh +++ b/fix-scripts/001-fix_download_permissions.sh @@ -14,6 +14,7 @@ PATH_SUBS=/app/subscriptions PATH_AUDIO=/app/audio PATH_VIDS=/app/video +clear -x echo "\n" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - # horizontal line echo "Welcome to the INTERACTIVE PERMISSIONS FIX SCRIPT FOR YTDL-M." @@ -49,6 +50,8 @@ if echo "$answer" | grep -iq "^y" ;then [ -d $PATH_VIDS ] && chown "$UID:$GID" -R $PATH_VIDS && echo "✔ Set owner of ${PATH_VIDS} to ${USER}." [ -d $PATH_VIDS ] && chmod 644 -R $PATH_VIDS && echo "✔ Set permissions of ${PATH_VIDS} to 644." echo "\n✔ Done." + echo "\n If you noticed file access errors those MAY be due to currently running downloads." + echo " Feel free to re-run this script, however download parts should have correct file permissions anyhow. :)" exit else echo "\nOkay, bye." From 336d7a09bddac5c13b57bdc4d3afed69ffb3d029 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 18:31:28 +0200 Subject: [PATCH 16/21] set fix-scripts folder permissions more reliably --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bbb424e..6922d0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,7 +65,8 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=$UID:$GID --chmod=755 [ "/fix-scripts", "/app/" ] +COPY --chown=$UID:$GID [ "/fix-scripts", "/app/" ] +RUN chmod -R +x /app/fix-scripts EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From 31b4fcb9fcf32204d85aea0636e52bb62b887af6 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 19:58:00 +0200 Subject: [PATCH 17/21] We're now using gosu to switch our user down :) --- Dockerfile | 1 + backend/entrypoint.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6922d0b..a6f2838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ RUN apt-get update && apt-get -y install \ npm \ python2 \ python3 \ + gosu &\ atomicparsley && \ apt-get install -f && \ apt-get autoremove --purge && \ diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index b804e66..59ffdb6 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -3,10 +3,15 @@ set -eu CMD="pm2-runtime pm2.config.js" +# if the first arg starts with "-" pass it to program +if [ "${1#-}" != "$1" ]; then + set -- "$CMD" "$@" +fi + # chown current working directory to current user if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then find . \! -user "$UID" -exec chown "$UID:$GID" -R '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos." - su -c "$0" "$(id -un $UID)" "$@" + exec gosu "$UID:$GID" "$0" "$@" fi exec "$@" From acca2d0de2470d48f631ea49f03c02b89e9982c9 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 20:19:52 +0200 Subject: [PATCH 18/21] syntax devil struck again --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6f2838..2420d4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ RUN apt-get update && apt-get -y install \ npm \ python2 \ python3 \ - gosu &\ + gosu \ atomicparsley && \ apt-get install -f && \ apt-get autoremove --purge && \ @@ -67,7 +67,7 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] COPY --chown=$UID:$GID [ "/fix-scripts", "/app/" ] -RUN chmod -R +x /app/fix-scripts +RUN chmod -R 755 /app/fix-scripts/ EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From ce3e6451294be3a7ac4a62e5b3a594f634f1148b Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 20:54:21 +0200 Subject: [PATCH 19/21] for now: user has to DIY chmod +x fix-scripts --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2420d4b..1dddfde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,6 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] COPY --chown=$UID:$GID [ "/fix-scripts", "/app/" ] -RUN chmod -R 755 /app/fix-scripts/ EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] From 17fdd0d788b10b2ae6ab41bced01b5615494f932 Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 20:57:13 +0200 Subject: [PATCH 20/21] update usage instr. for fix-script in comment --- fix-scripts/001-fix_download_permissions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fix-scripts/001-fix_download_permissions.sh b/fix-scripts/001-fix_download_permissions.sh index 45a96aa..cd6cc42 100644 --- a/fix-scripts/001-fix_download_permissions.sh +++ b/fix-scripts/001-fix_download_permissions.sh @@ -6,7 +6,7 @@ # If you want to run this script on a bare-metal installation instead of within Docker # make sure that the paths configured below match your paths! (it's wise to use the full paths) # USAGE: within your container's bash shell: -# su root +# chmod -R +x ./fix-scripts/ # ./fix-scripts/001-fix_download_permissions.sh # User defines / Docker env defaults From 3e7ef766dee3b459be2464aa518bf3e9b133574f Mon Sep 17 00:00:00 2001 From: GlassedSilver Date: Wed, 4 May 2022 23:40:42 +0200 Subject: [PATCH 21/21] =?UTF-8?q?Best=20to=20just=20put=20fix-scripts=20in?= =?UTF-8?q?=20/backend=20=F0=9F=91=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 - .../fix-scripts}/001-fix_download_permissions.sh | 0 2 files changed, 1 deletion(-) rename {fix-scripts => backend/fix-scripts}/001-fix_download_permissions.sh (100%) diff --git a/Dockerfile b/Dockerfile index 1dddfde..73112d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,7 +66,6 @@ RUN npm config set strict-ssl false && \ COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] COPY --chown=$UID:$GID [ "/backend/", "/app/" ] -COPY --chown=$UID:$GID [ "/fix-scripts", "/app/" ] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] diff --git a/fix-scripts/001-fix_download_permissions.sh b/backend/fix-scripts/001-fix_download_permissions.sh similarity index 100% rename from fix-scripts/001-fix_download_permissions.sh rename to backend/fix-scripts/001-fix_download_permissions.sh