Skip to content

Commit b82360f

Browse files
committed
add dkim keys to dns records during fetch
1 parent 157da73 commit b82360f

4 files changed

Lines changed: 22 additions & 16 deletions

File tree

WebTerminal/templates/WebTerminal/WebTerminal.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
{% get_current_language as LANGUAGE_CODE %}
88
<!-- Current language: {{ LANGUAGE_CODE }} -->
99

10-
11-
12-
1310
<div class="container">
1411

1512
<div id="page-title">
1613
<h2>{% trans "Terminal" %} - <a target="_blank" href="https://cyberpanel.net/docs/web-terminal/"
17-
style="height: 23px;line-height: 21px;"
18-
class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Web Terminal Docs" %}</span></a></h2>
14+
style="height: 23px;line-height: 21px;"
15+
class="btn btn-border btn-alt border-red btn-link font-red"
16+
title=""><span>{% trans "Web Terminal Docs" %}</span></a></h2>
1917
<p>{% trans "Execute your terminal commands." %}</p>
2018
</div>
2119

@@ -50,5 +48,4 @@ <h3 class="content-box-header">
5048

5149
</div>
5250

53-
5451
{% endblock %}

mailServer/mailserverManager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ def fetchDKIMKeys(self):
617617
command = "sudo cat " + path
618618
privateKey = ProcessUtilities.outputExecutioner(command, 'opendkim')
619619

620+
DNS.createDKIMRecords(domainName)
621+
620622
data_ret = {'status': 1, 'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[leftIndex:rightIndex],
621623
'privateKey': privateKey, 'dkimSuccessMessage': 'Keys successfully fetched!',
622624
'error_message': "None"}

plogical/dnsUtilities.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -474,16 +474,22 @@ def createDKIMRecords(domain):
474474
leftIndex = output.index('(') + 2
475475
rightIndex = output.rindex(')') - 1
476476

477-
record = Records(domainOwner=zone,
478-
domain_id=zone.id,
479-
name="default._domainkey." + topLevelDomain,
480-
type="TXT",
481-
content=output[leftIndex:rightIndex],
482-
ttl=3600,
483-
prio=0,
484-
disabled=0,
485-
auth=1)
486-
record.save()
477+
if Records.objects.filter(domainOwner=zone, name="default._domainkey." + topLevelDomain).count() == 0:
478+
479+
record = Records(domainOwner=zone,
480+
domain_id=zone.id,
481+
name="default._domainkey." + topLevelDomain,
482+
type="TXT",
483+
content=output[leftIndex:rightIndex],
484+
ttl=3600,
485+
prio=0,
486+
disabled=0,
487+
auth=1)
488+
record.save()
489+
490+
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
491+
command = ' systemctl restart pdns'
492+
ProcessUtilities.executioner(command)
487493

488494
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
489495
command = ' systemctl restart pdns'

websiteFunctions/static/websiteFunctions/websiteFunctions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6805,4 +6805,5 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
68056805
};
68066806

68076807
});
6808+
68086809
/* Java script code to git tracking ends here */

0 commit comments

Comments
 (0)