mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
infinoted: Fix permissions of sync directory
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
435b028d17
commit
4f6d987ef4
@ -16,9 +16,10 @@ from plinth import action_utils
|
|||||||
|
|
||||||
DATA_DIR = '/var/lib/infinoted'
|
DATA_DIR = '/var/lib/infinoted'
|
||||||
KEY_DIR = '/etc/infinoted'
|
KEY_DIR = '/etc/infinoted'
|
||||||
|
SYNC_DIR = os.path.join(DATA_DIR, 'sync')
|
||||||
|
|
||||||
CONF_PATH = '/etc/xdg/infinoted.conf'
|
CONF_PATH = '/etc/xdg/infinoted.conf'
|
||||||
CONF = '''
|
CONF = f'''
|
||||||
[infinoted]
|
[infinoted]
|
||||||
|
|
||||||
# Possible values : no-tls, allow-tls, require-tls
|
# Possible values : no-tls, allow-tls, require-tls
|
||||||
@ -48,7 +49,7 @@ interval=60
|
|||||||
[directory-sync]
|
[directory-sync]
|
||||||
|
|
||||||
# Directory to sync plain text files
|
# Directory to sync plain text files
|
||||||
directory=/var/lib/infinoted/sync
|
directory={SYNC_DIR}
|
||||||
|
|
||||||
# Synchronize seconds
|
# Synchronize seconds
|
||||||
interval=60
|
interval=60
|
||||||
@ -153,13 +154,10 @@ def subcommand_setup(_):
|
|||||||
'infinoted'
|
'infinoted'
|
||||||
], check=True)
|
], check=True)
|
||||||
|
|
||||||
if not os.path.exists(DATA_DIR):
|
for directory in (DATA_DIR, KEY_DIR, SYNC_DIR):
|
||||||
os.makedirs(DATA_DIR, mode=0o750)
|
if not os.path.exists(directory):
|
||||||
shutil.chown(DATA_DIR, user='infinoted', group='infinoted')
|
os.makedirs(directory, mode=0o750)
|
||||||
|
shutil.chown(directory, user='infinoted', group='infinoted')
|
||||||
if not os.path.exists(KEY_DIR):
|
|
||||||
os.makedirs(KEY_DIR, mode=0o750)
|
|
||||||
shutil.chown(KEY_DIR, user='infinoted', group='infinoted')
|
|
||||||
|
|
||||||
if not os.path.exists(KEY_DIR + '/infinoted-cert.pem'):
|
if not os.path.exists(KEY_DIR + '/infinoted-cert.pem'):
|
||||||
old_umask = os.umask(0o027)
|
old_umask = os.umask(0o027)
|
||||||
|
|||||||
@ -15,7 +15,7 @@ from plinth.utils import format_lazy
|
|||||||
|
|
||||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||||
|
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
managed_services = ['infinoted']
|
managed_services = ['infinoted']
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user