-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from VirtuBox/develop
Develop
- Loading branch information
Showing
5 changed files
with
71 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
# Copyright (c) 2019 VirtuBox <[email protected]> | ||
# This script is licensed under M.I.T | ||
# ------------------------------------------------------------------------- | ||
# Version 3.6.3 - 2019-08-15 | ||
# Version 3.6.4 - 2019-08-29 | ||
# ------------------------------------------------------------------------- | ||
|
||
################################## | ||
|
@@ -142,19 +142,20 @@ fi | |
################################## | ||
|
||
DIR_SRC="/usr/local/src" | ||
NGINX_EE_VER="3.6.3" | ||
NGINX_EE_VER="3.6.4" | ||
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.16 2>&1)" | ||
LIBRESSL_VER="2.9.1" | ||
OPENSSL_VER="1.1.1c" | ||
TLS13_CIPHERS="TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES" | ||
OS_ARCH="$(uname -m)" | ||
readonly OS_ARCH="$(uname -m)" | ||
OS_DISTRO_FULL="$(lsb_release -ds)" | ||
DISTRO_ID="$(lsb_release -si)" | ||
readonly DISTRO_ID="$(lsb_release -si)" | ||
readonly DISTRO_CODENAME="$(lsb_release -sc)" | ||
readonly DISTRO_NUMBER="$(lsb_release -sr)" | ||
DEB_CFLAGS="$(dpkg-buildflags --get CPPFLAGS) -Wno-error=date-time" | ||
DEB_LFLAGS="$(dpkg-buildflags --get LDFLAGS)" | ||
OPENSSL_COMMIT="3bbec1afed1c65b6f7f645b27808b070e6e7a509" | ||
PCRE_VER=$(curl -sL https://ftp.pcre.org/pub/pcre/ | grep -E -o 'pcre\-[0-9.]+\.tar[.a-z]*gz' | awk -F "pcre-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | tail -n 1 2>&1) | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Colors | ||
|
@@ -314,12 +315,22 @@ else | |
OPENSSL_VALID="from system" | ||
LIBSSL_DEV="libssl-dev" | ||
else | ||
NGX_SSL_LIB="--with-openssl=../openssl" | ||
NGX_SSL_LIB="" | ||
OPENSSL_VALID="$OPENSSL_VER Stable" | ||
LIBSSL_DEV="" | ||
LIBSSL_DEV="libssl-dev" | ||
fi | ||
fi | ||
|
||
################################## | ||
# Set Brotli lib | ||
################################## | ||
|
||
if [ "$DISTRO_CODENAME" = "jessie" ]; then | ||
LIBBROTLI_DEV="" | ||
else | ||
LIBBROTLI_DEV="libbrotli-dev" | ||
fi | ||
|
||
################################## | ||
# Set Pagespeed module | ||
################################## | ||
|
@@ -394,12 +405,12 @@ echo "" | |
_install_dependencies() { | ||
echo -ne ' Installing dependencies [..]\r' | ||
if { | ||
apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install \ | ||
apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install \ | ||
git build-essential libtool automake autoconf \ | ||
libgd-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 "$LIBSSL_DEV" | ||
libgmp-dev autotools-dev libxml2-dev libpcre3-dev "$LIBBROTLI_DEV" "$LIBSSL_DEV" | ||
} >> /tmp/nginx-ee.log 2>&1; then | ||
echo -ne " Installing dependencies [${CGREEN}OK${CEND}]\\r" | ||
echo -ne '\n' | ||
|
@@ -485,7 +496,7 @@ _gcc_ubuntu_setup() { | |
if [ ! -f /etc/apt/sources.list.d/jonathonf-ubuntu-gcc-"$(lsb_release -sc)".list ]; then | ||
{ | ||
echo "### adding gcc repository ###" | ||
add-apt-repository -y ppa:jonathonf/gcc -u | ||
add-apt-repository ppa:jonathonf/gcc -yu | ||
} >> /dev/null 2>&1 | ||
fi | ||
if [ "$RTMP" != "y" ]; then | ||
|
@@ -529,6 +540,37 @@ _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 | ||
################################## | ||
|
@@ -715,74 +757,6 @@ _download_zlib() { | |
|
||
} | ||
|
||
################################## | ||
# Download & compile pcre | ||
################################## | ||
|
||
_compile_pcre() { | ||
|
||
{ | ||
|
||
cd "$DIR_SRC/pcre" || exit 1 | ||
./configure --prefix=/usr \ | ||
--enable-utf8 \ | ||
--enable-unicode-properties \ | ||
--enable-pcre16 \ | ||
--enable-pcre32 \ | ||
--enable-pcregrep-libz \ | ||
--enable-pcregrep-libbz2 \ | ||
--enable-pcretest-libreadline \ | ||
--enable-jit | ||
|
||
make -j "$(nproc)" | ||
make install | ||
mv -v /usr/lib/libpcre.so.* /lib | ||
ln -sfv ../../lib/"$(readlink /usr/lib/libpcre.so)" /usr/lib/libpcre.so | ||
|
||
} >> /tmp/nginx-ee.log 2>&1 | ||
} | ||
|
||
_download_pcre() { | ||
|
||
cd "$DIR_SRC" || exit 1 | ||
|
||
echo -ne ' Downloading pcre [..]\r' | ||
if { | ||
if [ -z "$(command -v pcretest)" ]; then | ||
{ | ||
curl -sL https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VER}.tar.gz | /bin/tar zxf - -C "$DIR_SRC" | ||
mv pcre-${PCRE_VER} pcre | ||
|
||
_compile_pcre | ||
|
||
} \ | ||
>> /tmp/nginx-ee.log 2>&1 | ||
else | ||
PCRE_VERSION=$(pcretest -C 2>&1 | grep version | awk -F " " '{print $3}') | ||
if [ "$PCRE_VERSION" != "$PCRE_VER" ]; then | ||
|
||
{ | ||
curl -sL https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VER}.tar.gz | /bin/tar zxf - -C "$DIR_SRC" | ||
mv pcre-${PCRE_VER} pcre | ||
|
||
_compile_pcre | ||
|
||
ln -sfv ../../lib/"$(readlink /usr/lib/libpcre.so)" /usr/lib/libpcre.so | ||
|
||
} >> /tmp/nginx-ee.log 2>&1 | ||
|
||
fi | ||
fi | ||
}; then | ||
echo -ne " Downloading pcre [${CGREEN}OK${CEND}]\\r" | ||
echo -ne '\n' | ||
else | ||
echo -e " Downloading pcre [${CRED}FAIL${CEND}]" | ||
echo -e '\n Please look at /tmp/nginx-ee.log\n' | ||
exit 1 | ||
fi | ||
|
||
} | ||
|
||
################################## | ||
# Download ngx_broti | ||
|
@@ -795,7 +769,11 @@ _download_brotli() { | |
echo -ne ' Downloading brotli [..]\r' | ||
{ | ||
rm /usr/local/src/ngx_brotli -rf | ||
git clone --recursive --depth=50 https://github.com/eustas/ngx_brotli /usr/local/src/ngx_brotli -q | ||
if [ "$DISTRO_CODENAME" = "jessie" ]; then | ||
git clone --recursive --depth=50 https://github.com/eustas/ngx_brotli /usr/local/src/ngx_brotli -q | ||
else | ||
git clone --depth=50 https://github.com/eustas/ngx_brotli /usr/local/src/ngx_brotli -q | ||
fi | ||
|
||
} >> /tmp/nginx-ee.log 2>&1 | ||
|
||
|
@@ -871,47 +849,6 @@ _download_openssl_dev() { | |
|
||
} | ||
|
||
################################## | ||
# Download and patch OpenSSL | ||
################################## | ||
|
||
_download_openssl() { | ||
|
||
cd "$DIR_SRC" || exit 1 | ||
if { | ||
echo -ne ' Downloading openssl [..]\r' | ||
{ | ||
rm -rf /usr/local/src/openssl | ||
curl -sL https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz | /bin/tar xzf - -C "$DIR_SRC" | ||
mv /usr/local/src/openssl-${OPENSSL_VER} /usr/local/src/openssl | ||
} >> /tmp/nginx-ee.log 2>&1 | ||
|
||
{ | ||
if [ -d /usr/local/src/openssl-patch/.git ]; then | ||
cd /usr/local/src/openssl-patch || exit 1 | ||
git pull origin master | ||
else | ||
rm -rf /usr/local/src/openssl-patch | ||
git clone --depth=50 https://github.com/VirtuBox/openssl-patch.git /usr/local/src/openssl-patch | ||
fi | ||
cd /usr/local/src/openssl || exit 1 | ||
# apply openssl ciphers patch | ||
echo "### openssl ciphers patch ###" | ||
patch -p1 < ../openssl-patch/openssl-${OPENSSL_VER}-chacha_draft.patch | ||
} >> /tmp/nginx-ee.log 2>&1 | ||
|
||
}; then | ||
echo -ne " Downloading openssl [${CGREEN}OK${CEND}]\\r" | ||
echo -ne '\n' | ||
|
||
else | ||
echo -e " Downloading openssl [${CRED}FAIL${CEND}]" | ||
echo -e '\n Please look at /tmp/nginx-ee.log\n' | ||
exit 1 | ||
fi | ||
|
||
} | ||
|
||
################################## | ||
# Download LibreSSL | ||
################################## | ||
|
@@ -1380,6 +1317,7 @@ _final_tasks() { | |
# Main Setup | ||
################################## | ||
|
||
_dependencies_repo | ||
_install_dependencies | ||
if [ "$NGINX_FROM_SCRATCH" = "1" ]; then | ||
_nginx_from_scratch_setup | ||
|
@@ -1393,7 +1331,6 @@ fi | |
_cleanup_modules | ||
_download_modules | ||
_download_zlib | ||
_download_pcre | ||
_download_brotli | ||
if [ "$NAXSI" = "y" ]; then | ||
_download_naxsi | ||
|
@@ -1406,7 +1343,7 @@ else | |
elif [ "$OPENSSL_LIB" = "3" ]; then | ||
sleep 1 | ||
else | ||
_download_openssl | ||
sleep 1 | ||
fi | ||
fi | ||
if [ "$PAGESPEED" = "y" ]; then | ||
|