restore-backup: Run generate_secrets.py.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-02-18 18:57:14 -08:00 committed by Tim Abbott
parent 0d4bf86130
commit d918626135
1 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,13 @@ def restore_backup(tarball_file):
run(as_postgres + ["createdb", "-O", "zulip", "-T", "template0", "--", db_name])
if settings.PRODUCTION:
# In case we are restoring a backup from an older Zulip
# version, there may be new secrets to generate.
subprocess.check_call([
os.path.join(settings.DEPLOY_ROOT, "scripts", "setup", "generate_secrets.py"),
"--production",
])
# If there is a local rabbitmq, we need to reconfigure it
# to ensure the rabbitmq password matches the value in the
# restored zulip-secrets.conf. We need to be careful to