forked from agent0ai/agent-zero
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprepare.py
More file actions
21 lines (15 loc) · 603 Bytes
/
prepare.py
File metadata and controls
21 lines (15 loc) · 603 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from helpers import dotenv, runtime, settings
import string
import random
from helpers.print_style import PrintStyle
PrintStyle.standard("Preparing environment...")
try:
runtime.initialize()
# generate random root password if not set (for SSH)
root_pass = dotenv.get_dotenv_value(dotenv.KEY_ROOT_PASSWORD)
if not root_pass:
root_pass = "".join(random.choices(string.ascii_letters + string.digits, k=32))
PrintStyle.standard("Changing root password...")
settings.set_root_password(root_pass)
except Exception as e:
PrintStyle.error(f"Error in preload: {e}")