adding some tools to assist in borg servers
This commit is contained in:
17
tools/borg-restricted.py
Executable file
17
tools/borg-restricted.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import pwd
|
||||
import subprocess
|
||||
|
||||
|
||||
cur_user = os.geteuid()
|
||||
homedir = pwd.getpwuid(cur_user).pw_dir
|
||||
|
||||
borg_bin = '/usr/bin/borg'
|
||||
|
||||
os.chdir(homedir)
|
||||
subprocess.run([borg_bin,
|
||||
'serve',
|
||||
'--restrict-to-path',
|
||||
homedir])
|
||||
Reference in New Issue
Block a user