Skip to content

Commit

Permalink
Check in 1.6.14
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlst committed Jun 18, 2020
1 parent e449905 commit d0495f7
Show file tree
Hide file tree
Showing 21 changed files with 624 additions and 204 deletions.
2 changes: 1 addition & 1 deletion LSQUICCOMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
652129e69b0b9eebb0495df0f30b4853b866bff0
583766be5fa2913463179d500f7e25583b273e07
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ prepareLinux()
cat /etc/lsb-release | grep "DISTRIB_RELEASE=18." >/dev/null
if [ $? = 0 ] ; then
OSTYPE=UBUNTU18
else
cat /etc/lsb-release | grep "DISTRIB_RELEASE=20." >/dev/null
if [ $? = 0 ] ; then
OSTYPE=UBUNTU20
fi
fi
fi
fi
Expand Down Expand Up @@ -259,7 +264,7 @@ prepareLinux()

#other debian OS, we still can
if [ "${OSTYPE}" = "unknowlinux" ] ; then
echo It seems you are not using ubuntu 14,16,18 and Debian 7/8/9/10.
echo It seems you are not using ubuntu 14,16,18,20 and Debian 7/8/9/10.
echo But we still can try to go further.
fi

Expand Down Expand Up @@ -528,7 +533,9 @@ git clone https://github.com/litespeedtech/third-party.git
mv third-party thirdparty
mkdir thirdparty/lib64
cd thirdparty/script/

git pull
#Only for 1.6.14
git reset --hard 41eab3fb08ba59229382e3edf8e0cc5e26d1c03e


sed -i -e "s/unittest-cpp/ /g" ./build_ols.sh
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for openlitespeed 1.6.13.
# Generated by GNU Autoconf 2.69 for openlitespeed 1.6.14.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='openlitespeed'
PACKAGE_TARNAME='openlitespeed'
PACKAGE_VERSION='1.6.13'
PACKAGE_STRING='openlitespeed 1.6.13'
PACKAGE_VERSION='1.6.14'
PACKAGE_STRING='openlitespeed 1.6.14'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL='http://www.litespeedtech.com/'

