Introduce backend app for WebSocket terminal sessions and sandbox orchestration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b1df2607e
commit
91049379f7
22 files changed
+808
-11
No files matched your search
@@ -26,3 +26,28 @@ services:
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
|
||||
backend:
|
||||
image: ${BACKEND_IMAGE:?run deploy.sh}
|
||||
restart: unless-stopped
|
||||
user: "10002:10002"
|
||||
group_add:
|
||||
- "10100"
|
||||
read_only: true
|
||||
cap_drop: [ALL]
|
||||
security_opt: [no-new-privileges:true]
|
||||
mem_limit: 256m
|
||||
pids_limit: 128
|
||||
depends_on: [spawner]
|
||||
ports:
|
||||
- "127.0.0.1:${BACKEND_PORT:-8380}:8080"
|
||||
environment:
|
||||
SPAWNER_SOCKET: /run/spawner/spawner.sock
|
||||
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://security-command.org}
|
||||
volumes:
|
||||
- ./runtime/spawner:/run/spawner
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
@@ -3,3 +3,9 @@ CONTENT_DIR=
|
||||
|
||||
# Container registry of the SecurityCommand organization.
|
||||
REGISTRY=git.security-command.org/securitycommand
|
||||
|
||||
# Local port nginx proxies to. It must match the port in deploy/nginx.
|
||||
BACKEND_PORT=8380
|
||||
|
||||
# Comma separated origins allowed to open terminal sessions.
|
||||
ALLOWED_ORIGINS=https://security-command.org
|
||||
@@ -1,5 +1,5 @@
|
||||
# Container flags for sandbox sessions, shared by the host and local tools.
|
||||
# They mirror the configuration hardcoded in the spawner. Keep them in sync.
|
||||
# They mirror the configuration hardcoded in the spawner and must stay identical.
|
||||
# shellcheck disable=SC2034
|
||||
SANDBOX_FLAGS=(
|
||||
--read-only --network none --cap-drop ALL
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Location blocks for the security-command.org server block, which also holds
|
||||
# the TLS settings. The upstream port matches BACKEND_PORT in .env.
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8380;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
location = /ws {
|
||||
proxy_pass http://127.0.0.1:8380;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 120s;
|
||||
proxy_send_timeout 120s;
|
||||
proxy_buffering off;
|
||||
}
|
||||
Reference in new issue
Block a user