From bf75f8b9380c93364f81abaaf9ddbf814d1cd825 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 14 Oct 2021 16:03:21 -0500 Subject: [PATCH 1/9] Use standard nginx.conf from lsio alpine nginx base image --- Dockerfile | 91 +++++++++---------- Dockerfile.aarch64 | 91 +++++++++---------- Dockerfile.armhf | 91 +++++++++---------- README.md | 1 + readme-vars.yml | 1 + root/defaults/default | 40 -------- .../nginx/site-confs/default.conf.sample | 47 ++++++++++ root/etc/cont-init.d/40-config | 25 +++-- root/var/www/localhost/cops/index.html | 40 ++++++++ 9 files changed, 230 insertions(+), 197 deletions(-) delete mode 100644 root/defaults/default create mode 100644 root/defaults/nginx/site-confs/default.conf.sample create mode 100644 root/var/www/localhost/cops/index.html diff --git a/Dockerfile b/Dockerfile index 18529a1..cf95b2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.12 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 # set version label ARG BUILD_DATE @@ -8,55 +8,50 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="chbmb" RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --upgrade --virtual=build-dependencies \ - curl \ - tar && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache --upgrade \ - php7-ctype \ - php7-dom \ - php7-gd \ - php7-intl \ - php7-mbstring \ - php7-opcache \ - php7-openssl \ - php7-phar \ - php7-pdo_sqlite \ - php7-zip \ - php7-zlib && \ - echo "**** install composer ****" && \ - ln -sf /usr/bin/php7 /usr/bin/php && \ - curl \ - -sS https://getcomposer.org/installer \ - | php -- --install-dir=/usr/bin --filename=composer --version=1.10.17 && \ - composer \ - global require "fxp/composer-asset-plugin:~1.1" && \ - echo "**** install cops ****" && \ - if [ -z ${COPS_RELEASE+x} ]; then \ - COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/cops.tar.gz -L \ - "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ - mkdir -p \ - /usr/share/webapps/cops && \ - tar xf /tmp/cops.tar.gz -C \ - /usr/share/webapps/cops --strip-components=1 && \ - cd /usr/share/webapps/cops && \ - composer \ - install --no-dev --optimize-autoloader && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.composer \ - /tmp/* + echo "**** install build packages ****" && \ + apk add --no-cache --upgrade --virtual=build-dependencies \ + composer \ + curl \ + tar && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache --upgrade \ + php8-ctype \ + php8-dom \ + php8-gd \ + php8-intl \ + php8-mbstring \ + php8-opcache \ + php8-openssl \ + php8-phar \ + php8-pdo_sqlite \ + php8-zip \ + php8-zlib && \ + echo "**** install cops ****" && \ + composer \ + global require "fxp/composer-asset-plugin:~1.1" && \ + if [ -z ${COPS_RELEASE+x} ]; then \ + COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/cops.tar.gz -L \ + "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www/public && \ + tar xf /tmp/cops.tar.gz -C \ + /app/www/public --strip-components=1 && \ + cd /app/www/public && \ + composer \ + install --no-dev --optimize-autoloader && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.composer \ + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /books +EXPOSE 80 443 diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 400d7e0..f712ceb 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.12 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 # set version label ARG BUILD_DATE @@ -8,55 +8,50 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="chbmb" RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --upgrade --virtual=build-dependencies \ - curl \ - tar && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache --upgrade \ - php7-ctype \ - php7-dom \ - php7-gd \ - php7-intl \ - php7-mbstring \ - php7-opcache \ - php7-openssl \ - php7-phar \ - php7-pdo_sqlite \ - php7-zip \ - php7-zlib && \ - echo "**** install composer ****" && \ - ln -sf /usr/bin/php7 /usr/bin/php && \ - curl \ - -sS https://getcomposer.org/installer \ - | php -- --install-dir=/usr/bin --filename=composer --version=1.10.17 && \ - composer \ - global require "fxp/composer-asset-plugin:~1.1" && \ - echo "**** install cops ****" && \ - if [ -z ${COPS_RELEASE+x} ]; then \ - COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/cops.tar.gz -L \ - "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ - mkdir -p \ - /usr/share/webapps/cops && \ - tar xf /tmp/cops.tar.gz -C \ - /usr/share/webapps/cops --strip-components=1 && \ - cd /usr/share/webapps/cops && \ - composer \ - install --no-dev --optimize-autoloader && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.composer \ - /tmp/* + echo "**** install build packages ****" && \ + apk add --no-cache --upgrade --virtual=build-dependencies \ + composer \ + curl \ + tar && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache --upgrade \ + php8-ctype \ + php8-dom \ + php8-gd \ + php8-intl \ + php8-mbstring \ + php8-opcache \ + php8-openssl \ + php8-phar \ + php8-pdo_sqlite \ + php8-zip \ + php8-zlib && \ + echo "**** install cops ****" && \ + composer \ + global require "fxp/composer-asset-plugin:~1.1" && \ + if [ -z ${COPS_RELEASE+x} ]; then \ + COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/cops.tar.gz -L \ + "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www/public && \ + tar xf /tmp/cops.tar.gz -C \ + /app/www/public --strip-components=1 && \ + cd /app/www/public && \ + composer \ + install --no-dev --optimize-autoloader && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.composer \ + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /books +EXPOSE 80 443 diff --git a/Dockerfile.armhf b/Dockerfile.armhf index a7e7d98..fa0d96d 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.12 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 # set version label ARG BUILD_DATE @@ -8,55 +8,50 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="chbmb" RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --upgrade --virtual=build-dependencies \ - curl \ - tar && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache --upgrade \ - php7-ctype \ - php7-dom \ - php7-gd \ - php7-intl \ - php7-mbstring \ - php7-opcache \ - php7-openssl \ - php7-phar \ - php7-pdo_sqlite \ - php7-zip \ - php7-zlib && \ - echo "**** install composer ****" && \ - ln -sf /usr/bin/php7 /usr/bin/php && \ - curl \ - -sS https://getcomposer.org/installer \ - | php -- --install-dir=/usr/bin --filename=composer --version=1.10.17 && \ - composer \ - global require "fxp/composer-asset-plugin:~1.1" && \ - echo "**** install cops ****" && \ - if [ -z ${COPS_RELEASE+x} ]; then \ - COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/cops.tar.gz -L \ - "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ - mkdir -p \ - /usr/share/webapps/cops && \ - tar xf /tmp/cops.tar.gz -C \ - /usr/share/webapps/cops --strip-components=1 && \ - cd /usr/share/webapps/cops && \ - composer \ - install --no-dev --optimize-autoloader && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.composer \ - /tmp/* + echo "**** install build packages ****" && \ + apk add --no-cache --upgrade --virtual=build-dependencies \ + composer \ + curl \ + tar && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache --upgrade \ + php8-ctype \ + php8-dom \ + php8-gd \ + php8-intl \ + php8-mbstring \ + php8-opcache \ + php8-openssl \ + php8-phar \ + php8-pdo_sqlite \ + php8-zip \ + php8-zlib && \ + echo "**** install cops ****" && \ + composer \ + global require "fxp/composer-asset-plugin:~1.1" && \ + if [ -z ${COPS_RELEASE+x} ]; then \ + COPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/seblucas/cops/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/cops.tar.gz -L \ + "https://github.com/seblucas/cops/archive/${COPS_RELEASE}.tar.gz" && \ + mkdir -p \ + /app/www/public && \ + tar xf /tmp/cops.tar.gz -C \ + /app/www/public --strip-components=1 && \ + cd /app/www/public && \ + composer \ + install --no-dev --optimize-autoloader && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.composer \ + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 80 -VOLUME /config /books +EXPOSE 80 443 diff --git a/README.md b/README.md index bb9c15a..fbd5c34 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,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)). * **22.11.20:** - Pin composer version to 1.10.17. * **01.06.20:** - Rebasing to alpine 3.12. * **19.12.19:** - Rebasing to alpine 3.11. diff --git a/readme-vars.yml b/readme-vars.yml index 0044ca9..e15c06c 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -82,6 +82,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: "22.11.20:", desc: "Pin composer version to 1.10.17." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } - { date: "19.12.19:", desc: "Rebasing to alpine 3.11." } diff --git a/root/defaults/default b/root/defaults/default deleted file mode 100644 index 69e6021..0000000 --- a/root/defaults/default +++ /dev/null @@ -1,40 +0,0 @@ -server { - - listen 80 default_server; -# listen 443 ssl; - server_name _; -# ssl_certificate /config/keys/cert.crt; -# ssl_certificate_key /config/keys/cert.key; - access_log /config/log/nginx/access.log; - error_log /config/log/nginx/error.log; - root /var/www/localhost/cops; - index index.php; - - #Useful only for Kobo reader - location /cops/ { - rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last; - rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last; - break; - } - - #Can break loading the images - if you don't see anything, comment - location ~ ^/images.*\.(gif|png|ico|jpg)$ { - expires 31d; - } - #Can also break loading the images, comment if it happens - location ~ .(js|css|eot|svg|woff|ttf)$ { - expires 31d; - } - - #Not necessarily correct, it depends on distro. - location ~ \.php$ { - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_pass 127.0.0.1:9000; - } - - location /books { - root /; - internal; - } -} 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..a8392ab --- /dev/null +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -0,0 +1,47 @@ +## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-cops/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 _; + + root /app/www/public; + index index.html index.htm index.php; + + #Useful only for Kobo reader + location /cops/ { + rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last; + rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last; + break; + } + + #Can break loading the images - if you don't see anything, comment + location ~ ^/images.*\.(gif|png|ico|jpg)$ { + expires 31d; + } + #Can also break loading the images, comment if it happens + location ~ .(js|css|eot|svg|woff|ttf)$ { + expires 31d; + } + + location /books { + root /; + internal; + } + + 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 37302a1..8d4aa75 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -2,30 +2,29 @@ # create folders mkdir -p \ - /config/cache - -# make symlink -[[ ! -e /var/www/localhost/cops ]] && \ - ln -s /usr/share/webapps/cops /var/www/localhost/cops + /config/cache # clear previous config -for f in /var/www/localhost/cops/config_local.*.php +for f in /app/www/public/config_local.*.php do -[ -f "$f" ] && rm "$f" + if [ -f "$f" ]; then + rm "$f" + fi done # copy config -[[ ! -e /config/config_local.php ]] && \ - cp /defaults/config_local.php /config/config_local.php +if [[ ! -e /config/config_local.php ]]; then + cp /defaults/config_local.php /config/config_local.php +fi # copy extra user-profiles for f in /config/config_local*.php do -cp "$f" /var/www/localhost/cops/ +cp "$f" /app/www/public/ done # permissions chown -R abc:abc \ - /config \ - /usr/share/webapps/cops \ - var/www/localhost/cops + /config \ + /app/www/public \ + var/www/localhost/cops diff --git a/root/var/www/localhost/cops/index.html b/root/var/www/localhost/cops/index.html new file mode 100644 index 0000000..2ac31be --- /dev/null +++ b/root/var/www/localhost/cops/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

