Add a packaged-client runtime boundary so the shared UI can talk to local, desktop, remote, and VS Code runtimes through the right transport instead of assuming one same-origin web server. Centralize OpenChamber-owned API access behind RuntimeAPIs, runtimeFetch, and runtime URL helpers, while keeping official OpenCode traffic on the SDK path. Support runtime switching, remote host selection, desktop client credentials, and headless connection links for pairing packaged clients with remote OpenChamber servers. Harden the new auth model by moving long-lived client tokens out of browser URLs, introducing short-lived scoped URL tokens for browser-owned transports, restricting URL-token access to explicit readable/realtime routes, and making client-token management session-scoped or self-scoped as appropriate. Update browser-owned assets and preview proxy flows to work with the split runtime model, including authenticated project icons, preview token propagation, CSP-safe preview bridge injection, and preview proxy auth that survives short-lived URL-token expiry. Tighten Electron security boundaries for packaged clients by gating privileged preload state to trusted origins and requiring explicit confirmation before connect deep-links import or switch remote runtimes. Also refresh agent guidance and project skills so future runtime/API, auth, preview, UI, CLI, settings, locale, and drag-to-reorder work follows the new architecture.
139 lines
4.4 KiB
Plaintext
139 lines
4.4 KiB
Plaintext
---
|
|
title: Variables de entorno
|
|
description: Configura la integración de OpenChamber y OpenCode con variables de entorno.
|
|
---
|
|
|
|
# Variables de entorno
|
|
|
|
OpenChamber lee estas variables al arrancar. Para servicios de inicio, `openchamber startup enable` guarda por defecto una copia del entorno actual, así que vuelve a ejecutarlo después de cambiar variables que quieras usar en el servicio.
|
|
|
|
## Servidor OpenChamber
|
|
|
|
### `OPENCHAMBER_HOST`
|
|
|
|
Dirección donde escucha el servidor web de OpenChamber. Usa `0.0.0.0` para permitir acceso desde otras máquinas.
|
|
|
|
### `OPENCHAMBER_UI_PASSWORD`
|
|
|
|
Contraseña para la interfaz del navegador. Úsala cuando no te limites a localhost, o cuando uses túneles o un proxy inverso.
|
|
|
|
### `OPENCHAMBER_API_ONLY`
|
|
|
|
Inicia OpenChamber en modo headless cuando vale `true` o `1`. Las rutas API siguen disponibles para clientes de escritorio y móviles, pero no se sirve la UI del navegador.
|
|
|
|
### `OPENCHAMBER_DATA_DIR`
|
|
|
|
Cambia el directorio de datos de OpenChamber. Por defecto es `~/.config/openchamber`.
|
|
|
|
### `OPENCHAMBER_COMPRESS_API`
|
|
|
|
Controla la compresión de respuestas de la API. `true` o `1` la activa; `false` o `0` la desactiva.
|
|
|
|
### `OPENCHAMBER_SKIP_API_COMPRESSION`
|
|
|
|
Desactiva la compresión de respuestas de la API si vale `true` o `1`. Tiene prioridad sobre `OPENCHAMBER_COMPRESS_API`.
|
|
|
|
### `OPENCHAMBER_VERBOSE_REQUEST_LOGS`
|
|
|
|
Activa logs HTTP detallados si vale `true` o `1`.
|
|
|
|
### `OPENCHAMBER_UPDATE_API_URL`
|
|
|
|
Cambia el endpoint de comprobación de actualizaciones. La mayoría de usuarios no debería tocarlo.
|
|
|
|
### `OPENCHAMBER_PACKAGE_MANAGER`
|
|
|
|
Fuerza el gestor de paquetes usado para actualizar cuando la detección automática se equivoca.
|
|
|
|
## Servidor OpenCode
|
|
|
|
### `OPENCODE_HOST`
|
|
|
|
Conecta OpenChamber a un servidor OpenCode existente. Debe ser un origin `http` o `https` con puerto explícito y sin ruta, query ni hash. `OPENCODE_HOST` tiene prioridad sobre `OPENCODE_PORT`.
|
|
|
|
### `OPENCODE_PORT`
|
|
|
|
Define el puerto del servidor OpenCode. Con OpenCode gestionado pide ese puerto; con `OPENCODE_SKIP_START=true` conecta a un servidor externo en ese puerto.
|
|
|
|
### `OPENCODE_SKIP_START`
|
|
|
|
Evita que OpenChamber arranque su propio servidor OpenCode cuando vale `true`.
|
|
|
|
### `OPENCHAMBER_OPENCODE_HOSTNAME`
|
|
|
|
Hostname para el servidor OpenCode gestionado por OpenChamber. Por defecto es `127.0.0.1`.
|
|
|
|
### `OPENCODE_BINARY`
|
|
|
|
Ruta al ejecutable `opencode` que debe usar OpenChamber.
|
|
|
|
### `OPENCODE_CONFIG`
|
|
|
|
Ruta a un archivo de configuración concreto de OpenCode.
|
|
|
|
### `OPENCODE_CONFIG_DIR`
|
|
|
|
Ruta al directorio de configuración de OpenCode para agents, skills, snippets y descubrimiento de config.
|
|
|
|
### `OPENCODE_DATA_DIR`
|
|
|
|
Directorio de datos personalizado para el servidor OpenCode gestionado.
|
|
|
|
### `OPENCODE_WSL_DISTRO`
|
|
|
|
Elige la distro WSL usada para la integración con OpenCode en Windows.
|
|
|
|
### `OPENCHAMBER_OPENCODE_WSL_DISTRO`
|
|
|
|
Alias específico de OpenChamber para elegir la distro WSL. `OPENCODE_WSL_DISTRO` tiene prioridad si ambas están definidas.
|
|
|
|
### `OPENCODE_JWT_SECRET`
|
|
|
|
Secreto para firmar tokens de autenticación de la UI. En servicios persistentes, usa un valor largo y aleatorio.
|
|
|
|
## Terminal y Git
|
|
|
|
### `OPENCHAMBER_TERMINAL_SHELL`
|
|
|
|
Ejecutable de shell para las sesiones de terminal en OpenChamber.
|
|
|
|
### `OPENCHAMBER_GIT_BINARY`
|
|
|
|
Ejecutable de Git usado por las funciones Git de OpenChamber.
|
|
|
|
### `GIT_BINARY`
|
|
|
|
Override alternativo para el ejecutable de Git. Para ajustes específicos de OpenChamber, prefiere `OPENCHAMBER_GIT_BINARY`.
|
|
|
|
### `OPENCHAMBER_GIT_READ_CACHE_TTL_MS`
|
|
|
|
TTL, en milisegundos, para lecturas de archivos con cache respaldadas por Git. Usa `0` para desactivar la cache al depurar.
|
|
|
|
## Voz y túneles
|
|
|
|
### `OPENAI_API_KEY`
|
|
|
|
API key para funciones de voz de OpenChamber que llaman a servicios compatibles con OpenAI.
|
|
|
|
### `OPENCHAMBER_ALLOW_REMOTE_OPENAI_COMPAT_URLS`
|
|
|
|
Permite base URLs remotas compatibles con OpenAI para funciones de voz cuando vale `true` o `1`.
|
|
|
|
### `NGROK_AUTHTOKEN`
|
|
|
|
Token de autenticación de ngrok usado por los comandos de túnel de OpenChamber. También puedes configurarlo con `ngrok config add-authtoken <token>`.
|
|
|
|
## Ayudas de runtime
|
|
|
|
### `BUN_BINARY`
|
|
|
|
Ejecutable de Bun que OpenChamber debe usar al iniciar procesos daemon.
|
|
|
|
### `BUN_INSTALL`
|
|
|
|
Raíz de instalación de Bun. OpenChamber la usa para encontrar `bin/bun` al iniciar daemons y actualizar.
|
|
|
|
### `VITE_OPENCODE_URL`
|
|
|
|
API base URL de build-time para la web app construida con Vite. La mayoría de usuarios no debería usarla en CLI o desktop normales.
|