mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
syncthing: add to freedombox-share group
Closes: #1808 Test performed: - Install samba in development VM and create open share (owned from root:freedombox-share). - install syncthing and create syncronization folder in the above openshare. - Sync files from desktop peer to development VM one on the above folder. Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
1b3359faf7
commit
4187a19c34
@ -12,11 +12,12 @@ from plinth.daemon import Daemon
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users.components import UsersAndGroups
|
||||
from plinth.modules.users import add_user_to_share_group
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 2
|
||||
version = 3
|
||||
|
||||
managed_services = ['syncthing@syncthing']
|
||||
|
||||
@ -38,6 +39,8 @@ _description = [
|
||||
box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
SYSTEM_USER = 'syncthing'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -87,8 +90,8 @@ class SyncthingApp(app_module.App):
|
||||
daemon = Daemon('daemon-syncthing', managed_services[0])
|
||||
self.add(daemon)
|
||||
|
||||
users_and_groups = UsersAndGroups('users-and-groups-syncthing',
|
||||
groups=self.groups)
|
||||
users_and_groups = UsersAndGroups(
|
||||
'users-and-groups-syncthing', [SYSTEM_USER], self.groups)
|
||||
self.add(users_and_groups)
|
||||
|
||||
|
||||
@ -111,3 +114,5 @@ def setup(helper, old_version=None):
|
||||
|
||||
if old_version == 1 and app.is_enabled():
|
||||
app.get_component('firewall-syncthing-ports').enable()
|
||||
|
||||
add_user_to_share_group(SYSTEM_USER, managed_services[0])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user