Merge branch 'stable' into qtwrkdev

This commit is contained in:
qtwrk 2020-03-08 02:22:25 +01:00 committed by GitHub
commit 74978fa8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 17 deletions

BIN
.DS_Store vendored

Binary file not shown.

42
install.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh
if [ -f "/etc/os-release" ]; then
. /etc/os-release
else
ID="unsupported"
PRETTY_NAME="Your OS does not have a /etc/os-release file"
fi
if [ "$ID" = "ubuntu" ] && [ "$UBUNTU_CODENAME" = "bionic" ]; then
export DEBIAN_FRONTEND=noninteractive
apt -q -y -o Dpkg::Options::=--force-confnew update
apt -q -y -o Dpkg::Options::=--force-confnew install wget curl
SERVER_OS="Ubuntu"
elif [ "$ID" = "centos" ] || [ "$ID" = "cloudlinux" ]; then
case "$VERSION_ID" in
7|7.*)
yum install curl wget -y 1> /dev/null
yum update curl wget ca-certificates -y 1> /dev/null
if [ "$ID" = "centos" ]; then
SERVER_OS="CentOS"
else
SERVER_OS="CloudLinux"
fi
;;
8|8.*)
printf >&2 '\nCentOS 8/CloudLinux 8 support is currently experimental!\n'
yum install curl wget -y 1> /dev/null
yum update curl wget ca-certificates -y 1> /dev/null
SERVER_OS="CentOS8"
;;
esac
else
printf >&2 '\nYour OS -- %s -- is not currently supported!\n' "$PRETTY_NAME"
printf >&2 '\nCyberPanel is currently supported on Ubuntu 18.04, CentOS 7 and CloudLinux 7.\n'
exit 1
fi
rm -f cyberpanel.sh install.tar.gz
curl --silent -o cyberpanel.sh "https://cyberpanel.sh/?dl&${SERVER_OS}" 2>/dev/null
chmod +x cyberpanel.sh
./cyberpanel.sh "$@"

View File

@ -61,4 +61,5 @@ urllib3==1.22
websocket-client==0.56.0
zope.component==4.4.1
zope.event==4.3.0
zope.interface==4.5.0
zope.interface==4.5.0
validators==0.14.2

View File

@ -1,2 +1,2 @@
test4
test3
test3

View File

@ -180,14 +180,12 @@ class WebsiteManager:
return ACLManager.loadErrorJson('createWebSiteStatus', 0)
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', domain,
M | I):
if not validators.domain(domain):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
if not match(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b', adminEmail,
M | I):
if not validators.email(adminEmail):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid email."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@ -250,8 +248,7 @@ class WebsiteManager:
path = data['path']
tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999))
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', domain,
M | I):
if not validators.domain(domain):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@ -1593,8 +1590,7 @@ class WebsiteManager:
aliasDomain = data['aliasDomain']
ssl = data['ssl']
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', aliasDomain,
M | I):
if not validators.domain(aliasDomain):
data_ret = {'status': 0, 'createAliasStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@ -2683,14 +2679,12 @@ StrictHostKeyChecking no
self.domain = data['masterDomain']
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', self.domain,
M | I):
if not validators.domain(self.domain):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', data['domainName'],
M | I):
if not validators.domain(data['domainName']):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@ -2756,8 +2750,7 @@ StrictHostKeyChecking no
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if not match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', data['childDomain'],
M | I):
if not validators.domain(data['childDomain']):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@ -2828,4 +2821,4 @@ StrictHostKeyChecking no
except BaseException as msg:
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
return HttpResponse(json_data)