From 1d222442341edf026a15a7250460c8ff3dd54cbf Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 14 Oct 2021 16:03:51 -0500 Subject: [PATCH 01/16] Use standard nginx.conf from lsio alpine nginx base image --- Dockerfile | 24 ++-- Dockerfile.aarch64 | 22 +-- Dockerfile.armhf | 22 +-- README.md | 2 +- package_versions.txt | 128 +++++++++--------- readme-vars.yml | 2 +- root/app/lychee/public/index.html | 40 ++++++ root/defaults/default | 33 ----- .../nginx/site-confs/default.conf.sample | 44 ++++++ root/etc/cont-init.d/40-config | 37 ++--- 10 files changed, 210 insertions(+), 144 deletions(-) create mode 100644 root/app/lychee/public/index.html delete mode 100644 root/defaults/default create mode 100644 root/defaults/nginx/site-confs/default.conf.sample diff --git a/Dockerfile b/Dockerfile index 756148f..99d5420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15-php8 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 # set version label ARG BUILD_DATE @@ -10,8 +10,7 @@ LABEL maintainer="hackerman" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - composer \ - git && \ + composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -25,18 +24,22 @@ RUN \ php8-dom \ php8-exif \ php8-gd \ - php8-pecl-imagick \ php8-intl \ php8-json \ php8-mbstring \ php8-mysqli \ php8-pdo_mysql \ + php8-pecl-imagick \ + php8-phar \ php8-session \ php8-tokenizer \ php8-xml \ php8-zip && \ + echo "**** configure php-fpm to pass env vars ****" && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/lychee && \ + mkdir -p /app/www && \ if [ -z ${LYCHEE_VERSION} ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -45,12 +48,12 @@ RUN \ /tmp/lychee.tar.gz -L \ "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ tar xf \ - /tmp/lychee.tar.gz -C \ - /app/lychee/ --strip-components=1 && \ - cd /app/lychee && \ + /tmp/lychee.tar.gz -C \ + /app/www/ --strip-components=1 && \ + cd /app/www && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-suggest \ --no-interaction && \ @@ -64,3 +67,6 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 68d71c8..f10ff03 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15-php8 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 # set version label ARG BUILD_DATE @@ -10,8 +10,7 @@ LABEL maintainer="hackerman" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - composer \ - git && \ + composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -25,18 +24,22 @@ RUN \ php8-dom \ php8-exif \ php8-gd \ - php8-pecl-imagick \ php8-intl \ php8-json \ php8-mbstring \ php8-mysqli \ php8-pdo_mysql \ + php8-pecl-imagick \ + php8-phar \ php8-session \ php8-tokenizer \ php8-xml \ php8-zip && \ + echo "**** configure php-fpm to pass env vars ****" && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/lychee && \ + mkdir -p /app/www && \ if [ -z ${LYCHEE_VERSION} ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -45,12 +48,12 @@ RUN \ /tmp/lychee.tar.gz -L \ "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ tar xf \ - /tmp/lychee.tar.gz -C \ - /app/lychee/ --strip-components=1 && \ - cd /app/lychee && \ + /tmp/lychee.tar.gz -C \ + /app/www/ --strip-components=1 && \ + cd /app/www && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-suggest \ --no-interaction && \ @@ -59,6 +62,7 @@ RUN \ build-dependencies && \ rm -rf \ /root/.cache \ + /root/.composer \ /tmp/* # add local files diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 63bc1ea..963a4f7 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15-php8 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 # set version label ARG BUILD_DATE @@ -10,8 +10,7 @@ LABEL maintainer="hackerman" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - composer \ - git && \ + composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -25,18 +24,22 @@ RUN \ php8-dom \ php8-exif \ php8-gd \ - php8-pecl-imagick \ php8-intl \ php8-json \ php8-mbstring \ php8-mysqli \ php8-pdo_mysql \ + php8-pecl-imagick \ + php8-phar \ php8-session \ php8-tokenizer \ php8-xml \ php8-zip && \ + echo "**** configure php-fpm to pass env vars ****" && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/lychee && \ + mkdir -p /app/www && \ if [ -z ${LYCHEE_VERSION} ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -45,12 +48,12 @@ RUN \ /tmp/lychee.tar.gz -L \ "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ tar xf \ - /tmp/lychee.tar.gz -C \ - /app/lychee/ --strip-components=1 && \ - cd /app/lychee && \ + /tmp/lychee.tar.gz -C \ + /app/www/ --strip-components=1 && \ + cd /app/www && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-suggest \ --no-interaction && \ @@ -59,6 +62,7 @@ RUN \ build-dependencies && \ rm -rf \ /root/.cache \ + /root/.composer \ /tmp/* # add local files diff --git a/README.md b/README.md index 479722f..8a71ddb 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **04.12.21:** - Rebase to alpine 3.15 with php8. +* **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). * **13.05.21:** - Make readme clearer. * **18.04.21:** - Add php-intl for v4.3. * **31.01.21:** - Add jpegoptim. diff --git a/package_versions.txt b/package_versions.txt index 65d4a46..25fe363 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -2,38 +2,38 @@ alpine-baselayout-3.2.0-r18 alpine-keys-2.4-r1 alsa-lib-1.2.5.1-r1 aom-libs-3.2.0-r0 -apache2-utils-2.4.54-r0 +apache2-utils-2.4.51-r1 apk-tools-2.12.7-r3 -apr-1.7.0-r1 +apr-1.7.0-r0 apr-util-1.6.1-r11 argon2-libs-20190702-r1 avahi-libs-0.8-r5 -bash-5.1.16-r0 +bash-5.1.8-r0 brotli-libs-1.0.9-r5 -busybox-1.34.1-r7 -ca-certificates-20220614-r0 -ca-certificates-bundle-20220614-r0 -cairo-1.16.0-r5 -cairo-gobject-1.16.0-r5 +busybox-1.34.1-r3 +ca-certificates-20191127-r7 +ca-certificates-bundle-20191127-r7 +cairo-1.16.0-r3 +cairo-gobject-1.16.0-r3 coreutils-9.0-r2 -cups-libs-2.3.3-r6 -curl-7.80.0-r2 +cups-libs-2.3.3-r4 +curl-7.80.0-r0 dbus-libs-1.12.20-r4 exiftool-12.30-r0 -expat-2.4.7-r0 +expat-2.4.1-r0 ffmpeg-4.4.1-r2 ffmpeg-libs-4.4.1-r2 fontconfig-2.13.1-r4 -freetype-2.11.1-r2 +freetype-2.11.0-r0 fribidi-1.0.11-r0 gd-2.3.2-r1 -gdk-pixbuf-2.42.8-r0 +gdk-pixbuf-2.42.6-r0 ghostscript-9.55.0-r0 -git-2.34.4-r0 -git-perl-2.34.4-r0 +git-2.34.1-r0 +git-perl-2.34.1-r0 glib-2.70.1-r0 -gmp-6.2.1-r1 -gnutls-3.7.1-r1 +gmp-6.2.1-r0 +gnutls-3.7.1-r0 graphite2-1.3.14-r0 harfbuzz-3.0.0-r2 icu-libs-69.1-r1 @@ -46,14 +46,14 @@ lcms2-2.12-r1 libacl-2.2.53-r0 libass-0.15.2-r0 libattr-2.5.1-r1 -libblkid-2.37.4-r0 +libblkid-2.37.2-r1 libbsd-0.11.3-r1 libbz2-1.0.8-r1 libc-utils-0.7.2-r3 -libcrypto1.1-1.1.1q-r0 -libcurl-7.80.0-r2 +libcrypto1.1-1.1.1l-r7 +libcurl-7.80.0-r0 libdav1d-0.9.2-r0 -libde265-1.0.8-r2 +libde265-1.0.8-r1 libdrm-2.4.109-r0 libedit-20210910.3.1-r0 libffi-3.4.2-r1 @@ -66,29 +66,29 @@ libintl-0.21-r0 libjpeg-turbo-2.1.2-r0 libltdl-2.4.6-r7 libmd-1.0.3-r0 -libmount-2.37.4-r0 +libmount-2.37.2-r1 libogg-1.3.5-r0 libpciaccess-0.16-r0 libpng-1.6.37-r1 libproc-3.3.17-r0 -libressl3.4-libcrypto-3.4.3-r0 -libressl3.4-libssl-3.4.3-r0 -libretls-3.3.4-r3 +libressl3.4-libcrypto-3.4.1-r0 +libressl3.4-libssl-3.4.1-r0 +libretls-3.3.4-r2 librsvg-2.50.7-r1 libsm-1.2.3-r0 libsrt-1.4.2-r1 libssh-0.9.6-r1 -libssl1.1-1.1.1q-r0 +libssl1.1-1.1.1l-r7 libstdc++-10.3.1_git20211027-r0 libtasn1-4.18.0-r0 libtheora-1.1.1-r16 libunistring-0.9.10-r1 -libuuid-2.37.4-r0 +libuuid-2.37.2-r1 libva-2.13.0-r0 libvdpau-1.4-r0 libvorbis-1.3.7-r0 libvpx-1.10.0-r0 -libwebp-1.2.2-r0 +libwebp-1.2.1-r0 libx11-1.7.2-r0 libxau-1.0.9-r0 libxcb-1.14-r2 @@ -96,55 +96,55 @@ libxdmcp-1.1.3-r0 libxext-1.3.4-r0 libxfixes-6.0.0-r0 libxft-2.3.4-r0 -libxml2-2.9.14-r0 +libxml2-2.9.12-r2 libxpm-3.5.13-r0 libxrender-0.9.10-r3 libxt-1.2.1-r0 libzip-1.8.0-r1 linux-pam-1.5.2-r0 -logrotate-3.18.1-r3 +logrotate-3.18.1-r0 musl-1.2.2-r7 musl-utils-1.2.2-r7 nano-5.9-r0 -ncurses-libs-6.3_p20211120-r1 -ncurses-terminfo-base-6.3_p20211120-r1 +ncurses-libs-6.3_p20211120-r0 +ncurses-terminfo-base-6.3_p20211120-r0 nettle-3.7.3-r0 nghttp2-libs-1.46.0-r0 -nginx-1.20.2-r1 +nginx-1.20.2-r0 oniguruma-6.9.7.1-r0 -openssl-1.1.1q-r0 +openssl-1.1.1l-r7 opus-1.3.1-r1 p11-kit-0.24.0-r1 pango-1.48.10-r0 pcre-8.45-r1 -pcre2-10.40-r0 +pcre2-10.39-r0 perl-5.34.0-r1 perl-error-0.17029-r1 -perl-git-2.34.4-r0 +perl-git-2.34.1-r0 perl-image-exiftool-12.30-r0 -php8-8.0.18-r0 -php8-bcmath-8.0.18-r0 -php8-common-8.0.18-r0 -php8-ctype-8.0.18-r0 -php8-dom-8.0.18-r0 -php8-exif-8.0.18-r0 -php8-fileinfo-8.0.18-r0 -php8-fpm-8.0.18-r0 -php8-gd-8.0.18-r0 -php8-intl-8.0.18-r0 -php8-mbstring-8.0.18-r0 -php8-mysqli-8.0.18-r0 -php8-mysqlnd-8.0.18-r0 -php8-openssl-8.0.18-r0 -php8-pdo-8.0.18-r0 -php8-pdo_mysql-8.0.18-r0 +php8-8.0.13-r0 +php8-bcmath-8.0.13-r0 +php8-common-8.0.13-r0 +php8-ctype-8.0.13-r0 +php8-dom-8.0.13-r0 +php8-exif-8.0.13-r0 +php8-fileinfo-8.0.13-r0 +php8-fpm-8.0.13-r0 +php8-gd-8.0.13-r0 +php8-intl-8.0.13-r0 +php8-mbstring-8.0.13-r0 +php8-mysqli-8.0.13-r0 +php8-mysqlnd-8.0.13-r0 +php8-openssl-8.0.13-r0 +php8-pdo-8.0.13-r0 +php8-pdo_mysql-8.0.13-r0 php8-pecl-imagick-3.6.0-r0 -php8-session-8.0.18-r0 -php8-simplexml-8.0.18-r0 -php8-tokenizer-8.0.18-r0 -php8-xml-8.0.18-r0 -php8-xmlwriter-8.0.18-r0 -php8-zip-8.0.18-r0 +php8-session-8.0.13-r0 +php8-simplexml-8.0.13-r0 +php8-tokenizer-8.0.13-r0 +php8-xml-8.0.13-r0 +php8-xmlwriter-8.0.13-r0 +php8-zip-8.0.13-r0 pixman-0.40.0-r3 pkgconf-1.8.0-r0 popt-1.18-r0 @@ -157,9 +157,9 @@ shadow-4.8.1-r1 shared-mime-info-2.1-r0 skalibs-2.11.0.0-r0 soxr-0.1.3-r2 -ssl_client-1.34.1-r7 -tiff-4.3.0-r1 -tzdata-2022a-r0 +ssl_client-1.34.1-r3 +tiff-4.3.0-r0 +tzdata-2021e-r0 utmps-0.1.0.3-r0 v4l-utils-libs-1.22.1-r1 vidstab-1.1.0-r1 @@ -168,7 +168,7 @@ wayland-libs-client-1.19.0-r1 x264-libs-20210613-r0 x265-libs-3.5-r0 xvidcore-1.3.7-r1 -xz-5.2.5-r1 -xz-libs-5.2.5-r1 -zlib-1.2.12-r1 +xz-5.2.5-r0 +xz-libs-5.2.5-r0 +zlib-1.2.11-r3 zstd-libs-1.5.0-r0 diff --git a/readme-vars.yml b/readme-vars.yml index d45dd58..d02f984 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -88,7 +88,7 @@ app_setup_block: | # changelog changelogs: - - { date: "04.12.21:", desc: "Rebase to alpine 3.15 with php8." } + - { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } - { date: "13.05.21:", desc: "Make readme clearer." } - { date: "18.04.21:", desc: "Add php-intl for v4.3." } - { date: "31.01.21:", desc: "Add jpegoptim." } diff --git a/root/app/lychee/public/index.html b/root/app/lychee/public/index.html new file mode 100644 index 0000000..2ac31be --- /dev/null +++ b/root/app/lychee/public/index.html @@ -0,0 +1,40 @@ + + + Upgrade Required! + + + +
+

