From 5ec7f49c8b4f1a7f15d4eed21cd7df5035724163 Mon Sep 17 00:00:00 2001 From: Aakanksha Saini Date: Mon, 8 Jan 2018 16:11:53 +0530 Subject: [PATCH] syncthing: Restrict administration to users in group syncthing - Add syncthing group - Add validation in syncthing-plinth configuration * Tested on UI Signed-off-by: Aakanksha Saini Reviewed-by: Sunil Mohan Adapa --- data/etc/apache2/conf-available/syncthing-plinth.conf | 3 +++ plinth/modules/syncthing/__init__.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/data/etc/apache2/conf-available/syncthing-plinth.conf b/data/etc/apache2/conf-available/syncthing-plinth.conf index f9f5e1d51..d4c66d444 100644 --- a/data/etc/apache2/conf-available/syncthing-plinth.conf +++ b/data/etc/apache2/conf-available/syncthing-plinth.conf @@ -18,4 +18,7 @@ Include includes/freedombox-single-sign-on.conf ProxyPass http://localhost:8384/ + + TKTAuthToken "admin" "syncthing" + diff --git a/plinth/modules/syncthing/__init__.py b/plinth/modules/syncthing/__init__.py index b1aa02ce4..368307025 100644 --- a/plinth/modules/syncthing/__init__.py +++ b/plinth/modules/syncthing/__init__.py @@ -27,6 +27,7 @@ from plinth import cfg from plinth import frontpage from plinth import service as service_module from plinth.menu import main_menu +from plinth.modules.users import register_group from plinth.utils import format_lazy from .manifest import clients @@ -61,6 +62,8 @@ description = [ clients = clients +group = ('syncthing', _('Administer Syncthing application')) + service = None @@ -69,6 +72,7 @@ def init(): menu = main_menu.get('apps') menu.add_urlname(name, 'glyphicon-refresh', 'syncthing:index', short_description) + register_group(group) global service setup_helper = globals()['setup_helper']