Skip to content

Commit

Permalink
Merge pull request #128 from VirtuBox/develop
Browse files Browse the repository at this point in the history
Nginx-ee v3.7.0
  • Loading branch information
VirtuBox authored Oct 19, 2022
2 parents c86fa72 + e724383 commit 5308166
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 114 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,39 @@ on: [push]
jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Prepare VM
run: |
sudo apt update -qq
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update -qq
sudo apt install libgd-dev -y
sudo apt-get update -qq
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
sudo rm -rf /etc/mysql /var/lib/mysql /etc/nginx
sudo apt-get purge --option=Dpkg::options::=--force-all --assume-yes graphviz* redis* mysql* nginx
sudo apt-get -qq autoremove --purge
- name: Mainline build
run: sudo bash nginx-build.sh || cat /tmp/nginx-ee.log
- name : Nginx check
run: sudo nginx -V
- name: Stable build
run: sudo bash nginx-build.sh --stable
- name: Full build
run: sudo bash nginx-build.sh --full --stable
run: sudo bash nginx-build.sh --stable || cat /tmp/nginx-ee.log
- name : Nginx check
run: sudo nginx -V
- name: Full build stable
run: sudo bash nginx-build.sh --full --stable || cat /tmp/nginx-ee.log
- name : Nginx check
run: sudo nginx -V
- name: Mainline naxsi
run: sudo bash nginx-build.sh --naxsi || cat /tmp/nginx-ee.log
- name : Nginx check
run: sudo nginx -V
- name: libressl build
run: sudo bash nginx-build.sh --libressl
- name: pagespeed beta build
run: sudo bash nginx-build.sh --pagespeed-beta
- name: openssl-dev build
run: sudo bash nginx-build.sh --openssl-dev
run: sudo bash nginx-build.sh --libressl || cat /tmp/nginx-ee.log
- name : Nginx check
run: sudo nginx -V
- name: pagespeed mainline build
run: sudo bash nginx-build.sh --pagespeed || cat /tmp/nginx-ee.log
- name: dynamic build
run: sudo bash nginx-build.sh --dynamic
run: sudo bash nginx-build.sh --dynamic || cat /tmp/nginx-ee.log

15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Automated Nginx compilation from sources with additional modules support
* Dynamic modules support
* Brotli Support
* TLS v1.3 support (Final)
* OpenSSL (1.1.1g or 3.0.0-dev or from system-lib) or LibreSSL
* OpenSSL or LibreSSL
* Cloudflare HPACK
* Cloudflare zlib
* Automated nginx updates cronjob
Expand All @@ -60,8 +60,8 @@ Automated Nginx compilation from sources with additional modules support

## Additional Third-party modules

Nginx current mainline release : **v1.23.1**
Nginx current stable release : **v1.22.0**
Nginx current mainline release : **v1.23.2**
Nginx current stable release : **v1.22.1**

