summarylogtreecommitdiffstats
path: root/openjiuwen-sandbox-gateway.service
blob: 9595a650ced62a84e8e9d0e167a7364ef05fcba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[Unit]
Description=OpenJiuwen sandbox gateway (port 8188)
Documentation=https://gitcode.com/openJiuwen/agent-studio
After=network-online.target openjiuwen-sandbox.service
Wants=network-online.target

[Service]
Type=simple
User=openjiuwen
Group=openjiuwen
WorkingDirectory=/opt/openjiuwen-sandbox
Environment=PYTHONPATH=/opt/openjiuwen-sandbox/lib
Environment=HOST=127.0.0.1
Environment=PORT=8188
ExecStart=/usr/bin/python -m uvicorn openjiuwen_sandbox_gateway.server:app \
    --host ${HOST} --port ${PORT} \
    --app-dir /opt/openjiuwen-sandbox/lib
Restart=on-failure
RestartSec=5
TimeoutStopSec=20

NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/openjiuwen-sandbox /var/log/openjiuwen-sandbox
PrivateDevices=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
MemoryDenyWriteExecute=true

StandardOutput=journal
StandardError=journal
SyslogIdentifier=openjiuwen-sandbox-gateway

[Install]
WantedBy=multi-user.target