mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
syncthing: Run service as system user 'syncthing'
- Enabled Apache LDAP authentication for Syncthing.
This commit is contained in:
parent
53645deebf
commit
a5147cfe16
@ -39,6 +39,12 @@ def parse_arguments():
|
|||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def subcommand_pre_setup(_):
|
||||||
|
"""Actions to be performed before installing Syncthing"""
|
||||||
|
subprocess.check_call(
|
||||||
|
['adduser', '--system', '--disabled-login', 'syncthing'])
|
||||||
|
|
||||||
|
|
||||||
def subcommand_setup(_):
|
def subcommand_setup(_):
|
||||||
"""Setup Syncthing configuration."""
|
"""Setup Syncthing configuration."""
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
@ -49,12 +55,13 @@ def subcommand_setup(_):
|
|||||||
|
|
||||||
def service_enable():
|
def service_enable():
|
||||||
"""Start the Syncthing service as plinth user"""
|
"""Start the Syncthing service as plinth user"""
|
||||||
subprocess.check_call(['systemctl', 'start', 'syncthing@plinth.service'])
|
subprocess.check_call(
|
||||||
|
['systemctl', 'start', 'syncthing@syncthing.service'])
|
||||||
|
|
||||||
|
|
||||||
def service_disable():
|
def service_disable():
|
||||||
"""Stop the Syncthing service as plinth user"""
|
"""Stop the Syncthing service as plinth user"""
|
||||||
subprocess.check_call(['systemctl', 'stop', 'syncthing@plinth.service'])
|
subprocess.check_call(['systemctl', 'stop', 'syncthing@syncthing.service'])
|
||||||
|
|
||||||
|
|
||||||
def subcommand_enable(_):
|
def subcommand_enable(_):
|
||||||
|
|||||||
@ -1,5 +1,14 @@
|
|||||||
ProxyPass /syncthing/ http://localhost:8384/
|
ProxyPass /syncthing/ http://localhost:8384/
|
||||||
|
|
||||||
<Location /syncthing/>
|
<Location /syncthing/>
|
||||||
ProxyPassReverse http://localhost:8384/
|
ProxyPassReverse http://localhost:8384/
|
||||||
Require all granted
|
AuthType basic
|
||||||
</Location>
|
AuthName "FreedomBox Login"
|
||||||
|
AuthBasicProvider ldap
|
||||||
|
AuthLDAPUrl "ldap:///ou=users,dc=thisbox?uid"
|
||||||
|
AuthLDAPGroupAttribute memberUid
|
||||||
|
AuthLDAPGroupAttributeIsDN off
|
||||||
|
Require valid-user
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,7 @@ def init():
|
|||||||
|
|
||||||
def setup(helper, old_version=None):
|
def setup(helper, old_version=None):
|
||||||
"""Install and configure the module."""
|
"""Install and configure the module."""
|
||||||
|
helper.call('pre', actions.superuser_run, 'syncthing', ['pre-setup'])
|
||||||
helper.install(managed_packages)
|
helper.install(managed_packages)
|
||||||
helper.call('post', actions.superuser_run, 'syncthing', ['setup'])
|
helper.call('post', actions.superuser_run, 'syncthing', ['setup'])
|
||||||
global service
|
global service
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user