Merge branch 'stable' into v1.9.4

This commit is contained in:
Usman Nasir
2020-01-16 13:57:30 +05:00
4 changed files with 42 additions and 20 deletions

View File

@@ -139,11 +139,20 @@ sed -i 's|git clone https://github.com/usmannasir/cyberpanel|echo downloaded|g'
#change to CDN first, regardless country
sed -i 's|http://|https://|g' install.py
if ! grep -q "1.1.1.1" /etc/resolv.conf ; then
echo -e "\nnameserver 1.1.1.1" >> /etc/resolv.conf
fi
if ! grep -q "8.8.8.8" /etc/resolv.conf ; then
echo -e "\nnameserver 8.8.8.8" >> /etc/resolv.conf
if [[ $PROVIDER == "Alibaba Cloud" ]] ; then
if ! grep -q "100.100.2.136" /etc/resolv.conf ; then
echo -e "\nnameserver 100.100.2.136" >> /etc/resolv.conf
fi
if ! grep -q "100.100.2.138" /etc/resolv.conf ; then
echo -e "\nnameserver 100.100.2.138" >> /etc/resolv.conf
fi
else
if ! grep -q "1.1.1.1" /etc/resolv.conf ; then
echo -e "\nnameserver 1.1.1.1" >> /etc/resolv.conf
fi
if ! grep -q "8.8.8.8" /etc/resolv.conf ; then
echo -e "\nnameserver 8.8.8.8" >> /etc/resolv.conf
fi
fi
cp /etc/resolv.conf /etc/resolv.conf-tmp
@@ -162,9 +171,11 @@ if [[ $PROVIDER == "Alibaba Cloud" ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
mkdir /root/.config/pip
cat << EOF > /root/.config/pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
index-url = https://pypi.python.org/simple/
[install]
trusted-host=pypi.python.org
EOF
echo -e "\nSet to Aliyun pip repo..."
echo -e "\nSet pip repo..."
fi
#seems Alibaba cloud , other than CN , also requires change on ubuntu.
@@ -203,7 +214,9 @@ gpgcheck = 1" > MariaDB.repo
mkdir /root/.config/pip
cat << EOF > /root/.config/pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
EOF
echo -e "\nSet to Aliyun pip repo..."
cat << EOF > composer.sh
@@ -248,12 +261,14 @@ EOF
if [[ $SERVER_OS == "Ubuntu" ]] ; then
echo $'\n89.208.248.38 rpms.litespeedtech.com\n' >> /etc/hosts
echo -e "Mirror server set..."
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set global.index-url https://pypi.python.org/simple/
mkdir /root/.config
mkdir /root/.config/pip
cat << EOF > /root/.config/pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
index-url = https://pypi.python.org/simple/
[install]
trusted-host=pypi.python.org
EOF
echo -e "\nSet to Aliyun pip repo..."
if [[ $PROVIDER == "Tencent Cloud" ]] ; then
@@ -549,6 +564,8 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
fi
if [[ $SERVER_OS == "Ubuntu" ]] ; then
systemctl stop redis-server
rm -f /var/run/redis/redis-server.pid
systemctl enable redis-server
systemctl start redis-server
fi
@@ -681,7 +698,7 @@ echo -e "\n This will install everything default , which is OpenLiteSpeed and no
license_input() {
VERSION="ENT"
echo -e "\nPlease note that your server has \e[31m$TOTAL_RAM\e[39m RAM"
echo -e "\nPlease note that your server has \e[31m$TOTAL_RAM MB\e[39m RAM"
echo -e "If you are using \e[31mFree Start\e[39m license, It will not start due to \e[31m2GB RAM limit\e[39m.\n"
echo -e "If you do not have any license, you can also use trial license (if server has not used trial license before), type \e[31mTRIAL\e[39m\n"
@@ -1101,6 +1118,16 @@ fi
if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt > /dev/null; then
if [[ $DEV == "ON" ]] ; then
if [[ $PROVIDER == "Alibaba Cloud" ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
cat << EOF > /root/.config/pip/pip.conf
[global]
index-url = https://pypi.python.org/simple/
[install]
trusted-host=pypi.python.org
EOF
fi
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
source /usr/local/CyberCP/bin/activate
wget -O requirements.txt https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt

View File

@@ -14,7 +14,6 @@ function getCookie(name) {
return cookieValue;
}
var fileManager = angular.module('fileManager', ['angularFileUpload']);
fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
@@ -1481,10 +1480,9 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.downloadFile = function () {
url = "/filemanager/downloadFile/";
url = "/filemanager/downloadFile";
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];
window.location.href = url + '?domainName=' + domainName + '?downloadURL=' + downloadURL;
window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL;
};

View File

@@ -84,8 +84,8 @@ def downloadFile(request):
userID = request.session['userID']
admin = Administrator.objects.get(pk=userID)
fileToDownload = '/home/cyberpanel.xyz/public_html/hello.txt'
domainName = 'cyberpanel.xyz'
fileToDownload = request.GET.get('fileToDownload')
domainName = request.GET.get('domainName')
currentACL = ACLManager.loadedACL(userID)
@@ -94,8 +94,6 @@ def downloadFile(request):
else:
return ACLManager.loadErrorJson('permissionsChanged', 0)
logging.CyberCPLogFileWriter.writeToFile('test')
response = HttpResponse(content_type='application/force-download')
response['Content-Disposition'] = 'attachment; filename=%s' % (fileToDownload.split('/')[-1])
response['X-LiteSpeed-Location'] = '%s' % (fileToDownload)

View File

@@ -11,7 +11,6 @@ from plogical import hashPassword
from plogical.acl import ACLManager
from packages.models import Package
from baseTemplate.models import version
from CLManager.models import CLPackages
if not os.geteuid() == 0:
sys.exit("\nOnly root can run this script\n")