Files
roboco/.env.example
T
Renn F 059dc91a4f fix(grok): harden cost-guard, pin runtime, refresh stale plugin comments
Address review findings on the Grok provider work:

- budget-feed plugin failed open unconditionally, so a one-shot task agent
  whose in-container SDK budget server went unreachable would run with the
  cost cap unenforced. The entrypoint now exports ROBOCO_BUDGET_ENFORCE=1
  (one-shot agents always start that server) and the plugin's pre-exec gate
  fails CLOSED when the flag is set and the budget endpoint is unreachable,
  halting an uncapped burn. Interactive serve agents (intake/secretary) set
  no flag and keep failing open (they run no budget server by design).

- Pin opencode-ai to the live-verified 1.17.8 (was an unpinned global npm
  install). Untrusted model output runs under it; bump the pin deliberately.

- Document the ROBOCO_GROK_* operator vars in .env.example (image, the three
  opencode permissions, reasoning effort, idle-kill, cost ceiling).

- Refresh stale plugin comments: the MCP tool-name shape and the secretary
  tool-registration path are confirmed live, and secret-scrub's load route is
  the auto-discovery dir (not a config plugin: array). Keep the honest
  not-yet-exercised caveat on secret-scrub's deny path and the reasoning
  variant — those remain genuinely unverified.
2026-06-19 00:02:31 +02:00

143 lines
6.4 KiB
Bash

# =============================================================================
# RoboCo Environment Configuration
# =============================================================================
# Copy this file to .env
#
# NOTE: No API keys needed for agents - they use your Claude Code authentication.
# Run `claude` on the host to authenticate before starting RoboCo.
# =============================================================================
# Docker Deployment (NAS/Server)
# =============================================================================
# These are REQUIRED when running via docker compose on a NAS/server.
# They tell the orchestrator container where to find files on the HOST.
# Path to the project on the host (absolute path)
# ROBOCO_HOST_PROJECT_DIR=/volume1/roboco
# Path to Claude Code auth directory on the host
# ROBOCO_HOST_CLAUDE_DIR=/root/.claude
# Claude auth directory to mount into orchestrator
# CLAUDE_AUTH_DIR=~/.claude
# =============================================================================
# Container Images (docker-compose.registry.yml — pre-built deployment)
# =============================================================================
# Only used by docker-compose.registry.yml, which runs the published images
# instead of building from source. Defaults shown.
# Registry namespace: ghcr.io/rennf93 (GHCR) or docker.io/renzof93 (Docker Hub)
# ROBOCO_REGISTRY=ghcr.io/rennf93
# Image tag: latest, or a pinned release such as 0.5.0
# ROBOCO_VERSION=latest
# =============================================================================
# Data Persistence
# =============================================================================
# Set to a path on your NAS RAID array for durability
# Path to data directory on the host (MUST be absolute for Docker-in-Docker)
# ROBOCO_DATA_DIR=/volume1/roboco/data
# =============================================================================
# Application
# =============================================================================
ROBOCO_ENVIRONMENT=development
ROBOCO_DEBUG=true
# =============================================================================
# API Server
# =============================================================================
ROBOCO_HOST=0.0.0.0
ROBOCO_PORT=8000
# =============================================================================
# Database (PostgreSQL)
# =============================================================================
# For docker compose deployment, use container name:
# ROBOCO_DATABASE_HOST=roboco-postgres
# For local development:
ROBOCO_DATABASE_HOST=localhost
ROBOCO_DATABASE_PORT=5432
ROBOCO_DATABASE_USER=roboco
ROBOCO_DATABASE_PASSWORD=roboco
ROBOCO_DATABASE_NAME=roboco
ROBOCO_DATABASE_ECHO=false
# =============================================================================
# Redis
# =============================================================================
# For docker compose deployment, use container name:
# ROBOCO_REDIS_HOST=roboco-redis
# For local development:
ROBOCO_REDIS_HOST=localhost
ROBOCO_REDIS_PORT=6379
ROBOCO_REDIS_DB=0
# ROBOCO_REDIS_PASSWORD=
# =============================================================================
# RAG / Local LLM (Ollama + in-house pgvector engine)
# =============================================================================
# For docker compose use the container name (roboco-ollama); locally, localhost.
ROBOCO_OLLAMA_BASE_URL=http://localhost:11434
ROBOCO_LOCAL_LLM_BASE_URL=http://localhost:11434/v1
ROBOCO_LOCAL_LLM_MODEL=glm-5:cloud
ROBOCO_DEFAULT_EMBEDDING_MODEL=qwen3-embedding:0.6b
# =============================================================================
# Grok (xAI) Provider — optional
# =============================================================================
# RoboCo can run agents on grok-build-0.1 (xAI) via the opencode runtime instead
# of Claude Code. The xAI API key is NOT set here — store it encrypted per
# project from the panel (provider key), the same as the Ollama/Anthropic keys.
# Every var below is optional; defaults shown.
# Image the orchestrator spawns for Grok agents.
# ROBOCO_GROK_AGENT_IMAGE=roboco-agent-grok:latest
# opencode tool permissions for Grok agents: allow | ask | deny. Defaults are
# "allow"; tighten bash to "deny"/"ask" to fail closed on untrusted repos (the
# secret-scrub plugin is a denylist, not a full sandbox).
# ROBOCO_GROK_BASH_PERMISSION=allow
# ROBOCO_GROK_EDIT_PERMISSION=allow
# ROBOCO_GROK_EXTERNAL_DIR_PERMISSION=allow
# Force one reasoning effort for ALL Grok agents: minimal | high | max (or empty
# for opencode's default). Empty = per-role: coordination/docs roles request
# "minimal" to cut reasoning cost, code roles keep full reasoning.
# ROBOCO_GROK_REASONING_EFFORT=
# Kill a Grok agent container after this many seconds idle (no model call /
# stream) to reclaim a wedged one. Minimum 120.
# ROBOCO_GROK_IDLE_KILL_SECONDS=900
# Per-agent cost ceiling (USD) before the orchestrator kills the container;
# 0 disables. Backstops runaway-loop token burn.
# ROBOCO_GROK_MAX_COST_USD=0.0
# =============================================================================
# Security
# =============================================================================
# Encryption key for git tokens at rest (Fernet). REQUIRED — the orchestrator
# refuses to start without it. Generate with:
# python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'
ROBOCO_ENCRYPTION_KEY=
# Agent auth: HMAC secret that signs X-Agent-Token. REQUIRED for docker compose.
# Generate with: python -c 'import secrets; print(secrets.token_hex(32))'
ROBOCO_AGENT_AUTH_SECRET=
# Secure mode. On a trusted LAN you can leave this false (header-trust mode).
# Set true to require every request to carry a valid token so an agent cannot
# spoof another agent's role. When true you MUST also set ROBOCO_PANEL_AGENT_TOKEN.
ROBOCO_AGENT_AUTH_REQUIRED=false
# The control panel's CEO token, injected by nginx in secure mode so the human
# UI keeps working without the browser holding the signing secret. Generate it
# (after setting ROBOCO_AGENT_AUTH_SECRET above) with: make panel-token
ROBOCO_PANEL_AGENT_TOKEN=
# =============================================================================
# CORS (comma-separated origins)
# =============================================================================
ROBOCO_CORS_ORIGINS=["http://localhost:3000","http://localhost:5173"]