diff --git a/cyberpanel.sh b/cyberpanel.sh index 3a3e2cbe4..8212d57df 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -349,6 +349,10 @@ elif [[ -d /etc/httpd/conf/plesk.conf.d/ ]] || [[ -d /etc/apache2/plesk.conf.d/ echo -e "\nPlesk detected...\n" Debug_Log2 "Plesk detected...exit... [404]" exit +elif [[ -d /usr/local/panel/ ]]; then + echo -e "\nOpenPanel detected...\n" + Debug_Log2 "OpenPanel detected...exit... [404]" + exit fi } diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index ae2720ae1..702b61e57 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -495,8 +495,13 @@ if [ "$Server_OS" = "Ubuntu" ]; then pip3 install --default-timeout=3600 virtualenv==16.7.9 Check_Return else - pip3.6 install --default-timeout=3600 virtualenv==16.7.9 - Check_Return + if [ -e /usr/bin/pip3 ]; then + PIP3="/usr/bin/pip3" + else + PIP3="pip3.6" + fi + $PIP3 install --default-timeout=3600 virtualenv==16.7.9 + Check_Return fi if [[ -f /usr/local/CyberPanel/bin/python2 ]]; then @@ -518,9 +523,9 @@ fi Download_Requirement if [[ "$Server_OS" = "CentOS" ]] ; then - pip3.6 install --default-timeout=3600 virtualenv==16.7.9 + $PIP3 install --default-timeout=3600 virtualenv==16.7.9 Check_Return - pip3.6 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt + $PIP3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt Check_Return elif [[ "$Server_OS" = "Ubuntu" ]] ; then # shellcheck disable=SC1091 @@ -613,7 +618,7 @@ else # shellcheck disable=SC1091 source /usr/local/CyberCP/bin/activate Check_Return - pip3.6 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt + $PIP3 install --default-timeout=3600 --ignore-installed -r /usr/local/requirments.txt Check_Return fi diff --git a/dns/dnsManager.py b/dns/dnsManager.py index 9f19b7e5d..aa9d5645b 100755 --- a/dns/dnsManager.py +++ b/dns/dnsManager.py @@ -223,6 +223,8 @@ class DNSManager: fetchType = 'AAAA' elif currentSelection == 'cNameRecord': fetchType = 'CNAME' + elif currentSelection == 'httpsRecord': + fetchType = 'HTTPS' elif currentSelection == 'mxRecord': fetchType = 'MX' elif currentSelection == 'txtRecord': @@ -355,7 +357,21 @@ class DNSManager: recordContentCNAME = data['recordContentCNAME'] ## IP or pointing value DNS.createDNSRecord(zone, value, recordType, recordContentCNAME, 0, ttl) + + elif recordType == "HTTPS": + if recordName == "@": + value = zoneDomain + ## re.match + elif match(r'([1-9][0-9]{0,5})\s([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?\s?(alpn=[\da-z,-]+)?\s?(ipv4hint=[\d.,]+)?\s?(ipv6hint=[\da-zA-Z:,]+)?', recordName, + M | I): + value = recordName + else: + value = recordName + "." + zoneDomain + + recordContentHTTPS = data['recordContentHTTPS'] ## ## valid value with priority, cname link or domain and alpn and ipv4, ipv6 hints + + DNS.createDNSRecord(zone, value, recordType, recordContentHTTPS, 0, ttl) elif recordType == "SPF": if recordName == "@": @@ -743,6 +759,8 @@ class DNSManager: fetchType = 'AAAA' elif currentSelection == 'cNameRecord': fetchType = 'CNAME' + elif currentSelection == 'httpsRecord': + fetchType = 'HTTPS' elif currentSelection == 'mxRecord': fetchType = 'MX' elif currentSelection == 'txtRecord': @@ -949,6 +967,21 @@ class DNSManager: DNS.createDNSRecordCloudFlare(cf, zone, value, recordType, recordContentCNAME, 0, ttl) + elif recordType == "HTTPS": + + if recordName == "@": + value = zoneDomain + ## re.match + elif match(r'([1-9][0-9]{0,5})\s([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?\s?(alpn=[\da-z,-]+)?\s?(ipv4hint=[\d.,]+)?\s?(ipv6hint=[\da-zA-Z:,]+)?', recordName, + M | I): + value = recordName + else: + value = recordName + "." + zoneDomain + + recordContentHTTPS = data['recordContentHTTPS'] ## valid value with priority, cname link or domain and alpn and ipv4, ipv6 hints + + DNS.createDNSRecordCloudFlare(cf, zone, value, recordType, recordContentHTTPS, 0, ttl) + elif recordType == "SPF": if recordName == "@": @@ -1396,4 +1429,4 @@ def main(): ftp.ResetDNSConfigurations() if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/dns/static/dns/dns.js b/dns/static/dns/dns.js index 18cc88645..78199a580 100755 --- a/dns/static/dns/dns.js +++ b/dns/static/dns/dns.js @@ -170,6 +170,7 @@ app.controller('addModifyDNSRecords', function ($scope, $http) { // Hide records boxes $(".aaaaRecord").hide(); $(".cNameRecord").hide(); + $(".httpsRecord").hide(); $(".mxRecord").hide(); $(".txtRecord").hide(); $(".spfRecord").hide(); @@ -239,6 +240,12 @@ app.controller('addModifyDNSRecords', function ($scope, $http) { data.recordContentCNAME = $scope.recordContentCNAME; data.ttl = $scope.ttl; data.recordType = type; + } else if (type === "HTTPS") { + data.selectedZone = $scope.selectedZone; + data.recordName = $scope.recordName; + data.recordContentHTTPS = $scope.recordContentHTTPS; + data.ttl = $scope.ttl; + data.recordType = type; } else if (type === "SPF") { data.selectedZone = $scope.selectedZone; data.recordName = $scope.recordName; @@ -815,6 +822,7 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window // Hide records boxes $(".aaaaRecord").hide(); $(".cNameRecord").hide(); + $(".httpsRecord").hide(); $(".mxRecord").hide(); $(".txtRecord").hide(); $(".spfRecord").hide(); @@ -883,6 +891,12 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window data.recordContentCNAME = $scope.recordContentCNAME; data.ttl = $scope.ttl; data.recordType = type; + } else if (type === "HTTPS") { + data.selectedZone = $scope.selectedZone; + data.recordName = $scope.recordName; + data.recordContentHTTPS = $scope.recordContentHTTPS; + data.ttl = $scope.ttl; + data.recordType = type; } else if (type === "SPF") { data.selectedZone = $scope.selectedZone; data.recordName = $scope.recordName; @@ -1308,4 +1322,4 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window }); -/* Java script code for CloudFlare */ \ No newline at end of file +/* Java script code for CloudFlare */ diff --git a/dns/templates/dns/addDeleteDNSRecords.html b/dns/templates/dns/addDeleteDNSRecords.html index 6fde8f740..5a442d82c 100755 --- a/dns/templates/dns/addDeleteDNSRecords.html +++ b/dns/templates/dns/addDeleteDNSRecords.html @@ -64,6 +64,8 @@ href="">AAAA
  • CNAME
  • +
  • HTTPS
  • MX
  • TXT
  • @@ -158,6 +160,32 @@ + + + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + +
    + + + @@ -187,7 +215,7 @@ class="btn btn-primary">{% trans "Add" %} - + diff --git a/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html b/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html index e4f7ea335..1489d5eac 100755 --- a/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html +++ b/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html @@ -137,6 +137,9 @@
  • CNAME
  • +
  • HTTPS +
  • MX
  • @@ -254,6 +257,32 @@ + + + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + +
    + + + @@ -288,7 +317,7 @@ class="btn btn-primary">{% trans "Add" %} - + diff --git a/static/dns/dns.js b/static/dns/dns.js index 18cc88645..78199a580 100644 --- a/static/dns/dns.js +++ b/static/dns/dns.js @@ -170,6 +170,7 @@ app.controller('addModifyDNSRecords', function ($scope, $http) { // Hide records boxes $(".aaaaRecord").hide(); $(".cNameRecord").hide(); + $(".httpsRecord").hide(); $(".mxRecord").hide(); $(".txtRecord").hide(); $(".spfRecord").hide(); @@ -239,6 +240,12 @@ app.controller('addModifyDNSRecords', function ($scope, $http) { data.recordContentCNAME = $scope.recordContentCNAME; data.ttl = $scope.ttl; data.recordType = type; + } else if (type === "HTTPS") { + data.selectedZone = $scope.selectedZone; + data.recordName = $scope.recordName; + data.recordContentHTTPS = $scope.recordContentHTTPS; + data.ttl = $scope.ttl; + data.recordType = type; } else if (type === "SPF") { data.selectedZone = $scope.selectedZone; data.recordName = $scope.recordName; @@ -815,6 +822,7 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window // Hide records boxes $(".aaaaRecord").hide(); $(".cNameRecord").hide(); + $(".httpsRecord").hide(); $(".mxRecord").hide(); $(".txtRecord").hide(); $(".spfRecord").hide(); @@ -883,6 +891,12 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window data.recordContentCNAME = $scope.recordContentCNAME; data.ttl = $scope.ttl; data.recordType = type; + } else if (type === "HTTPS") { + data.selectedZone = $scope.selectedZone; + data.recordName = $scope.recordName; + data.recordContentHTTPS = $scope.recordContentHTTPS; + data.ttl = $scope.ttl; + data.recordType = type; } else if (type === "SPF") { data.selectedZone = $scope.selectedZone; data.recordName = $scope.recordName; @@ -1308,4 +1322,4 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window }); -/* Java script code for CloudFlare */ \ No newline at end of file +/* Java script code for CloudFlare */