From 3dd119928076b3889c6415752fbadbc082b756b3 Mon Sep 17 00:00:00 2001 From: ildyria Date: Sun, 29 Sep 2024 23:57:28 +0200 Subject: [PATCH 01/10] preparing v6 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ffc941..76bfe6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,9 @@ RUN \ rm storage/framework/views/* 2> /dev/null || true && \ rm storage/logs/* 2> /dev/null || true && \ chown -R www-data:www-data /var/www/html/Lychee && \ - chmod -R g+ws storage/image-jobs storage/livewire-tmp && \ + chmod -R g+ws storage/image-jobs && \ + @chmod -R g+ws storage/livewire-tmp 2> /dev/null || true && \ + @chmod -R g+ws storage/image-tmp 2> /dev/null || true && \ echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ apt-get purge -y --autoremove git composer && \ apt-get clean -qy &&\ From 4de7db51950ea7e3d21a97fb849cdb258eccd451 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 00:06:06 +0200 Subject: [PATCH 02/10] more thing --- Dockerfile | 2 +- entrypoint.sh | 32 ++++++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76bfe6a..19e744b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -104,7 +104,7 @@ COPY --from=static_builder --chown=www-data:www-data /app/public /var/www/html/L COPY default.conf /etc/nginx/nginx.conf EXPOSE 80 -VOLUME /conf /uploads /sym /logs +VOLUME /conf /uploads /sym /logs /image-tmp /image-jobs /extract-jobs WORKDIR /var/www/html/Lychee diff --git a/entrypoint.sh b/entrypoint.sh index 53e0516..5d2ecff 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -33,10 +33,13 @@ fi echo "**** Make sure the /conf /uploads /sym /logs folders exist ****" -[ ! -d /conf ] && mkdir -p /conf -[ ! -d /uploads ] && mkdir -p /uploads -[ ! -d /sym ] && mkdir -p /sym -[ ! -d /logs ] && mkdir -p /logs +[ ! -d /conf ] && mkdir -p /conf +[ ! -d /uploads ] && mkdir -p /uploads +[ ! -d /sym ] && mkdir -p /sym +[ ! -d /logs ] && mkdir -p /logs +[ ! -d /image-tmp ] && mkdir -p /image-tmp +[ ! -d /image-jobs ] && mkdir -p /image-jobs +[ ! -d /extract-jobs ] && mkdir -p /extract-jobs echo "**** Create the symbolic link for the /uploads folder ****" [ ! -L /var/www/html/Lychee/public/uploads ] && \ @@ -58,6 +61,27 @@ echo "**** Create the symbolic link for the /logs folder ****" rm -r /var/www/html/Lychee/storage/logs && \ ln -s /logs /var/www/html/Lychee/storage/logs +echo "**** Create the symbolic link for the /logs folder ****" +[ ! -L /var/www/html/Lychee/storage/image-tmp ] && \ + touch /var/www/html/Lychee/storage/image-tmp/empty_file && \ + cp -r /var/www/html/Lychee/storage/image-tmp/* /image-tmp && \ + rm -r /var/www/html/Lychee/storage/image-tmp && \ + ln -s /image-tmp /var/www/html/Lychee/storage/image-tmp + +echo "**** Create the symbolic link for the /image-jobs folder ****" +[ ! -L /var/www/html/Lychee/storage/image-jobs ] && \ + touch /var/www/html/Lychee/storage/image-jobs/empty_file && \ + cp -r /var/www/html/Lychee/storage/image-jobs/* /image-jobs && \ + rm -r /var/www/html/Lychee/storage/image-jobs && \ + ln -s /image-jobs /var/www/html/Lychee/storage/image-jobs + +echo "**** Create the symbolic link for the /extract-jobs folder ****" +[ ! -L /var/www/html/Lychee/storage/extract-jobs ] && \ + touch /var/www/html/Lychee/storage/extract-jobs/empty_file && \ + cp -r /var/www/html/Lychee/storage/extract-jobs/* /extract-jobs && \ + rm -r /var/www/html/Lychee/storage/extract-jobs && \ + ln -s /extract-jobs /var/www/html/Lychee/storage/extract-jobs + cd /var/www/html/Lychee if [ "$DB_CONNECTION" = "sqlite" ] || [ -z "$DB_CONNECTION" ] From 9a493ac2720bc6941a51e8dbf94ea995a5633f8e Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 08:50:26 +0200 Subject: [PATCH 03/10] more injections --- inject.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inject.sh b/inject.sh index 2cb4a66..5519948 100755 --- a/inject.sh +++ b/inject.sh @@ -31,6 +31,12 @@ if [ "$DEBUGBAR_ENABLED" != '' ]; then if [ "$LIVEWIRE_ENABLED" != '' ]; then replace_or_insert "LIVEWIRE_ENABLED" "$LIVEWIRE_ENABLED" fi +if [ "$VUEJS_ENABLED" != '' ]; then + replace_or_insert "VUEJS_ENABLED" "$VUEJS_ENABLED" + fi +if [ "$LEGACY_API_ENABLED" != '' ]; then + replace_or_insert "LEGACY_API_ENABLED" "$LEGACY_API_ENABLED" + fi if [ "$LOG_VIEWER_ENABLED" != '' ]; then replace_or_insert "LOG_VIEWER_ENABLED" "$LOG_VIEWER_ENABLED" fi From 5878e7321444e7d35edee587fa657aa3532f6607 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 08:52:42 +0200 Subject: [PATCH 04/10] support env --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index fc1d625..8192f3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,6 +46,8 @@ services: #- APP_URL=http://localhost #- APP_DIR= #- DEBUGBAR_ENABLEd=false + #- VUEJS_ENABLED=true + #- LEGACY_API_ENABLED=false #- LEGACY_V4_REDIRECT=false #- DB_OLD_LYCHEE_PREFIX='' - DB_CONNECTION=mysql From 8ab6ab0fa7fcb2d1a9bb14e92ae8e56d7134cd77 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 12:18:21 +0200 Subject: [PATCH 05/10] also extract-jobs --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 19e744b..5217ecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,6 +77,7 @@ RUN \ chmod -R g+ws storage/image-jobs && \ @chmod -R g+ws storage/livewire-tmp 2> /dev/null || true && \ @chmod -R g+ws storage/image-tmp 2> /dev/null || true && \ + @chmod -R g+ws storage/extract-jobs 2> /dev/null || true && \ echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ apt-get purge -y --autoremove git composer && \ apt-get clean -qy &&\ From 98f0c9ed8e1cc44ce0caf1e53a235ad4433bff68 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 12:19:20 +0200 Subject: [PATCH 06/10] comment line --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5d2ecff..9623c4b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,7 +61,7 @@ echo "**** Create the symbolic link for the /logs folder ****" rm -r /var/www/html/Lychee/storage/logs && \ ln -s /logs /var/www/html/Lychee/storage/logs -echo "**** Create the symbolic link for the /logs folder ****" +echo "**** Create the symbolic link for the /image-tmp folder ****" [ ! -L /var/www/html/Lychee/storage/image-tmp ] && \ touch /var/www/html/Lychee/storage/image-tmp/empty_file && \ cp -r /var/www/html/Lychee/storage/image-tmp/* /image-tmp && \ From fe3450651bb19948a5a18043515b20eaa5cb8276 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 13:48:40 +0200 Subject: [PATCH 07/10] WRTC --- Dockerfile | 6 +++--- entrypoint.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5217ecf..1736f74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,9 +75,9 @@ RUN \ rm storage/logs/* 2> /dev/null || true && \ chown -R www-data:www-data /var/www/html/Lychee && \ chmod -R g+ws storage/image-jobs && \ - @chmod -R g+ws storage/livewire-tmp 2> /dev/null || true && \ - @chmod -R g+ws storage/image-tmp 2> /dev/null || true && \ - @chmod -R g+ws storage/extract-jobs 2> /dev/null || true && \ + chmod -R g+ws storage/livewire-tmp || true && \ + chmod -R g+ws storage/image-tmp || true && \ + chmod -R g+ws storage/extract-jobs || true && \ echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ apt-get purge -y --autoremove git composer && \ apt-get clean -qy &&\ diff --git a/entrypoint.sh b/entrypoint.sh index 9623c4b..520e0b0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -166,12 +166,12 @@ if [ -n "$SKIP_PERMISSIONS_CHECKS" ] && [ "${SKIP_PERMISSIONS_CHECKS,,}" = "yes" else echo "**** Set Permissions ****" # Set ownership of directories, then files and only when required. See LycheeOrg/Lychee-Docker#120 - find /sym /uploads /logs -type d \( ! -user "$USER" -o ! -group "$USER" \) -exec chown -R "$USER":"$USER" \{\} \; - find /conf/.env /sym /uploads /logs \( ! -user "$USER" -o ! -group "$USER" \) -exec chown "$USER":"$USER" \{\} \; + find /sym /uploads /logs /image-tmp /image-jobs /extract-jobs -type d \( ! -user "$USER" -o ! -group "$USER" \) -exec chown -R "$USER":"$USER" \{\} \; + find /conf/.env /sym /uploads /logs /image-tmp /image-jobs /extract-jobs \( ! -user "$USER" -o ! -group "$USER" \) -exec chown "$USER":"$USER" \{\} \; # Laravel needs to be able to chmod user.css and custom.js for no good reason find /conf/user.css /conf/custom.js /logs/laravel.log \( ! -user "www-data" -o ! -group "$USER" \) -exec chown www-data:"$USER" \{\} \; - find /sym /uploads /logs -type d \( ! -perm -ug+w -o ! -perm -ugo+rX -o ! -perm -g+s \) -exec chmod -R ug+w,ugo+rX,g+s \{\} \; - find /conf/user.css /conf/custom.js /conf/.env /sym /uploads /logs \( ! -perm -ug+w -o ! -perm -ugo+rX \) -exec chmod ug+w,ugo+rX \{\} \; + find /sym /uploads /logs /image-tmp /image-jobs /extract-jobs -type d \( ! -perm -ug+w -o ! -perm -ugo+rX -o ! -perm -g+s \) -exec chmod -R ug+w,ugo+rX,g+s \{\} \; + find /conf/user.css /conf/custom.js /conf/.env /sym /uploads /logs /image-tmp /image-jobs /extract-jobs \( ! -perm -ug+w -o ! -perm -ugo+rX \) -exec chmod ug+w,ugo+rX \{\} \; fi # Update CA Certificates if we're using armv7 because armv7 is weird (#76) From a8864d45692c721a05543794819e8678cf685eb9 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 14:57:14 +0200 Subject: [PATCH 08/10] use main tmp folder instead --- Dockerfile | 7 +++---- docker-compose.yml | 1 + entrypoint.sh | 40 ++++++++++++---------------------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1736f74..43f3483 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,10 +74,9 @@ RUN \ rm storage/framework/views/* 2> /dev/null || true && \ rm storage/logs/* 2> /dev/null || true && \ chown -R www-data:www-data /var/www/html/Lychee && \ - chmod -R g+ws storage/image-jobs && \ + chmod -R g+ws storage/images-jobs || true && \ chmod -R g+ws storage/livewire-tmp || true && \ - chmod -R g+ws storage/image-tmp || true && \ - chmod -R g+ws storage/extract-jobs || true && \ + chmod -R g+ws storage/lychee-tmp && \ echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ apt-get purge -y --autoremove git composer && \ apt-get clean -qy &&\ @@ -105,7 +104,7 @@ COPY --from=static_builder --chown=www-data:www-data /app/public /var/www/html/L COPY default.conf /etc/nginx/nginx.conf EXPOSE 80 -VOLUME /conf /uploads /sym /logs /image-tmp /image-jobs /extract-jobs +VOLUME /conf /uploads /sym /logs /lychee-tmp WORKDIR /var/www/html/Lychee diff --git a/docker-compose.yml b/docker-compose.yml index 8192f3b..b19a4da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: - ./lychee/uploads:/uploads - ./lychee/sym:/sym - ./lychee/logs:/logs + - ./lychee/tmp:/lychee-tmp networks: - lychee environment: diff --git a/entrypoint.sh b/entrypoint.sh index 520e0b0..a66b962 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,14 +32,12 @@ if [ -n "$STARTUP_DELAY" ] fi -echo "**** Make sure the /conf /uploads /sym /logs folders exist ****" +echo "**** Make sure the /conf /uploads /sym /logs /lychee-tmp folders exist ****" [ ! -d /conf ] && mkdir -p /conf [ ! -d /uploads ] && mkdir -p /uploads [ ! -d /sym ] && mkdir -p /sym [ ! -d /logs ] && mkdir -p /logs -[ ! -d /image-tmp ] && mkdir -p /image-tmp -[ ! -d /image-jobs ] && mkdir -p /image-jobs -[ ! -d /extract-jobs ] && mkdir -p /extract-jobs +[ ! -d /lychee-tmp ] && mkdir -p /lychee-tmp echo "**** Create the symbolic link for the /uploads folder ****" [ ! -L /var/www/html/Lychee/public/uploads ] && \ @@ -61,26 +59,12 @@ echo "**** Create the symbolic link for the /logs folder ****" rm -r /var/www/html/Lychee/storage/logs && \ ln -s /logs /var/www/html/Lychee/storage/logs -echo "**** Create the symbolic link for the /image-tmp folder ****" -[ ! -L /var/www/html/Lychee/storage/image-tmp ] && \ - touch /var/www/html/Lychee/storage/image-tmp/empty_file && \ - cp -r /var/www/html/Lychee/storage/image-tmp/* /image-tmp && \ - rm -r /var/www/html/Lychee/storage/image-tmp && \ - ln -s /image-tmp /var/www/html/Lychee/storage/image-tmp - -echo "**** Create the symbolic link for the /image-jobs folder ****" -[ ! -L /var/www/html/Lychee/storage/image-jobs ] && \ - touch /var/www/html/Lychee/storage/image-jobs/empty_file && \ - cp -r /var/www/html/Lychee/storage/image-jobs/* /image-jobs && \ - rm -r /var/www/html/Lychee/storage/image-jobs && \ - ln -s /image-jobs /var/www/html/Lychee/storage/image-jobs - -echo "**** Create the symbolic link for the /extract-jobs folder ****" -[ ! -L /var/www/html/Lychee/storage/extract-jobs ] && \ - touch /var/www/html/Lychee/storage/extract-jobs/empty_file && \ - cp -r /var/www/html/Lychee/storage/extract-jobs/* /extract-jobs && \ - rm -r /var/www/html/Lychee/storage/extract-jobs && \ - ln -s /extract-jobs /var/www/html/Lychee/storage/extract-jobs +echo "**** Create the symbolic link for the /lychee-tmp folder ****" +[ ! -L /var/www/html/Lychee/storage/tmp ] && \ + touch /var/www/html/Lychee/storage/tmp/empty_file && \ + cp -r /var/www/html/Lychee/storage/tmp/* /lychee-tmp && \ + rm -r /var/www/html/Lychee/storage/tmp && \ + ln -s /lychee-tmp /var/www/html/Lychee/storage/tmp cd /var/www/html/Lychee @@ -166,12 +150,12 @@ if [ -n "$SKIP_PERMISSIONS_CHECKS" ] && [ "${SKIP_PERMISSIONS_CHECKS,,}" = "yes" else echo "**** Set Permissions ****" # Set ownership of directories, then files and only when required. See LycheeOrg/Lychee-Docker#120 - find /sym /uploads /logs /image-tmp /image-jobs /extract-jobs -type d \( ! -user "$USER" -o ! -group "$USER" \) -exec chown -R "$USER":"$USER" \{\} \; - find /conf/.env /sym /uploads /logs /image-tmp /image-jobs /extract-jobs \( ! -user "$USER" -o ! -group "$USER" \) -exec chown "$USER":"$USER" \{\} \; + find /sym /uploads /logs /lychee-tmp -type d \( ! -user "$USER" -o ! -group "$USER" \) -exec chown -R "$USER":"$USER" \{\} \; + find /conf/.env /sym /uploads /logs /lychee-tmp \( ! -user "$USER" -o ! -group "$USER" \) -exec chown "$USER":"$USER" \{\} \; # Laravel needs to be able to chmod user.css and custom.js for no good reason find /conf/user.css /conf/custom.js /logs/laravel.log \( ! -user "www-data" -o ! -group "$USER" \) -exec chown www-data:"$USER" \{\} \; - find /sym /uploads /logs /image-tmp /image-jobs /extract-jobs -type d \( ! -perm -ug+w -o ! -perm -ugo+rX -o ! -perm -g+s \) -exec chmod -R ug+w,ugo+rX,g+s \{\} \; - find /conf/user.css /conf/custom.js /conf/.env /sym /uploads /logs /image-tmp /image-jobs /extract-jobs \( ! -perm -ug+w -o ! -perm -ugo+rX \) -exec chmod ug+w,ugo+rX \{\} \; + find /sym /uploads /logs /lychee-tmp -type d \( ! -perm -ug+w -o ! -perm -ugo+rX -o ! -perm -g+s \) -exec chmod -R ug+w,ugo+rX,g+s \{\} \; + find /conf/user.css /conf/custom.js /conf/.env /sym /uploads /logs /lychee-tmp \( ! -perm -ug+w -o ! -perm -ugo+rX \) -exec chmod ug+w,ugo+rX \{\} \; fi # Update CA Certificates if we're using armv7 because armv7 is weird (#76) From a26055616de13cc0e99dcbe021abb416886e5279 Mon Sep 17 00:00:00 2001 From: ildyria Date: Mon, 30 Sep 2024 14:58:27 +0200 Subject: [PATCH 09/10] fix path --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 43f3483..c5ec046 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,7 @@ RUN \ rm storage/framework/views/* 2> /dev/null || true && \ rm storage/logs/* 2> /dev/null || true && \ chown -R www-data:www-data /var/www/html/Lychee && \ - chmod -R g+ws storage/images-jobs || true && \ + chmod -R g+ws storage/image-jobs || true && \ chmod -R g+ws storage/livewire-tmp || true && \ chmod -R g+ws storage/lychee-tmp && \ echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ From 17b6e74782cf4aec8937d012ccb111ce0e246d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Viguier?= Date: Mon, 30 Sep 2024 15:11:08 +0200 Subject: [PATCH 10/10] Update Dockerfile Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com> --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c5ec046..f4c6018 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,8 @@ RUN \ chown -R www-data:www-data /var/www/html/Lychee && \ chmod -R g+ws storage/image-jobs || true && \ chmod -R g+ws storage/livewire-tmp || true && \ - chmod -R g+ws storage/lychee-tmp && \ + chmod -R g+ws storage/lychee-tmp || true && \ + echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \ apt-get purge -y --autoremove git composer && \ apt-get clean -qy &&\