add dkim keys to dns records during fetch

This commit is contained in:
Usman Nasir
2020-05-10 02:20:10 +05:00
parent 157da73ae2
commit b82360f01b
4 changed files with 22 additions and 16 deletions

View File

@@ -7,15 +7,13 @@
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2>{% trans "Terminal" %} - <a target="_blank" href="https://cyberpanel.net/docs/web-terminal/"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Web Terminal Docs" %}</span></a></h2>
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Web Terminal Docs" %}</span></a></h2>
<p>{% trans "Execute your terminal commands." %}</p>
</div>
@@ -50,5 +48,4 @@
</div>
{% endblock %}

View File

@@ -617,6 +617,8 @@ class MailServerManager:
command = "sudo cat " + path
privateKey = ProcessUtilities.outputExecutioner(command, 'opendkim')
DNS.createDKIMRecords(domainName)
data_ret = {'status': 1, 'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[leftIndex:rightIndex],
'privateKey': privateKey, 'dkimSuccessMessage': 'Keys successfully fetched!',
'error_message': "None"}

View File

@@ -474,6 +474,8 @@ class DNS:
leftIndex = output.index('(') + 2
rightIndex = output.rindex(')') - 1
if Records.objects.filter(domainOwner=zone, name="default._domainkey." + topLevelDomain).count() == 0:
record = Records(domainOwner=zone,
domain_id=zone.id,
name="default._domainkey." + topLevelDomain,
@@ -489,6 +491,10 @@ class DNS:
command = ' systemctl restart pdns'
ProcessUtilities.executioner(command)
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
command = ' systemctl restart pdns'
ProcessUtilities.executioner(command)
## Add record to CF If sync enabled
dns = DNS()

View File

@@ -6805,4 +6805,5 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
};
});
/* Java script code to git tracking ends here */