Sunil Mohan Adapa 4aa8e6da09
firewall: Use service files for showing port forwarding info
- Start showing port ranges properly.

- Fixes issue with Coturn TURN relay ports not being shown.

Closes: #1851.

Tests:

- Visit each of affected apps and see the port forwarding information. The
information is same as before.

- HTTP and HTTPS ports are not shown.

- Coturn app shows additional port ranges for TURN relay ports.

- Shadowsocks app does not show port forwarding information as it is internal
only.

- Visit one of the apps not effected by the patch. There is no section related
to port forwarding.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-09-04 16:31:52 +03:00

30 lines
894 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth.modules.mumble.forms import MumbleForm
from plinth.views import AppView
class MumbleAppView(AppView):
app_id = 'mumble'
form_class = MumbleForm
def form_valid(self, form):
"""Apply new superuser password if it exists"""
new_config = form.cleaned_data
password = new_config.get('super_user_password')
if password:
actions.run_as_user(
'mumble',
['create-password'],
input=password.encode(),
become_user="mumble-server",
)
messages.success(self.request,
_('SuperUser password successfully updated.'))
return super().form_valid(form)