* [ngx_cache_purge](https://github.com/FRiCKLE/ngx_cache_purge)
* [headers-more-nginx-module](https://github.com/openresty/headers-more-nginx-module)
Expand Down Expand Up @@ -104,12 +104,8 @@ Optional modules :

#### Also compatible

* Ubuntu 19.10 (Eoan)
* Ubuntu 16.04 LTS (Xenial)
* Debian 9 (Stretch)
* Debian 8 (Jessie)
* Raspbian 9 (Stretch)
* Raspbian 10 (Buster)
* Raspbian 11 (Bullseye)

### Applications

Expand Down Expand Up @@ -179,12 +175,9 @@ Nginx build options :
Optional third-party modules :

* `--pagespeed`: compile nginx with ngx_pagespeed latest-stable
* `--pagespeed-beta`: compile nginx with ngx_pagespeed latest-beta
* `--naxsi` : compile nginx with naxsi
* `--rtmp` : compile nginx with rtmp module
* `--libressl` : compile nginx with LibreSSL instead of OpenSSL
* `--openssl-dev` : compile nginx with OpenSSL 3.0.0-dev
* `--openssl-system` : compile nginx with OpenSSL system lib

Extras :

Expand Down
21 changes: 7 additions & 14 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Automated Nginx compilation from sources with additional modules support
<li>Dynamic modules support</li>
<li>Brotli Support</li>
<li>TLS v1.3 support (Final)</li>
<li>OpenSSL (1.1.1g or 3.0.0-dev or from system-lib) or LibreSSL</li>
<li>OpenSSL or LibreSSL</li>
<li>Cloudflare HPACK</li>
<li>Cloudflare zlib</li>
<li>Automated nginx updates cronjob</li>
Expand All @@ -53,8 +53,8 @@ Automated Nginx compilation from sources with additional modules support
</ul>
<hr />
<h2 id="additional-third-party-modules">Additional Third-party modules</h2>
<p>Nginx current mainline release : <strong>v1.19.2</strong>
Nginx current stable release : <strong>v1.18.0</strong></p>
<p>Nginx current mainline release : <strong>v1.23.2</strong>
Nginx current stable release : <strong>v1.22.1</strong></p>
<ul>
<li><a href="https://github.com/FRiCKLE/ngx_cache_purge">ngx_cache_purge</a></li>
<li><a href="https://github.com/openresty/headers-more-nginx-module">headers-more-nginx-module</a></li>
Expand Down Expand Up @@ -86,19 +86,15 @@ Nginx current stable release : <strong>v1.18.0</strong></p>
<h3 id="operating-system">Operating System</h3>
<h4 id="recommended">Recommended</h4>
<ul>
<li>Ubuntu 22.04 LTS (Jammy)</li>
<li>Ubuntu 20.04 LTS (Focal)</li>
<li>Ubuntu 18.04 LTS (Bionic)</li>
<li>Debian 11 (Bullseye)</li>
<li>Debian 10 (Buster)</li>
</ul>
<h4 id="also-compatible">Also compatible</h4>
<ul>
<li>Ubuntu 19.10 (Eoan)</li>
<li>Ubuntu 19.04 (Disco)</li>
<li>Ubuntu 18.10 (Cosmic)</li>
<li>Ubuntu 16.04 LTS (Xenial)</li>
<li>Debian 9 (Stretch)</li>
<li>Debian 8 (Jessie)</li>
<li>Raspbian 9 (Stretch)</li>
<li>Raspbian 11 (Bullseye)</li>
<li>Raspbian 10 (Buster)</li>
</ul>
<h3 id="applications">Applications</h3>
Expand All @@ -120,7 +116,7 @@ Nginx current stable release : <strong>v1.18.0</strong></p>
<p><strong>Default settings</strong> :</p>
<ul>
<li>mainline release</li>
<li>openssl stable : 1.1.1g</li>
<li>openssl from system lib</li>
<li>without pagespeed</li>
<li>without naxsi</li>
<li>without rtmp</li>
Expand Down Expand Up @@ -150,12 +146,9 @@ sudo bash nginx-build.sh
<p>Optional third-party modules :</p>
<ul>
<li><code>--pagespeed</code>: compile nginx with ngx_pagespeed latest-stable</li>
<li><code>--pagespeed-beta</code>: compile nginx with ngx_pagespeed latest-beta</li>
<li><code>--naxsi</code> : compile nginx with naxsi</li>
<li><code>--rtmp</code> : compile nginx with rtmp module</li>
<li><code>--libressl</code> : compile nginx with LibreSSL instead of OpenSSL</li>
<li><code>--openssl-dev</code> : compile nginx with OpenSSL 3.0.0-dev</li>
<li><code>--openssl-system</code> : compile nginx with OpenSSL system lib</li>
</ul>
<p>Extras :</p>
<ul>
Expand Down
93 changes: 22 additions & 71 deletions nginx-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Copyright (c) 2019-2020 VirtuBox <[email protected]>
# This script is licensed under M.I.T
# -------------------------------------------------------------------------
# Version 3.7.0 - 2022-03-14
# Version 3.7.0 - 2022-10-18
# -------------------------------------------------------------------------

##################################
Expand Down Expand Up @@ -82,12 +82,6 @@ else
--naxsi)
NAXSI="y"
;;
--openssl-dev)
OPENSSL_LIB="2"
;;
--openssl-system)
OPENSSL_LIB="3"
;;
--libressl)
LIBRESSL="y"
;;
Expand Down Expand Up @@ -156,15 +150,18 @@ DIR_SRC="/usr/local/src"
NGINX_EE_VER=$(curl -m 5 --retry 3 -sL https://api.github.com/repos/VirtuBox/nginx-ee/releases/latest 2>&1 | jq -r '.tag_name')
NGINX_MAINLINE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 1 2>&1)"
NGINX_STABLE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 2 | grep 1.22 2>&1)"
LIBRESSL_VER="3.1.4"
OPENSSL_VER="1.1.1g"
LIBRESSL_VER="3.5.3"
if command_exists openssl; then
OPENSSL_BIN_VER=$(openssl version)
OPENSSL_VER=${OPENSSL_BIN_VER:0:15}
else
OPENSSL_VER="From system"
fi
TLS13_CIPHERS="TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES"
readonly OS_ARCH="$(uname -m)"
OS_DISTRO_FULL="$(lsb_release -ds)"
readonly DISTRO_ID="$(lsb_release -si)"
readonly DISTRO_CODENAME="$(lsb_release -sc)"
readonly DISTRO_NUMBER="$(lsb_release -sr)"
OPENSSL_COMMIT="7fa8bcfe4342df41919f5564b315f9c85d0a02d6"

