mirror of https://github.com/zulip/zulip.git
restore-backup: Ensure it is run as root.
This commit is contained in:
parent
a9183d2208
commit
c71c6187ea
|
@ -9,7 +9,7 @@ from typing import IO
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
sys.path.append(BASE_DIR)
|
sys.path.append(BASE_DIR)
|
||||||
from scripts.lib.zulip_tools import get_postgres_pwent, run, su_to_zulip
|
from scripts.lib.zulip_tools import assert_running_as_root, get_postgres_pwent, run, su_to_zulip
|
||||||
|
|
||||||
POSTGRES_PWENT = get_postgres_pwent()
|
POSTGRES_PWENT = get_postgres_pwent()
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ parser.add_argument("tarball", help="Filename of input tarball")
|
||||||
|
|
||||||
|
|
||||||
def restore_backup(tarball_file: IO[bytes]) -> None:
|
def restore_backup(tarball_file: IO[bytes]) -> None:
|
||||||
|
assert_running_as_root()
|
||||||
su_to_zulip(save_suid=True)
|
su_to_zulip(save_suid=True)
|
||||||
|
|
||||||
from scripts.lib.setup_path import setup_path
|
from scripts.lib.setup_path import setup_path
|
||||||
|
|
Loading…
Reference in New Issue