From 7663b763f9af0428eaad92341b0697f4d128c3c3 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Thu, 12 Nov 2020 05:49:36 +0530 Subject: [PATCH] OpenVPN: Create user group "vpn" A user in this user group will be able to download and use an .ovpn profile to connect to the OpenVPN server on the FreedomBox. Signed-off-by: Joseph Nuthalapati Reviewed-by: James Valleroy --- plinth/modules/openvpn/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plinth/modules/openvpn/__init__.py b/plinth/modules/openvpn/__init__.py index 0fd211e89..237fec2ce 100644 --- a/plinth/modules/openvpn/__init__.py +++ b/plinth/modules/openvpn/__init__.py @@ -13,6 +13,7 @@ from plinth import app as app_module from plinth import cfg, frontpage, menu from plinth.daemon import Daemon from plinth.modules.firewall.components import Firewall +from plinth.modules.users.components import UsersAndGroups from plinth.utils import format_lazy from .manifest import backup, clients # noqa, pylint: disable=unused-import @@ -52,6 +53,9 @@ class OpenVPNApp(app_module.App): def __init__(self): """Create components for the app.""" super().__init__() + + self.groups = {'vpn': _('Connect to VPN services')} + info = app_module.Info(app_id=self.app_id, version=version, name=_('OpenVPN'), icon_filename='openvpn', short_description=_('Virtual Private Network'), @@ -83,6 +87,10 @@ class OpenVPNApp(app_module.App): listen_ports=[(1194, 'udp4'), (1194, 'udp6')]) self.add(daemon) + users_and_groups = UsersAndGroups('users-and-groups-openvpn', + groups=self.groups) + self.add(users_and_groups) + def is_enabled(self): """Return whether all the leader components are enabled.