Upgrade Required!

+

The application inside this image has been moved to a new folder.

+

You will need to update your /config/nginx/nginx.conf and /config/nginx/site-confs/default.conf in order for the application to work.

+

New config samples are located at /config/nginx/nginx.conf.sample and /config/nginx/site-confs/default.conf.sample

+

Please review our announcement: Significant changes to nginx based images

+
+ + diff --git a/root/defaults/default b/root/defaults/default deleted file mode 100644 index 16d4816..0000000 --- a/root/defaults/default +++ /dev/null @@ -1,33 +0,0 @@ -server { - listen 80 default_server; - - listen 443 ssl; - - root /app/lychee/public; - index index.php index.html index.htm; - - server_name _; - - ssl_certificate /config/keys/cert.crt; - ssl_certificate_key /config/keys/cert.key; - - client_max_body_size 0; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - # unless the request is for a valid file (image, js, css, etc.), send to bootstrap - if (!-e $request_filename) - { - rewrite ^/(.*)$ /index.php?/$1 last; - break; - } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include /etc/nginx/fastcgi_params; - } -} diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample new file mode 100644 index 0000000..1873243 --- /dev/null +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -0,0 +1,44 @@ +## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-lychee/commits/master/root/defaults/nginx/site-confs/default.conf.sample + +server { + listen 80 default_server; + listen [::]:80 default_server; + + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name _; + + set $root /app/www/public; + if (!-d /app/www/public) { + set $root /config/www; + } + root $root; + index index.html index.htm index.php; + + location / { + # enable for basic auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + try_files $uri $uri/ /index.html /index.php?$args =404; + } + + # unless the request is for a valid file (image, js, css, etc.), send to bootstrap + if (!-e $request_filename) { + rewrite ^/(.*)$ /index.php?/$1 last; + break; + } + + location ~ ^(.+\.php)(.*)$ { + fastcgi_split_path_info ^(.+\.php)(.*)$; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + include /etc/nginx/fastcgi_params; + } + + # deny access to .htaccess/.htpasswd files + location ~ /\.ht { + deny all; + } +} diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index c46735a..c912294 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -2,30 +2,35 @@ mkdir -p /pictures -cd /app/lychee +cd /app/www # copy config -[[ ! -e /config/user.ini ]] && \ +if [[ ! -e /config/user.ini ]]; then cp /defaults/user.ini /config/user.ini +fi cp /config/user.ini /etc/php8/conf.d/99-user.ini # pre-populate /pictures directory if it's empty if [ ! "$(ls -A /pictures)" ]; then - mv /app/lychee/public/uploads/* /pictures/ + mv /app/www/public/uploads/* /pictures/ chown -R abc:abc /pictures elif [ ! "$(ls -A /pictures/import 2>/dev/null)" ]; then printf "\n\n\n\nSeems like you tried to use a path thats not managed by lychee, this is unsupported\n\n\n\n" fi -[[ ! -L "/app/lychee/public/uploads" ]] && rm -rf /app/lychee/public/uploads && ln -sf /pictures /app/lychee/public/uploads +if [[ ! -L "/app/www/public/uploads" ]]; then + rm -rf /app/www/public/uploads + ln -sf /pictures /app/www/public/uploads +fi # handle storage directory -[[ ! -e "/config/storage" ]] && \ - mv /app/lychee/storage /config/ +if [[ ! -e "/config/storage" ]]; then + mv /app/www/storage /config/ +fi -rm -rf /app/lychee/storage -ln -s /config/storage /app/lychee/storage -ln -sf /config/.env /app/lychee/.env +rm -rf /app/www/storage +ln -s /config/storage /app/www/storage +ln -sf /config/.env /app/www/.env # check for .env and copy default if needed if [ ! -f "/config/.env" ]; then @@ -39,7 +44,7 @@ if [ ! -f "/config/.env" ]; then done # populate config from variables - cp /app/lychee/.env.example /config/.env + cp /app/www/.env.example /config/.env echo "Populating config from variables" sed -i "s|DB_CONNECTION=sqlite|DB_CONNECTION=mysql|g" /config/.env @@ -54,13 +59,13 @@ if [ ! -f "/config/.env" ]; then php artisan migrate --force elif [ -f "/config/lychee/config.php" ]; then # attempt upgrade - cp /app/lychee/.env.example /config/.env + cp /app/www/.env.example /config/.env php /defaults/upgrade.php mv /config/lychee /config/lychee.old # force nginx config upgrade - mv /config/nginx/site-confs/default /config/nginx/default.bak - mv /defaults/default /config/nginx/site-confs/default + mv /config/nginx/site-confs/default.conf /config/nginx/site-confs/default.conf.bak + cp /defaults/nginx/site-confs/default.conf.sample /config/nginx/site-confs/default.conf php artisan key:generate php artisan migrate --force @@ -79,11 +84,7 @@ else php artisan migrate --force fi -# add line to preserve environment variables in FPM so Lychee can use $PATH (for things like ffprobe) -sed -E -i 's/^clear_env =.*$/clear_env = no/g' /config/php/www2.conf -grep -qxF 'clear_env = no' /config/php/www2.conf || echo 'clear_env = no' >> /config/php/www2.conf - # permissions chown -R abc:abc \ - /app/lychee \ + /app/www \ /config From dcab1f7e19546b76577f87d6b91ad772983663d3 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 20 Aug 2022 18:54:47 -0500 Subject: [PATCH 02/16] Add default location migration --- root/migrations/02-default-location | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 root/migrations/02-default-location diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location new file mode 100644 index 0000000..ae31cc8 --- /dev/null +++ b/root/migrations/02-default-location @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash + +DEFAULT_CONF="/config/nginx/site-confs/default.conf" +OLD_ROOT="root /app/lychee/public;" +NEW_ROOT="root /app/www/public;" + +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then + echo "updating root in ${DEFAULT_CONF}" + sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" +fi From 2736a0755e467e97337a7f5e250901a0c7cbd6f2 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 16:54:15 -0500 Subject: [PATCH 03/16] Keep /config volume consistently --- Dockerfile | 1 + Dockerfile.aarch64 | 4 ++++ Dockerfile.armhf | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index 99d5420..67f1001 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,3 +70,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index f10ff03..dd03476 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -67,3 +67,7 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 963a4f7..b57aa1b 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -67,3 +67,7 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 +VOLUME /config From 0c71add6b9129706dd7369c0cee58973455ee23d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 17:05:07 -0500 Subject: [PATCH 04/16] Keep /config volume consistently --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 67f1001..989eff3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,7 +65,7 @@ RUN \ /root/.composer \ /tmp/* -# add local files +# copy local files COPY root/ / # ports and volumes diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index dd03476..a97abc9 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -65,7 +65,7 @@ RUN \ /root/.composer \ /tmp/* -# add local files +# copy local files COPY root/ / # ports and volumes diff --git a/Dockerfile.armhf b/Dockerfile.armhf index b57aa1b..8d4598f 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -65,7 +65,7 @@ RUN \ /root/.composer \ /tmp/* -# add local files +# copy local files COPY root/ / # ports and volumes From ae5b069c5ff5ccaf51c0c557e756bb05e7f6e5ef Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 23 Aug 2022 09:28:08 -0500 Subject: [PATCH 05/16] nginx conf tweaks --- root/defaults/nginx/site-confs/default.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 1873243..772fb1f 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -21,7 +21,7 @@ server { #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; - try_files $uri $uri/ /index.html /index.php?$args =404; + try_files $uri $uri/ /index.html /index.php$is_args$args; } # unless the request is for a valid file (image, js, css, etc.), send to bootstrap From 78c2e9b729e8436a032822c92222776cbd75299a Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 4 Oct 2022 16:17:28 -0500 Subject: [PATCH 06/16] Add default_server --- root/defaults/nginx/site-confs/default.conf.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 772fb1f..bd4399e 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -4,8 +4,8 @@ server { listen 80 default_server; listen [::]:80 default_server; - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl http2 default_server; + listen [::]:443 ssl http2 default_server; server_name _; From de5de84eb4656a286d1010742a8bd8196e90e55b Mon Sep 17 00:00:00 2001 From: aptalca Date: Tue, 4 Oct 2022 20:16:44 -0400 Subject: [PATCH 07/16] switch to git clone --- Dockerfile | 17 ++++++----------- Dockerfile.aarch64 | 17 ++++++----------- Dockerfile.armhf | 17 ++++++----------- Jenkinsfile | 2 +- README.md | 2 +- readme-vars.yml | 2 +- 6 files changed, 21 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index 989eff3..c1c6eff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,23 +39,18 @@ RUN \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/www && \ - if [ -z ${LYCHEE_VERSION} ]; then \ + if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - curl -o \ - /tmp/lychee.tar.gz -L \ - "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ - tar xf \ - /tmp/lychee.tar.gz -C \ - /app/www/ --strip-components=1 && \ - cd /app/www && \ + mkdir /app/lychee && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ + cd /app/lychee && \ + git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/www \ + -d /app/lychee \ --no-dev \ - --no-suggest \ --no-interaction && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index a97abc9..c860838 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -39,23 +39,18 @@ RUN \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/www && \ - if [ -z ${LYCHEE_VERSION} ]; then \ + if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - curl -o \ - /tmp/lychee.tar.gz -L \ - "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ - tar xf \ - /tmp/lychee.tar.gz -C \ - /app/www/ --strip-components=1 && \ - cd /app/www && \ + mkdir /app/lychee && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ + cd /app/lychee && \ + git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/www \ + -d /app/lychee \ --no-dev \ - --no-suggest \ --no-interaction && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 8d4598f..225ac9d 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -39,23 +39,18 @@ RUN \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ - mkdir -p /app/www && \ - if [ -z ${LYCHEE_VERSION} ]; then \ + if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - curl -o \ - /tmp/lychee.tar.gz -L \ - "https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \ - tar xf \ - /tmp/lychee.tar.gz -C \ - /app/www/ --strip-components=1 && \ - cd /app/www && \ + mkdir /app/lychee && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ + cd /app/lychee && \ + git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/www \ + -d /app/lychee \ --no-dev \ - --no-suggest \ --no-interaction && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/Jenkinsfile b/Jenkinsfile index b872897..f8095dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -720,7 +720,7 @@ pipeline { -e DO_REGION="ams3" \ -e DO_BUCKET="lsio-ci" \ -t ghcr.io/linuxserver/ci:latest \ - python /ci/ci.py''' + python3 test_build.py''' } } } diff --git a/README.md b/README.md index 8a71ddb..4c33177 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). +* **04.10.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). Switch to git clone as builds fail with the release artifact. * **13.05.21:** - Make readme clearer. * **18.04.21:** - Add php-intl for v4.3. * **31.01.21:** - Add jpegoptim. diff --git a/readme-vars.yml b/readme-vars.yml index d02f984..342f2e4 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -88,7 +88,7 @@ app_setup_block: | # changelog changelogs: - - { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } + - { date: "04.10.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). Switch to git clone as builds fail with the release artifact." } - { date: "13.05.21:", desc: "Make readme clearer." } - { date: "18.04.21:", desc: "Add php-intl for v4.3." } - { date: "31.01.21:", desc: "Add jpegoptim." } From eb06cc2b8c6080e3c2012cdb0c2450ee11702fd6 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 4 Oct 2022 20:35:37 -0500 Subject: [PATCH 08/16] Fix app location --- Dockerfile | 8 ++++---- Dockerfile.aarch64 | 8 ++++---- Dockerfile.armhf | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1c6eff..cb01742 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,13 +43,13 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/lychee && \ - git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ - cd /app/lychee && \ + mkdir /app/www && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ + cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-interaction && \ echo "**** cleanup ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c860838..e9e4ebc 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -43,13 +43,13 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/lychee && \ - git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ - cd /app/lychee && \ + mkdir /app/www && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ + cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-interaction && \ echo "**** cleanup ****" && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 225ac9d..d56f7d1 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -43,13 +43,13 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/lychee && \ - git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/lychee && \ - cd /app/lychee && \ + mkdir /app/www && \ + git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ + cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ echo "**** install composer dependencies ****" && \ composer install \ - -d /app/lychee \ + -d /app/www \ --no-dev \ --no-interaction && \ echo "**** cleanup ****" && \ From a4d03785be671d5e696efb6ec8ea87c0e1a97b7a Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 4 Oct 2022 20:43:51 -0500 Subject: [PATCH 09/16] mkdir with -p --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb01742..7fc81fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/www && \ + mkdir -p /app/www && \ git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e9e4ebc..cd6ec12 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -43,7 +43,7 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/www && \ + mkdir -p /app/www && \ git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d56f7d1..c77e195 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -43,7 +43,7 @@ RUN \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ - mkdir /app/www && \ + mkdir -p /app/www && \ git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \ cd /app/www && \ git checkout "${LYCHEE_VERSION}" && \ From df38766111e10cca48daaeb25a7a848dc4fe0f99 Mon Sep 17 00:00:00 2001 From: technofreak74 <9699636+technofreak74@users.noreply.github.com> Date: Sat, 22 Oct 2022 17:14:43 +0100 Subject: [PATCH 10/16] Add DB_PORT to the readme vars --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index 342f2e4..28db5da 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -32,6 +32,7 @@ param_usage_include_env: true param_env_vars: - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"} - { env_var: "DB_HOST", env_value: "mariadb", desc: "for specifying the database host" } + - { env_var: "DB_PORT", env_value: "3306", desc: "for specifying the database port" } - { env_var: "DB_USERNAME", env_value: "lychee", desc: "for specifying the database user" } - { env_var: "DB_PASSWORD", env_value: "dbpassword", desc: "for specifying the database password" } - { env_var: "DB_DATABASE", env_value: "lychee", desc: "for specifying the database to be used" } From 1238619e1f89e3503cd7d98ee8aa144b1ef9ce1a Mon Sep 17 00:00:00 2001 From: technofreak74 <9699636+technofreak74@users.noreply.github.com> Date: Sat, 22 Oct 2022 17:46:54 +0100 Subject: [PATCH 11/16] Ran README generator --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4c33177..033c179 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ docker run -d \ -e PGID=1000 \ -e TZ=Europe/London \ -e DB_HOST=mariadb \ + -e DB_PORT=3306 \ -e DB_USERNAME=lychee \ -e DB_PASSWORD=dbpassword \ -e DB_DATABASE=lychee \ @@ -145,6 +146,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e PGID=1000` | for GroupID - see below for explanation | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | | `-e DB_HOST=mariadb` | for specifying the database host | +| `-e DB_PORT=3306` | for specifying the database port | | `-e DB_USERNAME=lychee` | for specifying the database user | | `-e DB_PASSWORD=dbpassword` | for specifying the database password | | `-e DB_DATABASE=lychee` | for specifying the database to be used | From de1e86e53ec51ee9b9b25923a649f3692b2e5d85 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 11 Jan 2023 19:11:20 +0000 Subject: [PATCH 12/16] Rebase to Alpine 3.17 and php8.1 --- Dockerfile | 40 ++++++++++--------- Dockerfile.aarch64 | 40 ++++++++++--------- Dockerfile.armhf | 40 ++++++++++--------- readme-vars.yml | 2 +- .../nginx/site-confs/default.conf.sample | 2 +- .../dependencies.d/init-lychee-config | 0 .../dependencies.d/init-config | 0 .../s6-rc.d/init-lychee-config/run} | 9 +++-- .../s6-rc.d/init-lychee-config/type | 1 + .../s6-overlay/s6-rc.d/init-lychee-config/up | 1 + .../user/contents.d/init-lychee-config | 0 11 files changed, 72 insertions(+), 63 deletions(-) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-lychee-config create mode 100644 root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-config rename root/etc/{cont-init.d/40-config => s6-overlay/s6-rc.d/init-lychee-config/run} (95%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/init-lychee-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-lychee-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-lychee-config diff --git a/Dockerfile b/Dockerfile index 7fc81fe..a132eae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 # set version label ARG BUILD_DATE @@ -19,25 +21,25 @@ RUN \ gd \ imagemagick \ jpegoptim \ - php8-bcmath \ - php8-ctype \ - php8-dom \ - php8-exif \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-mysqli \ - php8-pdo_mysql \ - php8-pecl-imagick \ - php8-phar \ - php8-session \ - php8-tokenizer \ - php8-xml \ - php8-zip && \ + php81-bcmath \ + php81-ctype \ + php81-dom \ + php81-exif \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-mysqli \ + php81-pdo_mysql \ + php81-pecl-imagick \ + php81-phar \ + php81-session \ + php81-tokenizer \ + php81-xml \ + php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index cd6ec12..24664cd 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 # set version label ARG BUILD_DATE @@ -19,25 +21,25 @@ RUN \ gd \ imagemagick \ jpegoptim \ - php8-bcmath \ - php8-ctype \ - php8-dom \ - php8-exif \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-mysqli \ - php8-pdo_mysql \ - php8-pecl-imagick \ - php8-phar \ - php8-session \ - php8-tokenizer \ - php8-xml \ - php8-zip && \ + php81-bcmath \ + php81-ctype \ + php81-dom \ + php81-exif \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-mysqli \ + php81-pdo_mysql \ + php81-pecl-imagick \ + php81-phar \ + php81-session \ + php81-tokenizer \ + php81-xml \ + php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index c77e195..6b8eaf2 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 # set version label ARG BUILD_DATE @@ -19,25 +21,25 @@ RUN \ gd \ imagemagick \ jpegoptim \ - php8-bcmath \ - php8-ctype \ - php8-dom \ - php8-exif \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-mysqli \ - php8-pdo_mysql \ - php8-pecl-imagick \ - php8-phar \ - php8-session \ - php8-tokenizer \ - php8-xml \ - php8-zip && \ + php81-bcmath \ + php81-ctype \ + php81-dom \ + php81-exif \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-mysqli \ + php81-pdo_mysql \ + php81-pecl-imagick \ + php81-phar \ + php81-session \ + php81-tokenizer \ + php81-xml \ + php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ echo "**** install lychee ****" && \ if [ -z "${LYCHEE_VERSION}" ]; then \ LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \ diff --git a/readme-vars.yml b/readme-vars.yml index 28db5da..eb071a3 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -89,7 +89,7 @@ app_setup_block: | # changelog changelogs: - - { date: "04.10.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). Switch to git clone as builds fail with the release artifact." } + - { date: "11.01.23:", desc: "Rebasing to alpine 3.17 with php8.1. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). Switch to git clone as builds fail with the release artifact." } - { date: "13.05.21:", desc: "Make readme clearer." } - { date: "18.04.21:", desc: "Add php-intl for v4.3." } - { date: "31.01.21:", desc: "Add jpegoptim." } diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index bd4399e..30779c0 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,4 +1,4 @@ -## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-lychee/commits/master/root/defaults/nginx/site-confs/default.conf.sample +## Version 2023/01/11 - Changelog: https://github.com/linuxserver/docker-lychee/commits/master/root/defaults/nginx/site-confs/default.conf.sample server { listen 80 default_server; diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-lychee-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-lychee-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/40-config b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/run old mode 100644 new mode 100755 similarity index 95% rename from root/etc/cont-init.d/40-config rename to root/etc/s6-overlay/s6-rc.d/init-lychee-config/run index c912294..69219d7 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/run @@ -1,19 +1,20 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash mkdir -p /pictures -cd /app/www +cd /app/www || exit 1 # copy config if [[ ! -e /config/user.ini ]]; then cp /defaults/user.ini /config/user.ini fi -cp /config/user.ini /etc/php8/conf.d/99-user.ini +cp /config/user.ini /etc/php81/conf.d/99-user.ini # pre-populate /pictures directory if it's empty if [ ! "$(ls -A /pictures)" ]; then mv /app/www/public/uploads/* /pictures/ - chown -R abc:abc /pictures + lsiown -R abc:abc /pictures elif [ ! "$(ls -A /pictures/import 2>/dev/null)" ]; then printf "\n\n\n\nSeems like you tried to use a path thats not managed by lychee, this is unsupported\n\n\n\n" fi @@ -85,6 +86,6 @@ else fi # permissions -chown -R abc:abc \ +lsiown -R abc:abc \ /app/www \ /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-lychee-config/type b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-lychee-config/up b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/up new file mode 100644 index 0000000..3e92847 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-lychee-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-lychee-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-lychee-config new file mode 100644 index 0000000..e69de29 From f2b56584a8c215759160e0dbac8add9acf9d7683 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 11 Jan 2023 19:34:23 +0000 Subject: [PATCH 13/16] Remove redundant packages --- Dockerfile | 2 -- Dockerfile.aarch64 | 2 -- Dockerfile.armhf | 2 -- 3 files changed, 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a132eae..e93386b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ exiftool \ ffmpeg \ gd \ @@ -27,7 +26,6 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-json \ php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 24664cd..bea4380 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -15,7 +15,6 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ exiftool \ ffmpeg \ gd \ @@ -27,7 +26,6 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-json \ php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 6b8eaf2..3d6e671 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -15,7 +15,6 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ exiftool \ ffmpeg \ gd \ @@ -27,7 +26,6 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-json \ php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ From 0fb45e6b353c3f3e4360c7bcfa69a8432748a46e Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 15 Jan 2023 09:45:09 -0600 Subject: [PATCH 14/16] Format shell scripts --- root/migrations/02-default-location | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location index ae31cc8..88e3f36 100644 --- a/root/migrations/02-default-location +++ b/root/migrations/02-default-location @@ -1,10 +1,11 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash DEFAULT_CONF="/config/nginx/site-confs/default.conf" OLD_ROOT="root /app/lychee/public;" NEW_ROOT="root /app/www/public;" -if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}"; then echo "updating root in ${DEFAULT_CONF}" sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" fi From 413e27f681c0c1489569c14ec4d81a95efe1e570 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 20 Jan 2023 19:34:48 -0600 Subject: [PATCH 15/16] Remove base packages --- Dockerfile | 3 --- Dockerfile.aarch64 | 3 --- Dockerfile.armhf | 3 --- 3 files changed, 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index e93386b..c5fce70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,14 +26,11 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ php81-pecl-imagick \ php81-phar \ - php81-session \ php81-tokenizer \ - php81-xml \ php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index bea4380..bd1676d 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -26,14 +26,11 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ php81-pecl-imagick \ php81-phar \ - php81-session \ php81-tokenizer \ - php81-xml \ php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 3d6e671..f3e8b95 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -26,14 +26,11 @@ RUN \ php81-exif \ php81-gd \ php81-intl \ - php81-mbstring \ php81-mysqli \ php81-pdo_mysql \ php81-pecl-imagick \ php81-phar \ - php81-session \ php81-tokenizer \ - php81-xml \ php81-zip && \ echo "**** configure php-fpm to pass env vars ****" && \ sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ From 5188ce3bbc3b1db916fd3c8dea164ae8fcf3b26c Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 22 Jan 2023 14:53:45 -0600 Subject: [PATCH 16/16] Fix dependencies --- .../dependencies.d/{init-config => init-nginx-end} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/{init-config => init-nginx-end} (100%) diff --git a/root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-nginx-end similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-config rename to root/etc/s6-overlay/s6-rc.d/init-lychee-config/dependencies.d/init-nginx-end