+
+ + From 94fefa31554b22c94c8e1c190e9dd7f1c66f450b Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 20 Aug 2022 14:45:49 -0400 Subject: [PATCH 2/9] pin composer to v1, add php8 fix --- Dockerfile | 7 +++++-- Dockerfile.aarch64 | 5 ++++- Dockerfile.armhf | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf95b2e..3223ac3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 # set version label ARG BUILD_DATE @@ -10,7 +10,6 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --upgrade --virtual=build-dependencies \ - composer \ curl \ tar && \ echo "**** install runtime packages ****" && \ @@ -27,6 +26,9 @@ RUN \ php8-zip \ php8-zlib && \ echo "**** install cops ****" && \ + curl \ + -sS https://getcomposer.org/installer \ + | php -- --install-dir=/usr/bin --filename=composer --version=1.10.26 && \ composer \ global require "fxp/composer-asset-plugin:~1.1" && \ if [ -z ${COPS_RELEASE+x} ]; then \ @@ -43,6 +45,7 @@ RUN \ cd /app/www/public && \ composer \ install --no-dev --optimize-autoloader && \ + sed -i 's|^[[:space:]]*return[[:space:]]@create_function[[:space:]]'\(''\''\$it'\'',[[:space:]]\$func'\)';| return function \(\$it\) use \(\$func\) \{\n return eval\(\$func\);\n \};|' vendor/seblucas/dot-php/doT.php && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index f712ceb..0107baa 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -10,7 +10,6 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --upgrade --virtual=build-dependencies \ - composer \ curl \ tar && \ echo "**** install runtime packages ****" && \ @@ -27,6 +26,9 @@ RUN \ php8-zip \ php8-zlib && \ echo "**** install cops ****" && \ + curl \ + -sS https://getcomposer.org/installer \ + | php -- --install-dir=/usr/bin --filename=composer --version=1.10.26 && \ composer \ global require "fxp/composer-asset-plugin:~1.1" && \ if [ -z ${COPS_RELEASE+x} ]; then \ @@ -43,6 +45,7 @@ RUN \ cd /app/www/public && \ composer \ install --no-dev --optimize-autoloader && \ + sed -i 's|^[[:space:]]*return[[:space:]]@create_function[[:space:]]'\(''\''\$it'\'',[[:space:]]\$func'\)';| return function \(\$it\) use \(\$func\) \{\n return eval\(\$func\);\n \};|' vendor/seblucas/dot-php/doT.php && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index fa0d96d..3223ac3 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -10,7 +10,6 @@ LABEL maintainer="chbmb" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --upgrade --virtual=build-dependencies \ - composer \ curl \ tar && \ echo "**** install runtime packages ****" && \ @@ -27,6 +26,9 @@ RUN \ php8-zip \ php8-zlib && \ echo "**** install cops ****" && \ + curl \ + -sS https://getcomposer.org/installer \ + | php -- --install-dir=/usr/bin --filename=composer --version=1.10.26 && \ composer \ global require "fxp/composer-asset-plugin:~1.1" && \ if [ -z ${COPS_RELEASE+x} ]; then \ @@ -43,6 +45,7 @@ RUN \ cd /app/www/public && \ composer \ install --no-dev --optimize-autoloader && \ + sed -i 's|^[[:space:]]*return[[:space:]]@create_function[[:space:]]'\(''\''\$it'\'',[[:space:]]\$func'\)';| return function \(\$it\) use \(\$func\) \{\n return eval\(\$func\);\n \};|' vendor/seblucas/dot-php/doT.php && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ From 5ed27a5129fe793604a3606fe4a2118745576052 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 20 Aug 2022 14:49:37 -0400 Subject: [PATCH 3/9] fix copy/pasta error --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3223ac3..bf663ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 # set version label ARG BUILD_DATE From 64575dd9a432125fee667683e4742b1d50e5d402 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 20 Aug 2022 18:53:52 -0500 Subject: [PATCH 4/9] 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..5abca39 --- /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 /var/www/localhost/cops;" +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 07e1307012151a17f509731898f4a525794cf7fa Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 12:52:08 -0500 Subject: [PATCH 5/9] Remove old/unused path --- root/etc/cont-init.d/40-config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index 8d4aa75..33412ef 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -26,5 +26,4 @@ done # permissions chown -R abc:abc \ /config \ - /app/www/public \ - var/www/localhost/cops + /app/www/public From 660d2b8d234e068673096c5ec74af25f231fe70c Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 21 Aug 2022 16:53:12 -0500 Subject: [PATCH 6/9] Keep /config volume consistently --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + Dockerfile.armhf | 1 + 3 files changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index bf663ec..e075c49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,3 +58,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 0107baa..355b355 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -58,3 +58,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 3223ac3..63acecc 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -58,3 +58,4 @@ COPY root/ / # ports and volumes EXPOSE 80 443 +VOLUME /config From 158f79f7831fb31e5bd780a7f70ecb7ca1e98f76 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 4 Oct 2022 16:20:21 -0500 Subject: [PATCH 7/9] 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 a8392ab..993a2b1 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 b5918a70c2eee083f1899ce46e815452da9af1f5 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 10 Oct 2022 14:21:45 +0000 Subject: [PATCH 8/9] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1f1a3d7..1584bf6 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''' } } } From f9f2820f905fe8c62dd9cf39b51c8cfceb162a90 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 23 Dec 2022 14:12:15 -0600 Subject: [PATCH 9/9] Fix whitespace replace --- root/migrations/02-default-location | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location index 5abca39..8a66d0c 100644 --- a/root/migrations/02-default-location +++ b/root/migrations/02-default-location @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bash DEFAULT_CONF="/config/nginx/site-confs/default.conf" -OLD_ROOT="root /var/www/localhost/cops;" +OLD_ROOT="root\s*/var/www/localhost/cops;" NEW_ROOT="root /app/www/public;" if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then