Expand Down Expand Up @@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures openlitespeed 1.6.13 to adapt to many kinds of systems.
\`configure' configures openlitespeed 1.6.14 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1480,7 +1480,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of openlitespeed 1.6.13:";;
short | recursive ) echo "Configuration of openlitespeed 1.6.14:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1641,7 +1641,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
openlitespeed configure 1.6.13
openlitespeed configure 1.6.14
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2315,7 +2315,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by openlitespeed $as_me 1.6.13, which was
It was created by openlitespeed $as_me 1.6.14, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -3181,7 +3181,7 @@ fi

# Define the identity of the package.
PACKAGE='openlitespeed'
VERSION='1.6.13'
VERSION='1.6.14'


# Some tools Automake needs.
Expand Down Expand Up @@ -19624,7 +19624,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by openlitespeed $as_me 1.6.13, which was
This file was extended by openlitespeed $as_me 1.6.14, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -19691,7 +19691,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
openlitespeed config.status 1.6.13
openlitespeed config.status 1.6.14
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ m4_include(ax_check_libudns.m4)
m4_include(ax_check_ip2location.m4)

dnl Process this file with autoconf to produce a configure script.
AC_INIT([openlitespeed],[1.6.13],[[email protected]],[openlitespeed],[http://www.litespeedtech.com/])
AC_INIT([openlitespeed],[1.6.14],[[email protected]],[openlitespeed],[http://www.litespeedtech.com/])
AM_INIT_AUTOMAKE([1.0 foreign no-define subdir-objects])


Expand Down
2 changes: 1 addition & 1 deletion dist/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.13
1.6.14
2 changes: 1 addition & 1 deletion dist/add-ons/webcachemgr/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12
1.13.1
83 changes: 50 additions & 33 deletions dist/add-ons/webcachemgr/src/Panel/CPanel.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/* * ******************************************
/** ******************************************
* LiteSpeed Web Server Cache Manager
*
* @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com)
Expand All @@ -17,14 +17,10 @@
class CPanel extends ControlPanel
{

const USER_PLUGIN_INSTALL_SCRIPT =
'/usr/local/cpanel/whostmgr/docroot/cgi/lsws/res/ls_web_cache_mgr/install.sh';
const USER_PLUGIN_UNINSTALL_SCRIPT =
'/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/uninstall.sh';
const USER_PLUGIN_CONF =
'/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/lswcm.conf';
const CPANEL_AUTOINSTALL_DISABLE_FLAG =
'/usr/local/cpanel/whostmgr/docroot/cgi/lsws/cpanel_autoinstall_off';
const USER_PLUGIN_INSTALL_SCRIPT = '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/res/ls_web_cache_mgr/install.sh';
const USER_PLUGIN_UNINSTALL_SCRIPT = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/uninstall.sh';
const USER_PLUGIN_CONF = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/lswcm.conf';
const CPANEL_AUTOINSTALL_DISABLE_FLAG = '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/cpanel_autoinstall_off';
const USER_PLUGIN_SETTING_VHOST_CACHE_ROOT = 'vhost_cache_root';
const USER_PLUGIN_SETTING_LSWS_DIR = 'lsws_dir';

Expand All @@ -44,12 +40,16 @@ protected function __construct()
protected function initConfPaths()
{
if ( $this->isEA4 ) {
$this->apacheConf = '/etc/apache2/conf.d/includes/pre_main_global.conf';
$this->apacheVHConf = '/etc/apache2/conf.d/userdata/lscache_vhosts.conf';
$this->apacheConf =
'/etc/apache2/conf.d/includes/pre_main_global.conf';
$this->apacheVHConf =
'/etc/apache2/conf.d/userdata/lscache_vhosts.conf';
}
else {
$this->apacheConf = '/usr/local/apache/conf/includes/pre_main_global.conf';
$this->apacheVHConf = '/usr/local/apache/conf/userdata/lscache_vhosts.conf';
$this->apacheConf =
'/usr/local/apache/conf/includes/pre_main_global.conf';
$this->apacheVHConf =
'/usr/local/apache/conf/userdata/lscache_vhosts.conf';
}
}

Expand Down Expand Up @@ -83,23 +83,25 @@ protected function vhCacheRootSearch()

/**
*
* @param string $file_contents
* @return string
* @param array $file_contents
* @param string $vhCacheRoot
* @return array
*/
protected function addVHCacheRootSection( $file_contents,
$vhCacheRoot = 'lscache' )
{
array_unshift($file_contents,
"<IfModule LiteSpeed>\nCacheRoot {$vhCacheRoot}\n</IfModule>\n\n");
$modified_contents = $file_contents;
array_unshift(
$file_contents,
"<IfModule LiteSpeed>\nCacheRoot {$vhCacheRoot}\n</IfModule>\n\n"
);

return $modified_contents;
return $file_contents;
}

/**
*
* @param string $vhConf
* @throws LSCMException
* @throws LSCMException Thrown directly and indirectly.
*/
public function createVHConfAndSetCacheRoot( $vhConf,
$vhCacheRoot = 'lscache' )
Expand All @@ -109,13 +111,16 @@ public function createVHConfAndSetCacheRoot( $vhConf,
if ( !file_exists($vhConfDir) ) {

if ( !mkdir($vhConfDir, 0755) ) {
throw new LSCMException("Failed to create directory {$vhConfDir}.");
throw new LSCMException(
"Failed to create directory {$vhConfDir}."
);
}

$this->log("Created directory {$vhConfDir}", Logger::L_DEBUG);
}

$content = "<IfModule Litespeed>\nCacheRoot {$vhCacheRoot}\n</IfModule>";
$content =
"<IfModule Litespeed>\nCacheRoot {$vhCacheRoot}\n</IfModule>";

if ( false === file_put_contents($vhConf, $content) ) {
throw new LSCMException("Failed to create file {$vhConf}.");
Expand All @@ -139,8 +144,10 @@ public function applyVHConfChanges()
*/
protected function prepareDocrootMap()
{
$cmd = 'grep -hro --exclude="cache" --exclude="main" '
. '--exclude="*.cache" "documentroot.*\|serveralias.*\|servername.*" /var/cpanel/userdata/*';
$cmd =
'grep -hro --exclude="cache" --exclude="main" --exclude="*.cache" '
. '"documentroot.*\|serveralias.*\|servername.*" '
. '/var/cpanel/userdata/*';
exec($cmd, $lines);

/**
Expand Down Expand Up @@ -207,7 +214,9 @@ protected function prepareDocrootMap()
$cur = '';
}
else {
Logger::debug("Unused line when preparing docroot map: {$line}.");
Logger::debug(
"Unused line when preparing docroot map: {$line}."
);
}
}

Expand All @@ -227,7 +236,8 @@ protected function prepareDocrootMap()
$index++;
}

$this->docRootMap = array( 'docroots' => $roots, 'names' => $servernames );
$this->docRootMap =
array( 'docroots' => $roots, 'names' => $servernames );
}

/**
Expand All @@ -249,8 +259,8 @@ public function getPhpBinary( WPInstall $wpInstall )
* cPanel php wrapper should accurately detect the correct binary in
* EA4 when EA4 only directive '--ea-reference-dir' is provided.
*/
$phpBin =
"/usr/local/bin/php --ea-reference-dir={$wpInstall->getPath()}/wp-admin";
$phpBin = '/usr/local/bin/php '
. "--ea-reference-dir={$wpInstall->getPath()}/wp-admin";
}

return "{$phpBin} {$this->phpOptions}";
Expand Down Expand Up @@ -299,11 +309,16 @@ public static function turnOffCpanelPluginAutoInstall()
public function installCpanelPlugin()
{
if ( !file_exists(self::USER_PLUGIN_INSTALL_SCRIPT) ) {
throw new LSCMException('Unable to find cPanel user-end plugin installation script.'
. ' Please ensure that the LiteSpeed WHM plugin is already installed.');
throw new LSCMException(
'Unable to find cPanel user-end plugin installation script.'
. ' Please ensure that the LiteSpeed WHM plugin is already '
. 'installed.'
);
}

$cpanelPluginDir = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager';
$cpanelPluginDir =
'/usr/local/cpanel/base/frontend/paper_lantern/'
. 'ls_web_cache_manager';
$cpanelPluginConfFile = "{$cpanelPluginDir}/lswcm.conf";
$cpanelPluginTplDir = "{$cpanelPluginDir}/landing";
$cpanelPluginCustTransDir = "{$cpanelPluginDir}/lang/cust";
Expand Down Expand Up @@ -373,8 +388,10 @@ public function installCpanelPlugin()
public function uninstallCpanelPlugin()
{
if ( !file_exists(self::USER_PLUGIN_UNINSTALL_SCRIPT) ) {
throw new LSCMException('Unable to find cPanel user-end plugin uninstallation script.'
. ' Plugin may already be uninstalled.');
throw new LSCMException(
'Unable to find cPanel user-end plugin uninstallation script.'
. ' Plugin may already be uninstalled.'
);
}

exec(self::USER_PLUGIN_UNINSTALL_SCRIPT);
Expand Down
Loading

0 comments on commit d0495f7

Please sign in to comment.