From b137ec55d88c353a8a0e50b1170ae2d20f76e127 Mon Sep 17 00:00:00 2001 From: dev-polymer <161867770+dev-polymer@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:10:07 +0300 Subject: [PATCH 1/5] Updated static/dns/dns.js --- static/dns/dns.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 */ From c1abdc5b6b677fbfeaeeae7867502da9f8bd36e6 Mon Sep 17 00:00:00 2001 From: dev-polymer <161867770+dev-polymer@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:15:18 +0300 Subject: [PATCH 2/5] Updated dns/static/dns/dns.js --- dns/static/dns/dns.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 */ From 152e56d2ec13be8e929ff55c5eeba70c0afed25a Mon Sep 17 00:00:00 2001 From: dev-polymer <161867770+dev-polymer@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:55:51 +0300 Subject: [PATCH 3/5] Updated dns/dnsManager.py --- dns/dnsManager.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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() From 1b593a47b50455a0ba19adee576d4d3cc6185ba2 Mon Sep 17 00:00:00 2001 From: dev-polymer <161867770+dev-polymer@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:06:55 +0300 Subject: [PATCH 4/5] Updated dns/templates/dns/addDeleteDNSRecords.html --- dns/templates/dns/addDeleteDNSRecords.html | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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" %} - + From 7c8c0a34909306403a8a351be0871dd394c5ee78 Mon Sep 17 00:00:00 2001 From: dev-polymer <161867770+dev-polymer@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:13:37 +0300 Subject: [PATCH 5/5] Updated dns/templates/dns/addDeleteDNSRecordsCloudFlare.html --- .../dns/addDeleteDNSRecordsCloudFlare.html | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) 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" %} - +