# Colors
CSI='\033['
Expand Down Expand Up @@ -233,13 +230,7 @@ if [ "$INTERACTIVE_SETUP" = "1" ]; then
echo -e "Select an option [1-2]: " && read -r SSL_LIB_CHOICE
done
if [ "$SSL_LIB_CHOICE" = "1" ]; then
echo -e '\nWhat OpenSSL release do you want ?\n'
echo -e " [1] OpenSSL stable $OPENSSL_VER\n"
echo -e ' [2] OpenSSL dev 3.0.0-dev\n'
echo -e ' [3] OpenSSL from system lib\n'
while [[ "$OPENSSL_LIB" != "1" && "$OPENSSL_LIB" != "2" && "$OPENSSL_LIB" != "3" ]]; do
echo -e "Select an option [1-2-3]: " && read -r OPENSSL_LIB
done
OPENSSL_LIB=3
else
LIBRESSL="y"
fi
Expand Down Expand Up @@ -314,19 +305,10 @@ else
OPENSSL_OPT="enable-tls1_3"
fi
fi
if [ "$OPENSSL_LIB" = "2" ]; then
NGX_SSL_LIB="--with-openssl=../openssl"
OPENSSL_VALID="3.0.0-dev"
LIBSSL_DEV=""
elif [ "$OPENSSL_LIB" = "3" ]; then
NGX_SSL_LIB=""
OPENSSL_VALID="from system"
LIBSSL_DEV="libssl-dev"
else
NGX_SSL_LIB=""
OPENSSL_VALID="$OPENSSL_VER Stable"
LIBSSL_DEV="libssl-dev"
fi
NGX_SSL_LIB=""
OPENSSL_VALID="from system"
LIBSSL_DEV="libssl-dev"

fi

