Browse Source

Add php7.2 argon2 and sodium

lj2007331@gmail.com 7 years ago
parent
commit
90523bbdf3
6 changed files with 41 additions and 16 deletions
  1. 2 0
      include/check_download.sh
  2. 20 3
      include/php-7.2.sh
  3. 1 1
      install.sh
  4. 15 12
      ss.sh
  5. 2 0
      versions.txt
  6. 1 0
      vhost.sh

+ 2 - 0
include/check_download.sh

@@ -583,6 +583,8 @@ checkDownload() {
         ;;
       7)
         src_url=http://www.php.net/distributions/php-${php72_ver}.tar.gz && Download_src
+        src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
+        src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
         ;;
     esac
   fi

+ 20 - 3
include/php-7.2.sh

@@ -29,6 +29,23 @@ Install_PHP72() {
     rm -rf curl-${curl_ver}
   fi
 
+  if [ ! -e "/usr/lib/libargon2.a" ]; then
+    tar xzf argon2-${argon2_ver}.tar.gz
+    pushd argon2-${argon2_ver}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf argon2-${argon2_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libsodium.la" ]; then
+    tar xzf libsodium-${libsodium_ver}.tar.gz
+    pushd libsodium-${libsodium_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libsodium-${libsodium_ver}
+  fi
+
   if [ ! -e "/usr/local/lib/libmhash.la" ]; then
     tar xzf mhash-${mhash_ver}.tar.gz
     pushd mhash-${mhash_ver}
@@ -40,7 +57,7 @@ Install_PHP72() {
 
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+  [ "$OS" == 'CentOS' ] && { [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -59,7 +76,7 @@ Install_PHP72() {
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
     --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
-    --enable-mbstring --with-gd --with-openssl=${openssl_install_dir} \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --with-gd --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   else
@@ -70,7 +87,7 @@ Install_PHP72() {
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
     --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
-    --enable-mbstring --with-gd --with-openssl=${openssl_install_dir} \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --with-gd --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi

+ 1 - 1
install.sh

@@ -45,7 +45,7 @@ version() {
 showhelp() {
   version
   echo "Usage: $0  command ...[parameters]....
-  --help, -h                  Show this help message
+  --help, -h                  Show this help message, More: https://oneinstack.com/autoinstall
   --version, -v               Show version info
   --nginx_option [1-3]        Install Nginx server version
   --apache_option [1-2]       Install Apache server version

+ 15 - 12
ss.sh

@@ -102,13 +102,13 @@ Def_parameter() {
   AddUser_SS
   Iptables_set
   if [ "${OS}" == "CentOS" ]; then
-    pkgList="wget unzip openssl-devel gcc swig autoconf libtool libevent automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel git asciidoc xmlto c-ares-devel pcre-devel mbedtls-devel udns-devel libev-devel libsodium"
+    pkgList="wget unzip openssl-devel gcc swig autoconf libtool libevent automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel git asciidoc xmlto c-ares-devel pcre-devel udns-devel libev-devel"
     for Package in ${pkgList}; do
       yum -y install ${Package}
     done
   elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
     apt-get -y update
-    pkgList="curl wget unzip gcc swig automake make perl cpio git libmbedtls-dev libudns-dev libev-dev gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libc-ares-dev"
+    pkgList="curl wget unzip gcc swig automake make perl cpio git libudns-dev libev-dev gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libc-ares-dev"
     for Package in ${pkgList}; do
       apt-get -y install $Package
     done
@@ -136,19 +136,22 @@ Install_SS-python() {
 
 Install_SS-libev() {
   src_url=http://mirrors.linuxeye.com/oneinstack/src/shadowsocks-libev-3.1.3.tar.gz && Download_src
-  src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-1.0.16.tar.gz && Download_src
-  src_url=http://mirrors.linuxeye.com/oneinstack/src/mbedtls-2.7.0-apache.tgz && Download_src
-  tar xzf shadowsocks-libev-3.1.3.tar.gz
-  tar xzf libsodium-1.0.16.tar.gz
-  tar xzf mbedtls-2.7.0-apache.tgz
-  pushd libsodium-1.0.16
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  pushd mbedtls-2.7.0
+  src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
+  src_url=http://mirrors.linuxeye.com/oneinstack/src/mbedtls-2.8.0-apache.tgz && Download_src
+  if [ ! -e "/usr/local/lib/libsodium.la" ]; then
+    tar xzf libsodium-${libsodium_ver}.tar.gz
+    pushd libsodium-${libsodium_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libsodium-${libsodium_ver}
+  fi
+  tar xzf mbedtls-2.8.0-apache.tgz
+  pushd mbedtls-2.8.0
   make SHARED=1 CFLAGS=-fPIC
   make DESTDIR=/usr install
   popd
+  tar xzf shadowsocks-libev-3.1.3.tar.gz
   pushd shadowsocks-libev-3.1.3
   make clean
   ./configure

+ 2 - 0
versions.txt

@@ -55,6 +55,8 @@ curl_ver=7.59.0
 libmcrypt_ver=2.5.8
 mcrypt_ver=2.6.8
 mhash_ver=0.9.9.9
+libsodium_ver=1.0.16
+argon2_ver=20171227
 imagemagick_ver=6.9.9-40
 imagick_ver=3.4.3
 graphicsmagick_ver=1.3.28

+ 1 - 0
vhost.sh

@@ -168,6 +168,7 @@ If you enter '.', the field will be left blank.
     openssl req -new -newkey rsa:2048 -sha256 -nodes -out ${PATH_SSL}/${domain}.csr -keyout ${PATH_SSL}/${domain}.key -subj "/C=${SELFSIGNEDSSL_C}/ST=${SELFSIGNEDSSL_ST}/L=${SELFSIGNEDSSL_L}/O=${SELFSIGNEDSSL_O}/OU=${SELFSIGNEDSSL_OU}/CN=${domain}" > /dev/null 2>&1
     openssl x509 -req -days 36500 -sha256 -in ${PATH_SSL}/${domain}.csr -signkey ${PATH_SSL}/${domain}.key -out ${PATH_SSL}/${domain}.crt > /dev/null 2>&1
   elif [ "${Domian_Mode}" == '3' ]; then
+    echo "${CMSG}More: https://oneinstack.com/faq/letsencrypt${CEND}"
     if [ "${moredomain}" == "*.${domain}" ]; then
       while :; do echo
         read -p "Please enter your DNS provider: " DNS_PRO