Update AWS AMI ID, enhance directory creation logic in file upload, modify osworld service configuration, and refine JSON evaluation examples for improved clarity and functionality.
This commit is contained in:
@@ -1161,7 +1161,9 @@ def upload_file():
|
||||
|
||||
try:
|
||||
# Ensure target directory exists
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
target_dir = os.path.dirname(file_path)
|
||||
if target_dir: # Only create directory if it's not empty
|
||||
os.makedirs(target_dir, exist_ok=True)
|
||||
|
||||
# Save file and get size for verification
|
||||
file.save(file_path)
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
[Unit]
|
||||
Description=OSWorld Server
|
||||
Description=osworld service
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=4
|
||||
After=network.target auditd.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/python3 /home/user/main.py
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python /home/user/server/main.py
|
||||
User=user
|
||||
WorkingDirectory=/home/user
|
||||
Environment="DISPLAY=:0"
|
||||
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
|
||||
Environment="XDG_RUNTIME_DIR=/run/user/1000"
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
Environment="DISPLAY=:1"
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user