From 63695397675d39799a2d18b1ad24c5d697b8cbf9 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 14 Oct 2021 16:16:08 -0500 Subject: [PATCH 1/4] Use standard nginx.conf from lsio alpine nginx base image --- Dockerfile | 67 +++++++++++++++++---------------- Dockerfile.aarch64 | 67 +++++++++++++++++---------------- Dockerfile.armhf | 67 +++++++++++++++++---------------- README.md | 1 + package_versions.txt | 18 ++++----- readme-vars.yml | 1 + root/app/projectsend/index.html | 40 ++++++++++++++++++++ root/defaults/default | 28 -------------- root/etc/cont-init.d/30-config | 29 +++++++------- 9 files changed, 167 insertions(+), 151 deletions(-) create mode 100644 root/app/projectsend/index.html delete mode 100644 root/defaults/default diff --git a/Dockerfile b/Dockerfile index cecc2e3..cceb232 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 # set version label ARG BUILD_DATE @@ -11,35 +11,37 @@ RUN \ echo "**** install runtime packages ****" && \ apk add -U --upgrade --no-cache \ curl \ - php7-bcmath \ - php7-bz2 \ - php7-cli \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-fileinfo \ - php7-gd \ - php7-gettext \ - php7-gmp \ - php7-json \ - php7-iconv \ - php7-mbstring \ - php7-mcrypt \ - php7-mysqli \ - php7-openssl \ - php7-pdo \ - php7-pdo_dblib \ - php7-pdo_mysql \ - php7-pecl-apcu \ - php7-pecl-memcached \ - php7-phar \ - php7-soap \ - php7-xmlreader \ - php7-xmlrpc \ - php7-zip \ + php8-bcmath \ + php8-bz2 \ + php8-cli \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-fileinfo \ + php8-gd \ + php8-gettext \ + php8-gmp \ + php8-iconv \ + php8-json \ + php8-mbstring \ + php8-mysqli \ + php8-openssl \ + php8-pdo \ + php8-pdo_dblib \ + php8-pdo_mysql \ + php8-pecl-apcu \ + php8-pecl-mcrypt \ + php8-pecl-memcached \ + php8-phar \ + php8-soap \ + php8-xmlreader \ + php8-zip \ unzip && \ + apk add --no-cache \ + --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php8-pecl-xmlrpc && \ echo "**** install projectsend ****" && \ - mkdir -p /app/projectsend && \ + mkdir -p /app/www/public && \ if [ -z ${PROJECTSEND_VERSION+x} ]; then \ PROJECTSEND_VERSION=$(curl -sX GET "https://api.github.com/repos/projectsend/projectsend/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -49,9 +51,9 @@ RUN \ "https://github.com/projectsend/projectsend/releases/download/${PROJECTSEND_VERSION}/projectsend-${PROJECTSEND_VERSION}.zip" && \ unzip \ /tmp/projectsend.zip -d \ - /app/projectsend && \ - mv /app/projectsend/upload /defaults/ && \ - mv /app/projectsend /app/projectsend-tmp && \ + /app/www/public && \ + mv /app/www/public/upload /defaults/ && \ + mv /app/www/public /app/www/public-tmp && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* @@ -60,5 +62,4 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /data +EXPOSE 80 443 diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index b8cd95e..fe3e1a7 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 # set version label ARG BUILD_DATE @@ -11,35 +11,37 @@ RUN \ echo "**** install runtime packages ****" && \ apk add -U --upgrade --no-cache \ curl \ - php7-bcmath \ - php7-bz2 \ - php7-cli \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-fileinfo \ - php7-gd \ - php7-gettext \ - php7-gmp \ - php7-json \ - php7-iconv \ - php7-mbstring \ - php7-mcrypt \ - php7-mysqli \ - php7-openssl \ - php7-pdo \ - php7-pdo_dblib \ - php7-pdo_mysql \ - php7-pecl-apcu \ - php7-pecl-memcached \ - php7-phar \ - php7-soap \ - php7-xmlreader \ - php7-xmlrpc \ - php7-zip \ + php8-bcmath \ + php8-bz2 \ + php8-cli \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-fileinfo \ + php8-gd \ + php8-gettext \ + php8-gmp \ + php8-iconv \ + php8-json \ + php8-mbstring \ + php8-mysqli \ + php8-openssl \ + php8-pdo \ + php8-pdo_dblib \ + php8-pdo_mysql \ + php8-pecl-apcu \ + php8-pecl-mcrypt \ + php8-pecl-memcached \ + php8-phar \ + php8-soap \ + php8-xmlreader \ + php8-zip \ unzip && \ + apk add --no-cache \ + --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php8-pecl-xmlrpc && \ echo "**** install projectsend ****" && \ - mkdir -p /app/projectsend && \ + mkdir -p /app/www/public && \ if [ -z ${PROJECTSEND_VERSION+x} ]; then \ PROJECTSEND_VERSION=$(curl -sX GET "https://api.github.com/repos/projectsend/projectsend/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -49,9 +51,9 @@ RUN \ "https://github.com/projectsend/projectsend/releases/download/${PROJECTSEND_VERSION}/projectsend-${PROJECTSEND_VERSION}.zip" && \ unzip \ /tmp/projectsend.zip -d \ - /app/projectsend && \ - mv /app/projectsend/upload /defaults/ && \ - mv /app/projectsend /app/projectsend-tmp && \ + /app/www/public && \ + mv /app/www/public/upload /defaults/ && \ + mv /app/www/public /app/www/public-tmp && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* @@ -60,5 +62,4 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /data +EXPOSE 80 443 diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 93eb9f1..2d7fac7 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 # set version label ARG BUILD_DATE @@ -11,35 +11,37 @@ RUN \ echo "**** install runtime packages ****" && \ apk add -U --upgrade --no-cache \ curl \ - php7-bcmath \ - php7-bz2 \ - php7-cli \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-fileinfo \ - php7-gd \ - php7-gettext \ - php7-gmp \ - php7-json \ - php7-iconv \ - php7-mbstring \ - php7-mcrypt \ - php7-mysqli \ - php7-openssl \ - php7-pdo \ - php7-pdo_dblib \ - php7-pdo_mysql \ - php7-pecl-apcu \ - php7-pecl-memcached \ - php7-phar \ - php7-soap \ - php7-xmlreader \ - php7-xmlrpc \ - php7-zip \ + php8-bcmath \ + php8-bz2 \ + php8-cli \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-fileinfo \ + php8-gd \ + php8-gettext \ + php8-gmp \ + php8-iconv \ + php8-json \ + php8-mbstring \ + php8-mysqli \ + php8-openssl \ + php8-pdo \ + php8-pdo_dblib \ + php8-pdo_mysql \ + php8-pecl-apcu \ + php8-pecl-mcrypt \ + php8-pecl-memcached \ + php8-phar \ + php8-soap \ + php8-xmlreader \ + php8-zip \ unzip && \ + apk add --no-cache \ + --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php8-pecl-xmlrpc && \ echo "**** install projectsend ****" && \ - mkdir -p /app/projectsend && \ + mkdir -p /app/www/public && \ if [ -z ${PROJECTSEND_VERSION+x} ]; then \ PROJECTSEND_VERSION=$(curl -sX GET "https://api.github.com/repos/projectsend/projectsend/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -49,9 +51,9 @@ RUN \ "https://github.com/projectsend/projectsend/releases/download/${PROJECTSEND_VERSION}/projectsend-${PROJECTSEND_VERSION}.zip" && \ unzip \ /tmp/projectsend.zip -d \ - /app/projectsend && \ - mv /app/projectsend/upload /defaults/ && \ - mv /app/projectsend /app/projectsend-tmp && \ + /app/www/public && \ + mv /app/www/public/upload /defaults/ && \ + mv /app/www/public /app/www/public-tmp && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* @@ -60,5 +62,4 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /data +EXPOSE 80 443 diff --git a/README.md b/README.md index 1ae0aec..e3348fe 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,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)). * **24.06.21:** - Rebasing to alpine 3.14, switch to nginx * **23.01.21:** - Rebasing to alpine 3.13. * **01.06.20:** - Rebasing to alpine 3.12. diff --git a/package_versions.txt b/package_versions.txt index 1adacc2..d4b30fc 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -1,15 +1,15 @@ alpine-baselayout-3.2.0-r16 alpine-keys-2.4-r0 -apache2-utils-2.4.54-r0 +apache2-utils-2.4.51-r0 apk-tools-2.12.7-r0 apr-1.7.0-r1 apr-util-1.6.1-r7 argon2-libs-20190702-r1 bash-5.1.16-r0 brotli-libs-1.0.9-r5 -busybox-1.33.1-r8 -ca-certificates-20220614-r0 -ca-certificates-bundle-20220614-r0 +busybox-1.33.1-r6 +ca-certificates-20191127-r5 +ca-certificates-bundle-20191127-r5 coreutils-8.32-r2 curl-7.79.1-r2 expat-2.4.7-r0 @@ -43,7 +43,7 @@ libsasl-2.1.28-r0 libsm-1.2.3-r0 libssl1.1-1.1.1q-r0 libstdc++-10.3.1_git20210424-r2 -libuuid-2.37.4-r0 +libuuid-2.37.2-r0 libwebp-1.2.0-r2 libx11-1.7.2-r0 libxau-1.0.9-r0 @@ -62,11 +62,11 @@ nano-5.7-r2 ncurses-libs-6.2_p20210612-r1 ncurses-terminfo-base-6.2_p20210612-r1 nghttp2-libs-1.43.0-r0 -nginx-1.20.2-r1 +nginx-1.20.2-r0 oniguruma-6.9.7.1-r0 openssl-1.1.1q-r0 pcre-8.44-r0 -pcre2-10.36-r1 +pcre2-10.36-r0 php7-7.4.26-r0 php7-bcmath-7.4.26-r0 php7-bz2-7.4.26-r0 @@ -108,8 +108,8 @@ s6-ipcserver-2.10.0.3-r0 scanelf-1.3.2-r0 shadow-4.8.1-r0 skalibs-2.10.0.3-r0 -ssl_client-1.33.1-r8 -tzdata-2022a-r0 +ssl_client-1.33.1-r6 +tzdata-2021e-r0 unixodbc-2.3.9-r1 unzip-6.0-r9 utmps-0.1.0.2-r0 diff --git a/readme-vars.yml b/readme-vars.yml index 440dbbd..7200452 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -54,6 +54,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: "24.06.21:", desc: "Rebasing to alpine 3.14, switch to nginx"} - { date: "23.01.21:", desc: "Rebasing to alpine 3.13." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } diff --git a/root/app/projectsend/index.html b/root/app/projectsend/index.html new file mode 100644 index 0000000..2ac31be --- /dev/null +++ b/root/app/projectsend/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 062bf67..0000000 --- a/root/defaults/default +++ /dev/null @@ -1,28 +0,0 @@ -#config-v1 -server { - listen 80 default_server; - - listen 443 ssl; - - root /app/projectsend; - index index.html index.htm index.php; - - 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; - } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; - } -} diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index cf7d766..9b6bd60 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -1,8 +1,8 @@ #!/usr/bin/with-contenv bash -if [ -d /app/projectsend-tmp ]; then +if [ -d /app/www/public-tmp ]; then echo "New container detected. Setting up app folder and fixing permissions." - mv /app/projectsend-tmp /app/projectsend + mv /app/www/public-tmp /app/www/public chown -R abc:abc /app fi @@ -24,16 +24,12 @@ sed -i \ -e "s#;*max_file_uploads =.*#max_file_uploads = ${PHP_MAX_FILE_UPLOAD}#i" \ -e "s#;*post_max_size =.*#post_max_size = ${USABLE_MAX_UPLOAD}M#i" \ -e "s#;*cgi.fix_pathinfo=.*#cgi.fix_pathinfo= 0#i" \ - /etc/php7/php.ini - -if ! grep -q 'config-v1' /config/nginx/site-confs/default; then - cp /defaults/default /config/nginx/site-confs -fi + /etc/php8/php.ini # copy config PREV_DIR=$(pwd) -cd /defaults/upload || exit +cd /defaults/upload || exit 1 shopt -s globstar nullglob shopt -s dotglob for i in * @@ -47,16 +43,19 @@ shopt -s dotglob shopt -u globstar nullglob shopt -u dotglob -cd "${PREV_DIR}" || exit +cd "${PREV_DIR}" || exit 1 # create symlinks -[[ ! -L /app/projectsend/upload ]] && \ - ln -sf /data/projectsend /app/projectsend/upload +if [[ ! -L /app/www/public/upload ]]; then + ln -sf /data/projectsend /app/www/public/upload +fi -[[ -f /app/projectsend/includes/sys.config.php ]] && \ - rm /app/projectsend/includes/sys.config.php -[[ ! -L /app/projectsend/includes/sys.config.php ]] && \ - ln -sf /config/projectsend/sys.config.php /app/projectsend/includes/sys.config.php +if [[ -f /app/www/public/includes/sys.config.php ]]; then + rm /app/www/public/includes/sys.config.php +fi +if [[ ! -L /app/www/public/includes/sys.config.php ]]; then + ln -sf /config/projectsend/sys.config.php /app/www/public/includes/sys.config.php +fi # permissions echo "Fixing app data permissions." From 887556c3b1ba7c542c91f954d850db3031755afb Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 20 Aug 2022 18:55:11 -0500 Subject: [PATCH 2/4] 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..4b2195f --- /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/projectsend;" +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 f5adc3e3ab75e26c59195a43e395f8b43c216c2c Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 16:55:17 -0500 Subject: [PATCH 3/4] Keep /config volume consistently --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + Dockerfile.armhf | 1 + 3 files changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index cceb232..aa0f464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,3 +63,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index fe3e1a7..6bc6b60 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -63,3 +63,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 2d7fac7..41345f8 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -63,3 +63,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config From 72646bd45190c88879d0c7ec23ff955c75466108 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 17:05:46 -0500 Subject: [PATCH 4/4] Keep /config volume consistently --- Dockerfile | 4 ++-- Dockerfile.aarch64 | 4 ++-- Dockerfile.armhf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa0f464..67c9c8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,9 +58,9 @@ RUN \ rm -rf \ /tmp/* -# add local files +# copy local files COPY root/ / -# ports and volumes +# ports and volumes EXPOSE 80 443 VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 6bc6b60..46cdd5c 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -58,9 +58,9 @@ RUN \ rm -rf \ /tmp/* -# add local files +# copy local files COPY root/ / -# ports and volumes +# ports and volumes EXPOSE 80 443 VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 41345f8..dd9449c 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -58,9 +58,9 @@ RUN \ rm -rf \ /tmp/* -# add local files +# copy local files COPY root/ / -# ports and volumes +# ports and volumes EXPOSE 80 443 VOLUME /config