mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
email: Rename audit module to privileged
The module does not interact with kernel audit system or is not related to security logging. The 'privileged' makes us pay more attension. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
37b28e05d7
commit
1b5e99c56e
12 files changed
+17
-17
No files matched your search
@@ -19,7 +19,7 @@ from plinth.modules.letsencrypt.components import LetsEncrypt
|
||||
from plinth.package import Packages, remove
|
||||
from plinth.signals import domain_added, domain_removed
|
||||
|
||||
from . import audit, manifest
|
||||
from . import manifest, privileged
|
||||
|
||||
_description = [
|
||||
_('This is a complete email server solution using Postfix, Dovecot, '
|
||||
@@ -176,12 +176,12 @@ def setup(helper, old_version=None):
|
||||
app.setup(old_version)
|
||||
|
||||
# Setup
|
||||
helper.call('post', audit.home.repair)
|
||||
helper.call('post', privileged.home.repair)
|
||||
app.get_component('letsencrypt-email-postfix').setup_certificates()
|
||||
app.get_component('letsencrypt-email-dovecot').setup_certificates()
|
||||
helper.call('post', audit.domain.set_domains)
|
||||
helper.call('post', audit.ldap.repair)
|
||||
helper.call('post', audit.spam.repair)
|
||||
helper.call('post', privileged.domain.set_domains)
|
||||
helper.call('post', privileged.ldap.repair)
|
||||
helper.call('post', privileged.spam.repair)
|
||||
|
||||
# Reload
|
||||
actions.superuser_run('service', ['reload', 'postfix'])
|
||||
@@ -198,7 +198,7 @@ def on_domain_added(sender, domain_type, name, description='', services=None,
|
||||
if app.needs_setup():
|
||||
return
|
||||
|
||||
audit.domain.set_domains()
|
||||
privileged.domain.set_domains()
|
||||
|
||||
|
||||
def on_domain_removed(sender, domain_type, name='', **kwargs):
|
||||
@@ -206,4 +206,4 @@ def on_domain_removed(sender, domain_type, name='', **kwargs):
|
||||
if app.needs_setup():
|
||||
return
|
||||
|
||||
audit.domain.set_domains()
|
||||
privileged.domain.set_domains()
|
||||
@@ -37,9 +37,9 @@ class Entry: # pylint: disable=too-many-instance-attributes
|
||||
|
||||
def get_entries():
|
||||
"""Return the list of DNS entries to make."""
|
||||
from . import audit
|
||||
from . import privileged
|
||||
|
||||
domain = audit.domain.get_domains()['primary_domain']
|
||||
domain = privileged.domain.get_domains()['primary_domain']
|
||||
mx_spam_entries = [
|
||||
Entry(type_='MX', value=f'{domain}.'),
|
||||
Entry(type_='TXT', value='v=spf1 mx a ~all'),
|
||||
@@ -49,7 +49,7 @@ def get_entries():
|
||||
f'rua=mailto:postmaster@{domain}; ')
|
||||
]
|
||||
try:
|
||||
dkim_public_key = audit.dkim.get_public_key(domain)
|
||||
dkim_public_key = privileged.dkim.get_public_key(domain)
|
||||
dkim_entries = [
|
||||
Entry(domain='dkim._domainkey', type_='TXT',
|
||||
value=f'v=DKIM1; k=rsa; p={dkim_public_key}')
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -13,7 +13,7 @@ from plinth.modules.email import dns
|
||||
from plinth.views import AppView
|
||||
|
||||
from . import aliases as aliases_module
|
||||
from . import audit, forms
|
||||
from . import forms, privileged
|
||||
|
||||
|
||||
class EmailAppView(AppView):
|
||||
@@ -31,7 +31,7 @@ class EmailAppView(AppView):
|
||||
def get_initial(self):
|
||||
"""Return the initial values to populate in the form."""
|
||||
initial = super().get_initial()
|
||||
domains = audit.domain.get_domains()
|
||||
domains = privileged.domain.get_domains()
|
||||
initial['primary_domain'] = domains['primary_domain']
|
||||
return initial
|
||||
|
||||
@@ -41,7 +41,7 @@ class EmailAppView(AppView):
|
||||
new_data = form.cleaned_data
|
||||
if old_data['primary_domain'] != new_data['primary_domain']:
|
||||
try:
|
||||
audit.domain.set_domains(new_data['primary_domain'])
|
||||
privileged.domain.set_domains(new_data['primary_domain'])
|
||||
messages.success(self.request, _('Configuration updated'))
|
||||
except Exception:
|
||||
messages.error(self.request,
|
||||
|
||||
Reference in new issue
Block a user