##################################
Expand Down Expand Up @@ -376,7 +358,7 @@ echo " Detected Arch : $OS_ARCH"
echo ""
echo -e " - Nginx release : $NGINX_VER"
[ -n "$OPENSSL_VALID" ] && {
echo -e " - OPENSSL : $OPENSSL_VALID"
echo -e " - OPENSSL : $OPENSSL_VER"
}
[ -n "$LIBRESSL_VALID" ] && {
echo -e " - LIBRESSL : $LIBRESSL_VALID"
Expand All @@ -403,13 +385,13 @@ echo ""
_gitget() {
REPO="$1"
repodir=$(echo "$REPO" | awk -F "/" '{print $2}')
if [ -d /usr/local/src/${repodir}/.git ]; then
git -C /usr/local/src/${repodir} pull &
if [ -d "/usr/local/src/${repodir}/.git" ]; then
git -C "/usr/local/src/${repodir}" pull &
else
if [ -d /usr/local/src/${repodir} ]; then
rm -rf /usr/local/src/${repodir}
if [ -d "/usr/local/src/${repodir}" ]; then
rm -rf "/usr/local/src/${repodir}"
fi
git clone --depth 1 https://github.com/${REPO}.git /usr/local/src/${repodir} &
git clone --depth 1 "https://github.com/${REPO}.git" "/usr/local/src/${repodir}" &

fi
}
Expand All @@ -422,7 +404,7 @@ _install_dependencies() {
libgd-dev dpkg-dev libgeoip-dev libjemalloc-dev \
libbz2-1.0 libreadline-dev libbz2-dev libbz2-ocaml libbz2-ocaml-dev software-properties-common tar \
libgoogle-perftools-dev perl libperl-dev libpam0g-dev libbsd-dev gnupg gnupg2 \
libgmp-dev autotools-dev libxml2-dev libpcre3-dev uuid-dev libbrotli-dev "$LIBSSL_DEV" --ignore-hold
libgmp-dev autotools-dev libxml2-dev libpcre3-dev uuid-dev libbrotli-dev libpcre2-dev "$LIBSSL_DEV"
} >>/tmp/nginx-ee.log 2>&1; then
echo -ne " Installing dependencies [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
Expand Down Expand Up @@ -577,37 +559,6 @@ _gcc_ubuntu_setup() {

}

_dependencies_repo() {
{
curl -sL https://build.opensuse.org/projects/home:virtubox:nginx-ee/public_key | apt-key add -
if [ ! -f /etc/apt/sources.list.d/nginx-ee.list ]; then
if [ "$DISTRO_ID" = "Ubuntu" ]; then
if [ "$DISTRO_CODENAME" = "xenial" ]; then
add-apt-repository ppa:virtubox/brotli -yu
fi
echo "deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/xUbuntu_${DISTRO_NUMBER}/ /" >/etc/apt/sources.list.d/nginx-ee.list

elif [ "$DISTRO_ID" = "Debian" ]; then
if [ "$DISTRO_CODENAME" = "jessie" ]; then
echo 'deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/Debian_8.0/ /' >/etc/apt/sources.list.d/nginx-ee.list
elif [ "$DISTRO_CODENAME" = "strech" ]; then
echo 'deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/Debian_9.0/ /' >/etc/apt/sources.list.d/nginx-ee.list
else
echo 'deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/Debian_10/ /' >/etc/apt/sources.list.d/nginx-ee.list
fi
else
if [ "$DISTRO_CODENAME" = "strech" ]; then
echo 'deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/Raspbian_9.0/ /' >/etc/apt/sources.list.d/nginx-ee.list
else
echo 'deb http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/Raspbian_10/ /' >/etc/apt/sources.list.d/nginx-ee.list
fi
fi

fi
apt-get update -qq
} >>/tmp/nginx-ee.log 2>&1
}

##################################
# Install ffmpeg for rtmp module
##################################
Expand Down Expand Up @@ -917,8 +868,8 @@ _download_nginx() {

{
rm -rf /usr/local/src/nginx
curl -sL http://nginx.org/download/nginx-${NGINX_VER}.tar.gz | /bin/tar xzf - -C "$DIR_SRC"
mv /usr/local/src/nginx-${NGINX_VER} /usr/local/src/nginx
curl -sL "http://nginx.org/download/nginx-${NGINX_VER}.tar.gz" | /bin/tar xzf - -C "$DIR_SRC"
mv "/usr/local/src/nginx-${NGINX_VER}" /usr/local/src/nginx
} >>/tmp/nginx-ee.log 2>&1

}; then
Expand Down

0 comments on commit 5308166

Please sign in to comment.