Merge pull request #1234 from dev-polymer/allow-dns-https-record

Allow DNS https record
This commit is contained in:
Usman Nasir
2024-03-26 18:09:34 +05:00
committed by GitHub
7 changed files with 137 additions and 10 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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()
main()

View File

@@ -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 */
/* Java script code for CloudFlare */

View File

@@ -64,6 +64,8 @@
href="">AAAA</a></li>
<li ng-click="fetchRecordsTabs('cNameRecord')" id="cNameRecord"><a
href="">CNAME</a></li>
<li ng-click="fetchRecordsTabs('httpsRecord')" id="httpsRecord"><a
href="">HTTPS</a></li>
<li ng-click="fetchRecordsTabs('mxRecord')" id="mxRecord"><a href="">MX</a></li>
<li ng-click="fetchRecordsTabs('txtRecord')" id="txtRecord"><a href="">TXT</a>
</li>
@@ -158,6 +160,32 @@
<!------------- CNAME Record box ------------->
<!------------- HTTPS Record box ------------->
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
ng-model="recordName" required>
</div>
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'Text' %}" type="text" class="form-control"
ng-model="recordContentHTTPS" required>
</div>
<div class="col-sm-3 httpsRecord">
<button style="width: 100%;" type="button" ng-click="addDNSRecord('HTTPS')"
class="btn btn-primary">{% trans "Add" %}</button>
</div>
<!------------- HTTPS Record box ------------->
<!------------- MX Record box ------------->
@@ -187,7 +215,7 @@
class="btn btn-primary">{% trans "Add" %}</button>
</div>
<!------------- CNAME Record box ------------->
<!------------- MX Record box ------------->
<!------------- SPF Record box ------------->

View File

@@ -137,6 +137,9 @@
<li ng-click="fetchRecordsTabs('cNameRecord')"
id="cNameRecord"><a href="">CNAME</a>
</li>
<li ng-click="fetchRecordsTabs('httpsRecord')"
id="httpsRecord"><a href="">HTTPS</a>
</li>
<li ng-click="fetchRecordsTabs('mxRecord')"
id="mxRecord"><a href="">MX</a>
</li>
@@ -254,6 +257,32 @@
<!------------- CNAME Record box ------------->
<!------------- HTTPS Record box ------------->
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
ng-model="recordName" required>
</div>
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
<div class="col-sm-3 httpsRecord">
<input placeholder="{% trans 'Text' %}" type="text" class="form-control"
ng-model="recordContentHTTPS" required>
</div>
<div class="col-sm-3 httpsRecord">
<button style="width: 100%;" type="button" ng-click="addDNSRecord('HTTPS')"
class="btn btn-primary">{% trans "Add" %}</button>
</div>
<!------------- HTTPS Record box ------------->
<!------------- MX Record box ------------->
@@ -288,7 +317,7 @@
class="btn btn-primary">{% trans "Add" %}</button>
</div>
<!------------- CNAME Record box ------------->
<!------------- MX Record box ------------->
<!------------- SPF Record box ------------->

View File

@@ -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 */
/* Java script code for CloudFlare */