Browser-based interactive terminal sessions with agent CLIs via WebSocket + node-pty. Supports full TUI rendering (colors, cursor, ctrl-c) through xterm.js in the browser. Architecture: xterm.js ←WebSocket→ pty-server.js ←PTY→ agent CLI - Extract shared buildAgentEnv() from executor into agent-env.ts - Add internal /api/agents/[id]/env endpoint for PTY server - Add pty-server.js (WebSocket + node-pty, max 3 sessions, 2hr cleanup) - Add custom server.js wrapping Next.js with WebSocket upgrade - Add ChatTab component with agent selector and terminal - Wire CHAT tab into dashboard nav and render - Configure serverExternalPackages for node-pty - Update Dockerfile with build tools and custom server - Bump k8s memory limit 1Gi → 2Gi for PTY sessions
73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: harness
|
|
labels:
|
|
app: harness
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: harness
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: harness
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: gitea-pull-secret
|
|
containers:
|
|
- name: harness
|
|
image: gitea.coreworlds.io/lazorgurl/homelab-harness:latest
|
|
ports:
|
|
- containerPort: 3100
|
|
env:
|
|
- name: HARNESS_WORK_DIR
|
|
value: /data/harness
|
|
- name: CLAUDE_CONFIG_DIR
|
|
value: /secrets/claude
|
|
- name: OPENCODE_CONFIG_DIR
|
|
value: /secrets/opencode
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: harness-db-credentials
|
|
key: database-url
|
|
volumeMounts:
|
|
- name: workspace
|
|
mountPath: /data/harness
|
|
- name: claude-credentials
|
|
mountPath: /secrets/claude
|
|
readOnly: true
|
|
- name: opencode-credentials
|
|
mountPath: /secrets/opencode
|
|
readOnly: true
|
|
resources:
|
|
requests:
|
|
memory: 256Mi
|
|
cpu: 100m
|
|
limits:
|
|
memory: 2Gi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3100
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3100
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|
|
volumes:
|
|
- name: workspace
|
|
emptyDir:
|
|
sizeLimit: 2Gi
|
|
- name: claude-credentials
|
|
secret:
|
|
secretName: harness-claude-credentials
|
|
- name: opencode-credentials
|
|
secret:
|
|
secretName: harness-opencode-credentials
|