From 57331f6db84362c2ac69b679e9bb0e9d8e360884 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 18 Aug 2020 13:04:26 +0200 Subject: [PATCH 1/2] Fix issues with Ubuntu 20.04 * update gcc * do not update ssl ciphers suite anymore --- nginx-build.sh | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/nginx-build.sh b/nginx-build.sh index 43c81d2..c41390d 100755 --- a/nginx-build.sh +++ b/nginx-build.sh @@ -7,7 +7,7 @@ # Copyright (c) 2019-2020 VirtuBox # This script is licensed under M.I.T # ------------------------------------------------------------------------- -# Version 3.6.6 - 2020-05-02 +# Version 3.6.7 - 2020-08-18 # ------------------------------------------------------------------------- ################################## @@ -131,26 +131,19 @@ command_exists() { apt-get update -qq } -# checking if curl is installed -if ! command_exists curl; then - apt-get install curl -qq >/dev/null 2>&1 -fi +# check if required packages are installed +required_packages="curl tar jq" +for package in $required_packages; do + if ! command_exists "$package"; then + apt-get install "$package" -qq >/dev/null 2>&1 + fi +done # Checking if lsb_release is installed if ! command_exists lsb_release; then apt-get -qq install lsb-release >/dev/null 2>&1 fi -# checking if tar is installed -if ! command_exists tar; then - apt-get -qq install tar >/dev/null 2>&1 -fi - -# checking if jq is installed -if ! command_exists jq; then - apt-get install jq -qq >/dev/null 2>&1 -fi - ################################## # Variables ################################## @@ -525,29 +518,29 @@ _dynamic_setup() { _gcc_ubuntu_setup() { - if [ ! -f /etc/apt/sources.list.d/jonathonf-ubuntu-gcc-"$(lsb_release -sc)".list ]; then + if [ ! -f /etc/apt/sources.list.d/jonathonf-ubuntu-gcc-"$(lsb_release -sc)".list ] && [ "$DISTRO_CODENAME" != "focal" ]; then { echo "### adding gcc repository ###" add-apt-repository ppa:jonathonf/gcc -yu } >>/dev/null 2>&1 fi if [ "$RTMP" != "y" ]; then - echo -ne ' Installing gcc-8 [..]\r' + echo -ne ' Installing gcc-9 [..]\r' if { - echo "### installing gcc8 ###" - apt-get install gcc-8 g++-8 -y + echo "### installing gcc9 ###" + apt-get install gcc-9 g++-9 -y } >>/dev/null 2>&1; then - echo -ne " Installing gcc-8 [${CGREEN}OK${CEND}]\\r" + echo -ne " Installing gcc-9 [${CGREEN}OK${CEND}]\\r" echo -ne '\n' else - echo -e " Installing gcc-8 [${CRED}FAIL${CEND}]" + echo -e " Installing gcc-9 [${CRED}FAIL${CEND}]" echo -e '\n Please look at /tmp/nginx-ee.log\n' exit 1 fi { # update gcc alternative to use gcc-8 by default update-alternatives --remove-all gcc - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 80 --slave /usr/bin/g++ g++ /usr/bin/g++-9 } >>/dev/null 2>&1 else echo -ne ' Installing gcc-7 [..]\r' @@ -611,7 +604,7 @@ _rtmp_setup() { echo -ne ' Installing FFMPEG for RTMP module [..]\r' if { - if [ "$DISTRO_ID" = "Ubuntu" ]; then + if [ "$DISTRO_ID" = "Ubuntu" ] && [ "$DISTRO_CODENAME" != "focal" ]; then if [ ! -f /etc/apt/sources.list.d/jonathonf-ubuntu-ffmpeg-4-"$(lsb_release -sc)".list ]; then add-apt-repository -y ppa:jonathonf/ffmpeg-4 -u apt-get install ffmpeg -y @@ -1157,9 +1150,9 @@ _final_tasks() { if [ "$PLESK_VALID" = "YES" ]; then { # update nginx ciphers_suites - sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$TLS13_CIPHERS\";/" /etc/nginx/conf.d/ssl.conf + # sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$TLS13_CIPHERS\";/" /etc/nginx/conf.d/ssl.conf # update nginx ssl_protocols - sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2 TLSv1.3;/" /etc/nginx/conf.d/ssl.conf + # sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2 TLSv1.3;/" /etc/nginx/conf.d/ssl.conf # block sw-nginx package updates from APT repository echo -e 'Package: sw-nginx*\nPin: release *\nPin-Priority: -1' >/etc/apt/preferences.d/nginx-block apt-mark hold sw-nginx @@ -1177,13 +1170,13 @@ _final_tasks() { elif [ "$WO_VALID" = "YES" ]; then { # update nginx ssl_protocols - sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2 TLSv1.3;/" /etc/nginx/nginx.conf + # sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2 TLSv1.3;/" /etc/nginx/nginx.conf # update nginx ciphers_suites - sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$TLS13_CIPHERS\";/" /etc/nginx/nginx.conf + # sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$TLS13_CIPHERS\";/" /etc/nginx/nginx.conf # block nginx package updates from APT repository echo -e 'Package: nginx*\nPin: release *\nPin-Priority: -1' >/etc/apt/preferences.d/nginx-block CHECK_NGINX_WO=$(dpkg --list | grep nginx-wo) - if [ ! -z "$CHECK_NGINX_WO" ]; then + if [ -n "$CHECK_NGINX_WO" ]; then apt-mark hold nginx-wo nginx-common nginx-custom else apt-mark hold nginx-ee nginx-common nginx-custom From 5d08b56cfd7d2083a7fc9ba5647b6ec971489014 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 18 Aug 2020 13:14:31 +0200 Subject: [PATCH 2/2] Update README and changelog --- CHANGELOG.md | 10 ++++++++++ README.md | 4 ++-- docs/index.md | 4 ++-- nginx-build.sh | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f90713..4cb85b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - XX-XX-XX +## [3.6.7] - 2020-08-18 + +### Changed + +- Compile with gcc-9 + +### Fixed + +- wrong PPA repositories with Ubuntu 20.04 + ## [3.6.6] - 2020-05-02 ### Changed diff --git a/README.md b/README.md index 91f9473..121b77a 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ Automated Nginx compilation from sources with additional modules support * Cloudflare HPACK * Cloudflare zlib * Automated nginx updates cronjob -* Compilation with GCC-7/8 +* Compilation with GCC-7/9 * Security hardening and performance optimization enabled with proper GCC flags --- ## Additional Third-party modules -Nginx current mainline release : **v1.17.10** +Nginx current mainline release : **v1.19.2** Nginx current stable release : **v1.18.0** * [ngx_cache_purge](https://github.com/FRiCKLE/ngx_cache_purge) diff --git a/docs/index.md b/docs/index.md index bd1e36e..4b2f575 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,12 +48,12 @@ Automated Nginx compilation from sources with additional modules support
  • Cloudflare HPACK
  • Cloudflare zlib
  • Automated nginx updates cronjob
  • -
  • Compilation with GCC-7/8
  • +
  • Compilation with GCC-7/9
  • Security hardening and performance optimization enabled with proper GCC flags

  • Additional Third-party modules

    -

    Nginx current mainline release : v1.17.10 +

    Nginx current mainline release : v1.19.2 Nginx current stable release : v1.18.0

    • ngx_cache_purge
    • diff --git a/nginx-build.sh b/nginx-build.sh index c41390d..d51f786 100755 --- a/nginx-build.sh +++ b/nginx-build.sh @@ -411,7 +411,7 @@ _gitget() { } _install_dependencies() { - echo -ne ' Installing dependencies [..]\r' + echo -ne ' Installing dependencies [..]\r' if { apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install \ git build-essential libtool automake autoconf \