diff --git a/Dockerfile b/Dockerfile index 34473c0..92ded1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.13 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 # set version label ARG BUILD_DATE @@ -8,42 +8,42 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="aptalca" RUN \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - curl \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-gmp \ - php7-iconv \ - php7-intl \ - php7-mysqli \ - php7-mysqlnd \ - php7-pdo_mysql \ - php7-pdo_pgsql \ - php7-pdo_sqlite \ - php7-pgsql \ - php7-sqlite3 \ - php7-zip \ - sqlite && \ - echo "**** install app ****" && \ - if [ -z ${FRESHRSS_RELEASE+x} ]; then \ - FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - mkdir -p \ - /usr/share/webapps/freshrss && \ - curl -o \ - /tmp/freshrss.tar.gz -L \ - "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/freshrss.tar.gz -C \ - /usr/share/webapps/freshrss --strip-components=1 && \ - sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ - /usr/share/webapps/freshrss/config.default.php && \ - echo "**** cleanup ****" && \ - rm -rf \ - /tmp/* + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + curl \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-gmp \ + php8-iconv \ + php8-intl \ + php8-mysqli \ + php8-mysqlnd \ + php8-pdo_mysql \ + php8-pdo_pgsql \ + php8-pdo_sqlite \ + php8-pgsql \ + php8-sqlite3 \ + php8-zip \ + sqlite && \ + echo "**** install app ****" && \ + if [ -z ${FRESHRSS_RELEASE+x} ]; then \ + FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + mkdir -p \ + /app/www && \ + curl -o \ + /tmp/freshrss.tar.gz -L \ + "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/freshrss.tar.gz -C \ + /app/www --strip-components=1 && \ + sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ + /app/www/config.default.php && \ + echo "**** cleanup ****" && \ + rm -rf \ + /tmp/* # copy local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 0d1725f..fca1cfe 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.13 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 # set version label ARG BUILD_DATE @@ -8,42 +8,42 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="aptalca" RUN \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - curl \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-gmp \ - php7-iconv \ - php7-intl \ - php7-mysqli \ - php7-mysqlnd \ - php7-pdo_mysql \ - php7-pdo_pgsql \ - php7-pdo_sqlite \ - php7-pgsql \ - php7-sqlite3 \ - php7-zip \ - sqlite && \ - echo "**** install app ****" && \ - if [ -z ${FRESHRSS_RELEASE+x} ]; then \ - FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - mkdir -p \ - /usr/share/webapps/freshrss && \ - curl -o \ - /tmp/freshrss.tar.gz -L \ - "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/freshrss.tar.gz -C \ - /usr/share/webapps/freshrss --strip-components=1 && \ - sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ - /usr/share/webapps/freshrss/config.default.php && \ - echo "**** cleanup ****" && \ - rm -rf \ - /tmp/* + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + curl \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-gmp \ + php8-iconv \ + php8-intl \ + php8-mysqli \ + php8-mysqlnd \ + php8-pdo_mysql \ + php8-pdo_pgsql \ + php8-pdo_sqlite \ + php8-pgsql \ + php8-sqlite3 \ + php8-zip \ + sqlite && \ + echo "**** install app ****" && \ + if [ -z ${FRESHRSS_RELEASE+x} ]; then \ + FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + mkdir -p \ + /app/www && \ + curl -o \ + /tmp/freshrss.tar.gz -L \ + "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/freshrss.tar.gz -C \ + /app/www --strip-components=1 && \ + sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ + /app/www/config.default.php && \ + echo "**** cleanup ****" && \ + rm -rf \ + /tmp/* # copy local files COPY root/ / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 808476c..c1c5576 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.13 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 # set version label ARG BUILD_DATE @@ -8,44 +8,44 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="aptalca" RUN \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - curl \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-gmp \ - php7-iconv \ - php7-intl \ - php7-mysqli \ - php7-mysqlnd \ - php7-pdo_mysql \ - php7-pdo_pgsql \ - php7-pdo_sqlite \ - php7-pgsql \ - php7-sqlite3 \ - php7-zip \ - sqlite && \ - echo "**** install app ****" && \ - if [ -z ${FRESHRSS_RELEASE+x} ]; then \ - FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - mkdir -p \ - /usr/share/webapps/freshrss && \ - curl -o \ - /tmp/freshrss.tar.gz -L \ - "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/freshrss.tar.gz -C \ - /usr/share/webapps/freshrss --strip-components=1 && \ - sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ - /usr/share/webapps/freshrss/config.default.php && \ - echo "**** cleanup ****" && \ - rm -rf \ - /tmp/* + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + curl \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-gmp \ + php8-iconv \ + php8-intl \ + php8-mysqli \ + php8-mysqlnd \ + php8-pdo_mysql \ + php8-pdo_pgsql \ + php8-pdo_sqlite \ + php8-pgsql \ + php8-sqlite3 \ + php8-zip \ + sqlite && \ + echo "**** install app ****" && \ + if [ -z ${FRESHRSS_RELEASE+x} ]; then \ + FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + mkdir -p \ + /app/www && \ + curl -o \ + /tmp/freshrss.tar.gz -L \ + "https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/freshrss.tar.gz -C \ + /app/www --strip-components=1 && \ + sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \ + /app/www/config.default.php && \ + echo "**** cleanup ****" && \ + rm -rf \ + /tmp/* -# copy local files +# copy local files COPY root/ / # ports and volumes diff --git a/README.md b/README.md index 2d6ac16..4f39ddf 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,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)). * **23.01.21:** - Rebasing to alpine 3.13. * **01.06.20:** - Rebasing to alpine 3.12. * **31.03.20:** - Internalize app and enable updates for existing users, allow user customized crontab. diff --git a/readme-vars.yml b/readme-vars.yml index 0454269..5f64af0 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -52,6 +52,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: "23.01.21:", desc: "Rebasing to alpine 3.13." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } - { date: "31.03.20:", desc: "Internalize app and enable updates for existing users, allow user customized crontab." } diff --git a/root/defaults/root b/root/defaults/crontabs/root similarity index 77% rename from root/defaults/root rename to root/defaults/crontabs/root index 4eed56a..a72c70b 100644 --- a/root/defaults/root +++ b/root/defaults/crontabs/root @@ -6,4 +6,4 @@ 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly # freshrss cronjob -*/15 * * * * /usr/bin/php7 /usr/share/webapps/freshrss/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +*/15 * * * * php /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 diff --git a/root/defaults/default b/root/defaults/default deleted file mode 100644 index 43e5563..0000000 --- a/root/defaults/default +++ /dev/null @@ -1,22 +0,0 @@ -server { - listen 80; - listen 443 ssl; - 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; - root /usr/share/webapps/freshrss/p; - index index.php index.html index.htm; - - location ~ ^.+?\.php(/.*)?$ { - fastcgi_pass 127.0.0.1:9000; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_param PATH_INFO $fastcgi_path_info; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } - location / { - try_files $uri $uri/ index.php; - } -} 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..9010771 --- /dev/null +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -0,0 +1,34 @@ +## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-freshrss/commits/master/root/defaults/nginx/site-confs/default.conf.sample + +server { + listen 80 default_server; + listen [::]:80 default_server; + + listen 443 ssl http2 default_server; + listen [::]:443 ssl http2 default_server; + + server_name _; + + root /app/www/p; + 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.php$is_args$args; + } + + 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-install b/root/etc/cont-init.d/40-install index 25e49c4..d8e7464 100644 --- a/root/etc/cont-init.d/40-install +++ b/root/etc/cont-init.d/40-install @@ -2,36 +2,44 @@ # make our folders mkdir -p \ - /config/{crontabs,www/freshrss} + /config/{crontabs,www/freshrss} # create symlinks symlinks=( \ -/usr/share/webapps/freshrss/data \ -/usr/share/webapps/freshrss/extensions ) +/app/www/data \ +/app/www/extensions ) for i in "${symlinks[@]}" do -[[ -e "$i" && ! -L "$i" ]] && mv "$i" "${i}.bak" -[[ ! -L "$i" ]] && ln -s "/config/www/freshrss/$(basename "$i")" "$i" -[[ ! -d "/config/www/freshrss/$(basename "$i")" ]] && \ - cp -R "${i}.bak" "/config/www/freshrss/$(basename "$i")" + if [[ -e "$i" && ! -L "$i" ]]; then + mv "$i" "${i}.bak" + fi + if [[ ! -L "$i" ]]; then + ln -s "/config/www/freshrss/$(basename "$i")" "$i" + fi + if [[ ! -d "/config/www/freshrss/$(basename "$i")" ]]; then + cp -R "${i}.bak" "/config/www/freshrss/$(basename "$i")" + fi done # backwards compatibility -if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default; then - cp /defaults/default /config/nginx/site-confs/default +if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default.conf; then + cp /defaults/nginx/site-confs/default.conf.sample /config/nginx/site-confs/default.conf fi # disable updates -[[ -f /config/www/freshrss/data/config.php ]] && \ - sed -i "s|'disable_update' => false,|'disable_update' => true,|g" /config/www/freshrss/data/config.php +if [[ -f /config/www/freshrss/data/config.php ]]; then + sed -i "s|'disable_update' => false,|'disable_update' => true,|g" /config/www/freshrss/data/config.php +fi # set cronjob -[[ ! -f /config/crontabs/root ]] && \ - cp /defaults/root /config/crontabs/root +if [[ ! -f /config/crontabs/root ]]; then + cp /defaults/crontabs/root /config/crontabs/root +fi +sed -i "s|/usr/bin/php[78] /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1|php /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1|" /config/crontabs/root cp /config/crontabs/root /etc/crontabs/root # permissions chown -R abc:abc \ - /usr/share/webapps/freshrss \ - /config + /app/www \ + /config diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location new file mode 100644 index 0000000..40a62a6 --- /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 /usr/share/webapps/freshrss/p;" +NEW_ROOT="root /app/www/p;" + +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then + echo "updating root in ${DEFAULT_CONF}" + sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" +fi diff --git a/root/usr/share/webapps/freshrss/p/index.html b/root/usr/share/webapps/freshrss/p/index.html new file mode 100644 index 0000000..2ac31be --- /dev/null +++ b/root/usr/share/webapps/freshrss/p/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

+
+ +