overleaf-registration/container_to_container/tools/create_account.py

15 lines
548 B
Python
Raw Normal View History

2024-07-17 11:59:31 +02:00
import subprocess
def create_account(email: str = "davrot@uni-bremen.de", container_name: str = "overleafserver"):
work_string: str = f"cd /overleaf/services/web && node modules/server-ce-scripts/scripts/create-user --email={email}"
result = subprocess.run(["docker", "exec", container_name, "/bin/bash", "-ce", work_string ], capture_output=True, text=True)
success: bool = False
for i in result.stdout.splitlines():
if i.startswith(f"Successfully created {email} as a"):
success = True
return success