From a4096c1fd273b95af5001c1f912bc74a413f2a29 Mon Sep 17 00:00:00 2001 From: Alfin Auzikri Date: Tue, 5 Apr 2022 15:52:52 +0700 Subject: [PATCH 1/3] Avoid blocking DNS at several ISPs in Indonesia --- cyberpanel.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 9e059731f..7dc62b68d 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -21,6 +21,7 @@ #Check_Panel() ---> check to make sure no other panel is installed #Check_Process() ---> check no other process like Apache is running #Check_Provider() ---> check the provider, certain provider like Alibaba or Tencent Yun may need some special change +#Check_Organization() ---> check the organization, certain provider or organization like Telkom Indonesia or Biznet Networks Indonesia may need some special change #Check_Argument() ---> parse argument and go to Argument_Mode() or Interactive_Mode() respectively #Pre_Install_Setup_Repository() ---> setup/install repositories for centos system. #go to Pre_Install_Setup_CN_Repository() if server is within China. @@ -65,6 +66,7 @@ Server_Country="Unknow" Server_OS="" Server_OS_Version="" Server_Provider='Undefined' +Server_Organization='Undefined' Watchdog="On" Redis_Hosting="No" @@ -406,6 +408,18 @@ if [[ "$Debug" = "On" ]] ; then fi } +Check_Organization() { +if [[ "$(curl --silent --max-time 10 -4 curl ipinfo.io/org)" = "AS17451 BIZNET NETWORKS" ]]; then + Server_Organization="Biznet Networks" +else + Server_Organization="Undefined" +fi + +if [[ "$Debug" = "On" ]] ; then + Debug_Log "Server_Organization" "$Server_Organization" +fi +} + Show_Help() { echo -e "\nCyberPanel Installer Script Help\n" echo -e "\nUsage: sh <(curl cyberpanel.sh) --argument" @@ -1196,8 +1210,14 @@ if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then echo -e "nameserver 100.100.2.136" > /etc/resolv.conf echo -e "nameserver 100.100.2.138" >> /etc/resolv.conf else - echo -e "nameserver 1.1.1.1" > /etc/resolv.conf - echo -e "nameserver 8.8.8.8" >> /etc/resolv.conf + # Avoid blocking DNS at several ISPs in Indonesia. + if [[ "$Server_Organization" = "Biznet Networks" ]] ; then + echo -e "nameserver 203.142.82.222" > /etc/resolv.conf + echo -e "nameserver 203.142.84.222" >> /etc/resolv.conf + else + echo -e "nameserver 1.1.1.1" > /etc/resolv.conf + echo -e "nameserver 8.8.8.8" >> /etc/resolv.conf + fi fi systemctl restart systemd-networkd >/dev/null 2>&1 From eb79bdd56c9c3f839e1cb7bf39c9594272ead7e5 Mon Sep 17 00:00:00 2001 From: Alfin Auzikri Date: Tue, 5 Apr 2022 16:05:22 +0700 Subject: [PATCH 2/3] Add PHP 8.1 to Install PHP Extensions Page --- managePHP/php81.xml | 281 ++++++++++++++++++++++++++++++++++++++ managePHP/ubuntuphp81.xml | 131 ++++++++++++++++++ managePHP/views.py | 29 ++++ 3 files changed, 441 insertions(+) create mode 100644 managePHP/php81.xml create mode 100644 managePHP/ubuntuphp81.xml diff --git a/managePHP/php81.xml b/managePHP/php81.xml new file mode 100644 index 000000000..1ca936318 --- /dev/null +++ b/managePHP/php81.xml @@ -0,0 +1,281 @@ + + + php81 + + + lsphp81-debuginfo + Debug information for package lsphp81 + 0 + + + + lsphp81-pecl-igbinary-debuginfo + Debug information for package lsphp81-pecl-igbinary + 0 + + + + lsphp81-pecl-mcrypt-debuginfo + lsphp81 lsphp81-pecl-mcrypt-debuginfo Extension + 0 + + + + lsphp81-bcmath + A extension for PHP applications for using the bcmath library. + 1 + + + + lsphp81-common + Common files for PHP. + 1 + + + + lsphp81-dba + A database abstraction layer extension for PHP applications. + 1 + + + + lsphp81-devel + Files needed for building PHP extensions. + 0 + + + + lsphp81-enchant + Enchant spelling extension for PHP applications. + 1 + + + + lsphp81-gd + A extension for PHP applications for using the gd graphics library. + 1 + + + + lsphp81-gmp + A extension for PHP applications for using the GNU MP library. + 1 + + + + lsphp81-imap + A extension for PHP applications that use IMAP. + 1 + + + + lsphp81-intl + Internationalization extension for PHP applications. + 1 + + + + lsphp81-json + lsphp81 Json PHP Extension + 1 + + + + lsphp81-ldap + A extension for PHP applications that use LDAP. + 1 + + + + lsphp81-mbstring + A extension for PHP applications which need multi-byte string handling. + 1 + + + + lsphp81-mysqlnd + A extension for PHP applications that use MySQL databases. + 1 + + + + lsphp81-odbc + A extension for PHP applications that use ODBC databases. + 1 + + + + lsphp81-opcache + The Zend OPcache. + 1 + + + + lsphp81-pdo + A database access abstraction extension for PHP applications. + 1 + + + + lsphp81-pear + PHP Extension and Application Repository framework. + 1 + + + + lsphp81-pecl-apcu + APC User Cache. + 0 + + + + lsphp81-pecl-apcu-devel + APCu developer files (header). + 0 + + + + lsphp81-pecl-apcu-panel + APCu control panel. + 0 + + + + lsphp81-pecl-igbinary + Replacement for the standard PHP serializer. + 0 + + + + lsphp81-pecl-igbinary-devel + Igbinary developer files (header). + 0 + + + + lsphp81-pecl-mcrypt + lsphp81 lsphp81-pecl-mcrypt Extension. + 0 + + + + lsphp81-pecl-memcache + Extension to work with the Memcached caching daemon. + 0 + + + + lsphp81-pecl-memcached + Extension to work with the Memcached caching daemon. + 0 + + + + lsphp81-pecl-msgpack + API for communicating with MessagePack serialization. + 0 + + + + lsphp81-pecl-msgpack-devel + MessagePack developer files (header). + 0 + + + + lsphp81-pecl-redis + Extension for communicating with the Redis key-value store. + 0 + + + + lsphp81-pgsql + A PostgreSQL database extension for PHP. + 1 + + + + lsphp81-process + extensions for PHP script using system process interfaces. + 1 + + + + lsphp81-pspell + A extension for PHP applications for using pspell interfaces. + 1 + + + + lsphp81-recode + A extension for PHP applications for using the recode library. + 1 + + + + lsphp81-snmp + A extension for PHP applications that query SNMP-managed devices. + 1 + + + + lsphp81-soap + A extension for PHP applications that use the SOAP protocol. + 1 + + + + lsphp81-tidy + Standard PHP extension provides tidy library support. + 1 + + + + lsphp81-xml + A module for PHP applications which use XML. + 1 + + + + lsphp81-xmlrpc + A extension for PHP applications which use the XML-RPC protocol. + 1 + + + + lsphp81-zip + ZIP archive management extension for PHP + 0 + + + + lsphp81-mcrypt + Standard PHP extension provides mcrypt library support. + 1 + + + + lsphp81-dbg + php73-dbg lsphp81-package + 0 + + + + lsphp81-ioncube + ioncube loaders + 0 + + + + lsphp81-pecl-imagick + Extension to create and modify images using ImageMagick + 0 + + + + lsphp81-sodium + The php-sodium extension provides strong encryption capabilities in an easy and consistent way. + 0 + + + diff --git a/managePHP/ubuntuphp81.xml b/managePHP/ubuntuphp81.xml new file mode 100644 index 000000000..892ccd8c1 --- /dev/null +++ b/managePHP/ubuntuphp81.xml @@ -0,0 +1,131 @@ + + + php81 + + + lsphp81-common + Most of what you need. + 1 + + + + lsphp81-curl + Curl (common web tools) required for PHP + 1 + + + + lsphp81-dbg + Debugging extension + 0 + + + + lsphp81-dev + Development features almost always required. + 1 + + + + lsphp81-imap + Email extensions for PHP. + 1 + + + + lsphp81-intl + Extensions for countries other than the U.S. + 1 + + + + lsphp81-json + PHP extensions for JavaScript Object Notation. + 1 + + + + lsphp81-ldap + PHP extensions for LDAP (directory access protocol) + 1 + + + + lsphp81-modules-source + PHP source modules for virtually everything. Very large. + 0 + + + + lsphp81-mysql + PHP extension for MySQL or MariaDB databases. + 1 + + + + lsphp81-opcache + PHP low-level caching of code. Very important for performance. + 1 + + + + lsphp81-pgsql + A PostgreSQL database extension for PHP. + 0 + + + + lsphp81-pspell + PHP spell checking extensions. + 0 + + + + lsphp81-recode + PHP extension to transform data between different character sets. + 1 + + + + lsphp81-snmp + PHP network management extensions. + 0 + + + + lsphp81-sqlite3 + An extension for PHP applications that use the SQLite v3 features. + 1 + + + + lsphp81-sybase + An extension for PHP applications that use Sybase databases. + 0 + + + + lsphp81-tidy + PHP extensions for manipulating HTML, XHTML and XML documents. + 1 + + + + lsphp81-ioncube + ioncube loaders + 0 + + + + lsphp81-imagick + Extension to create and modify images using ImageMagick + 0 + + + + lsphp81-sodium + The php-sodium extension provides strong encryption capabilities in an easy and consistent way. + 0 + + + diff --git a/managePHP/views.py b/managePHP/views.py index 30186b9d0..aa4711d2a 100755 --- a/managePHP/views.py +++ b/managePHP/views.py @@ -1237,7 +1237,36 @@ def installExtensions(request): phpExtension.save() except: pass + + try: + newPHP81 = PHP(phpVers="php81") + newPHP81.save() + php81Path = '' + + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + php81Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php81.xml') + else: + php81Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp81.xml') + + php81 = ElementTree.parse(php81Path) + + php81Extensions = php81.findall('extension') + + for extension in php81Extensions: + extensionName = extension.find('extensionName').text + extensionDescription = extension.find('extensionDescription').text + status = int(extension.find('status').text) + + phpExtension = installedPackages(phpVers=newPHP81, + extensionName=extensionName, + description=extensionDescription, + status=status) + + phpExtension.save() + except: + pass + proc = httpProc(request, 'managePHP/installExtensions.html', {'phps': PHPManager.findPHPVersions()}, 'admin') return proc.render() From 54f2278f4f269b29af90d97cf132569f63d4ccd3 Mon Sep 17 00:00:00 2001 From: Alfin Auzikri Date: Tue, 5 Apr 2022 16:15:12 +0700 Subject: [PATCH 3/3] Add PHP 8.1 to Install PHP Extensions Page --- cyberpanel.sh | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 7dc62b68d..9e059731f 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -21,7 +21,6 @@ #Check_Panel() ---> check to make sure no other panel is installed #Check_Process() ---> check no other process like Apache is running #Check_Provider() ---> check the provider, certain provider like Alibaba or Tencent Yun may need some special change -#Check_Organization() ---> check the organization, certain provider or organization like Telkom Indonesia or Biznet Networks Indonesia may need some special change #Check_Argument() ---> parse argument and go to Argument_Mode() or Interactive_Mode() respectively #Pre_Install_Setup_Repository() ---> setup/install repositories for centos system. #go to Pre_Install_Setup_CN_Repository() if server is within China. @@ -66,7 +65,6 @@ Server_Country="Unknow" Server_OS="" Server_OS_Version="" Server_Provider='Undefined' -Server_Organization='Undefined' Watchdog="On" Redis_Hosting="No" @@ -408,18 +406,6 @@ if [[ "$Debug" = "On" ]] ; then fi } -Check_Organization() { -if [[ "$(curl --silent --max-time 10 -4 curl ipinfo.io/org)" = "AS17451 BIZNET NETWORKS" ]]; then - Server_Organization="Biznet Networks" -else - Server_Organization="Undefined" -fi - -if [[ "$Debug" = "On" ]] ; then - Debug_Log "Server_Organization" "$Server_Organization" -fi -} - Show_Help() { echo -e "\nCyberPanel Installer Script Help\n" echo -e "\nUsage: sh <(curl cyberpanel.sh) --argument" @@ -1210,14 +1196,8 @@ if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then echo -e "nameserver 100.100.2.136" > /etc/resolv.conf echo -e "nameserver 100.100.2.138" >> /etc/resolv.conf else - # Avoid blocking DNS at several ISPs in Indonesia. - if [[ "$Server_Organization" = "Biznet Networks" ]] ; then - echo -e "nameserver 203.142.82.222" > /etc/resolv.conf - echo -e "nameserver 203.142.84.222" >> /etc/resolv.conf - else - echo -e "nameserver 1.1.1.1" > /etc/resolv.conf - echo -e "nameserver 8.8.8.8" >> /etc/resolv.conf - fi + echo -e "nameserver 1.1.1.1" > /etc/resolv.conf + echo -e "nameserver 8.8.8.8" >> /etc/resolv.conf fi systemctl restart systemd-networkd >/dev/null 2>&1