[Unit]
Description=AITBC OpenClaw Enhanced Service (Port 8007)
Documentation=https://docs.aitbc.bubuit.net
After=network.target aitbc-coordinator-api.service
Wants=aitbc-coordinator-api.service

[Service]
Type=simple
User=aitbc
Group=aitbc
WorkingDirectory=/opt/aitbc/apps/coordinator-api
Environment=PYTHONPATH=/opt/aitbc/apps/coordinator-api/src
Environment=PORT=8007
Environment=SERVICE_TYPE=openclaw-enhanced
Environment=EDGE_COMPUTING_ENABLED=true
Environment=AGENT_ORCHESTRATION_ENABLED=true
Environment=LOG_LEVEL=INFO
ExecStart=/opt/aitbc/.venv/bin/python -m aitbc_openclaw_enhanced.main
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=aitbc-openclaw-enhanced

# Security settings
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/aitbc/logs /opt/aitbc/data
LimitNOFILE=65536

# Resource limits
MemoryMax=2G
CPUQuota=200%

[Install]
WantedBy=multi-user.target
