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:
@@ -36,7 +36,7 @@ DEFAULT_REGION = "us-east-1"
|
||||
# todo: Add doc for the configuration of image, security group and network interface
|
||||
# todo: public the AMI images
|
||||
IMAGE_ID_MAP = {
|
||||
"us-east-1": "ami-0cae20d2680c939d4",
|
||||
"us-east-1": "ami-0a6a55a75d04c8888",
|
||||
"ap-east-1": "ami-0c092a5b8be4116f5",
|
||||
}
|
||||
|
||||
|
||||
@@ -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