From 128dce89bb1f8d35237ae0d3840230620796ba58 Mon Sep 17 00:00:00 2001
From: thespad <git@spad.co.uk>
Date: Fri, 31 May 2024 17:32:00 +0100
Subject: [PATCH] Rebase to 3.20

---
 .github/workflows/external_trigger.yml |  4 ++--
 Dockerfile                             |  8 ++++----
 Dockerfile.aarch64                     |  8 ++++----
 Jenkinsfile                            |  8 ++++----
 README.md                              |  6 +++---
 jenkins-vars.yml                       |  9 ++++-----
 readme-vars.yml                        | 13 +++----------
 7 files changed, 24 insertions(+), 32 deletions(-)

diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml
index 96949f1..e247402 100755
--- a/.github/workflows/external_trigger.yml
+++ b/.github/workflows/external_trigger.yml
@@ -20,7 +20,7 @@ jobs:
           echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_NGINX_MASTER\". ****"
           echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_NGINX_MASTER\`" >> $GITHUB_STEP_SUMMARY
           echo "**** Retrieving external version ****"
-          EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
+          EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
             && awk '/^P:'"nginx"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
           if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
             echo "**** Can't retrieve external version, exiting ****"
@@ -74,7 +74,7 @@ jobs:
             echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
             echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY
             exit 0
-          elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.19/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"nginx"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
+          elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"nginx"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
             echo "**** New version ${EXT_RELEASE} found; but not all arch repos updated yet; exiting ****"
             echo "New version ${EXT_RELEASE} found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
             FAILURE_REASON="New version ${EXT_RELEASE} for nginx tag latest is detected, however not all arch repos are updated yet. Will try again later."
diff --git a/Dockerfile b/Dockerfile
index 7ca4633..d2a8ba3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 
-FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.19
+FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.20
 
 # set version label
 ARG BUILD_DATE
@@ -13,7 +13,7 @@ LABEL maintainer="nemchik"
 # install packages
 RUN \
   if [ -z ${NGINX_VERSION+x} ]; then \
-    NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
+    NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
     && awk '/^P:nginx$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
   fi && \
   apk add --no-cache \
@@ -57,6 +57,7 @@ RUN \
     php83-pdo_sqlite \
     php83-pear \
     php83-pecl-apcu \
+    php83-pecl-mcrypt \
     php83-pecl-memcached \
     php83-pecl-redis \
     php83-pgsql \
@@ -68,8 +69,7 @@ RUN \
     php83-tokenizer \
     php83-xmlreader \
     php83-xsl && \
-  apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
-    php83-pecl-mcrypt && \
+  printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
   rm -f /etc/nginx/conf.d/stream.conf
 
 # ports and volumes
diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64
index 87098bd..b46f72c 100644
--- a/Dockerfile.aarch64
+++ b/Dockerfile.aarch64
@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 
-FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.19
+FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.20
 
 # set version label
 ARG BUILD_DATE
@@ -13,7 +13,7 @@ LABEL maintainer="nemchik"
 # install packages
 RUN \
   if [ -z ${NGINX_VERSION+x} ]; then \
-    NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
+    NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
     && awk '/^P:nginx$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
   fi && \
   apk add --no-cache \
@@ -57,6 +57,7 @@ RUN \
     php83-pdo_sqlite \
     php83-pear \
     php83-pecl-apcu \
+    php83-pecl-mcrypt \
     php83-pecl-memcached \
     php83-pecl-redis \
     php83-pgsql \
@@ -68,8 +69,7 @@ RUN \
     php83-tokenizer \
     php83-xmlreader \
     php83-xsl && \
-  apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
-    php83-pecl-mcrypt && \
+  printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
   rm -f /etc/nginx/conf.d/stream.conf
 
 # ports and volumes
diff --git a/Jenkinsfile b/Jenkinsfile
index 63d02a2..1066240 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -25,16 +25,16 @@ pipeline {
     DEV_DOCKERHUB_IMAGE = 'lsiodev/nginx'
     PR_DOCKERHUB_IMAGE = 'lspipepr/nginx'
     DIST_IMAGE = 'alpine'
-    DIST_TAG = '3.19'
-    DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.19/main/'
+    DIST_TAG = '3.20'
+    DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/main/'
     DIST_REPO_PACKAGES = 'nginx'
     MULTIARCH='true'
     CI='true'
     CI_WEB='true'
     CI_PORT='80'
     CI_SSL='false'
-    CI_DELAY='120'
-    CI_DOCKERENV='TZ=US/Pacific'
+    CI_DELAY='60'
+    CI_DOCKERENV=''
     CI_AUTH=''
     CI_WEBPATH=''
   }
diff --git a/README.md b/README.md
index 9620298..0298c02 100644
--- a/README.md
+++ b/README.md
@@ -59,9 +59,8 @@ The architectures supported by this image are:
 
 ## Application Setup
 
-Add your web files to `/config/www` for hosting.  
-Modify the nginx, php and site config files under `/config` as needed  
-*Protip: This container is best combined with a sql server, e.g. [mariadb](https://hub.docker.com/r/linuxserver/mariadb/)*
+Add your web files to `/config/www` for hosting.
+Modify the nginx, php and site config files under `/config` as needed
 
 ## Usage
 
@@ -276,6 +275,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
 
 ## Versions
 
+* **31.05.24:** - Rebase to Alpine 3.20.
 * **05.03.24:** - Rebase to Alpine 3.19 with php 8.3.
 * **25.05.23:** - Rebase to Alpine 3.18, deprecate armhf.
 * **16.01.23:** - Remove nchan module because it keeps causing crashes.
diff --git a/jenkins-vars.yml b/jenkins-vars.yml
index 3474c8c..5c5198a 100644
--- a/jenkins-vars.yml
+++ b/jenkins-vars.yml
@@ -6,7 +6,6 @@ external_type: alpine_repo
 release_type: stable
 release_tag: latest
 ls_branch: master
-build_armhf: false
 repo_vars:
   - BUILD_VERSION_ARG = 'NGINX_VERSION'
   - LS_USER = 'linuxserver'
@@ -16,15 +15,15 @@ repo_vars:
   - DEV_DOCKERHUB_IMAGE = 'lsiodev/nginx'
   - PR_DOCKERHUB_IMAGE = 'lspipepr/nginx'
   - DIST_IMAGE = 'alpine'
-  - DIST_TAG = '3.19'
-  - DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.19/main/'
+  - DIST_TAG = '3.20'
+  - DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/main/'
   - DIST_REPO_PACKAGES = 'nginx'
   - MULTIARCH='true'
   - CI='true'
   - CI_WEB='true'
   - CI_PORT='80'
   - CI_SSL='false'
-  - CI_DELAY='120'
-  - CI_DOCKERENV='TZ=US/Pacific'
+  - CI_DELAY='60'
+  - CI_DOCKERENV=''
   - CI_AUTH=''
   - CI_WEBPATH=''
diff --git a/readme-vars.yml b/readme-vars.yml
index 89e4006..a1d379d 100644
--- a/readme-vars.yml
+++ b/readme-vars.yml
@@ -22,23 +22,16 @@ param_usage_include_ports: true
 param_ports:
   - { external_port: "80", internal_port: "80", port_desc: "http" }
   - { external_port: "443", internal_port: "443", port_desc: "https" }
-param_usage_include_env: true
-param_env_vars:
-  - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
-
-# optional parameters
-optional_block_1: false
-optional_block_1_items: ""
 
 # application setup block
 app_setup_block_enabled: true
 app_setup_block: |
-  Add your web files to `/config/www` for hosting.  
-  Modify the nginx, php and site config files under `/config` as needed  
-  *Protip: This container is best combined with a sql server, e.g. [mariadb](https://hub.docker.com/r/linuxserver/mariadb/)*
+  Add your web files to `/config/www` for hosting.
+  Modify the nginx, php and site config files under `/config` as needed
 
 # changelog
 changelogs:
+  - { date: "31.05.24:", desc: "Rebase to Alpine 3.20."}
   - { date: "05.03.24:", desc: "Rebase to Alpine 3.19 with php 8.3."}
   - { date: "25.05.23:", desc: "Rebase to Alpine 3.18, deprecate armhf." }
   - { date: "16.01.23:", desc: "Remove nchan module because it keeps causing crashes." }