diff --git a/.env.example b/.env.example index dffd6e8..eaa5bd2 100644 --- a/.env.example +++ b/.env.example @@ -1,34 +1,324 @@ -# ───────────────────────────────────────────────────────────────────────────── -# Deployment environment for the AIDO (Onyx CE) white-label. -# Copy to `.env` (same directory) and fill in real secrets: cp .env.example .env -# -# NOTE: Branding (name/logo/favicon/links) is NOT configured here — it is baked -# into the web image at build time from branding/branding.config.json. This file -# only holds DEPLOYMENT settings (secrets, auth, image version). -# ───────────────────────────────────────────────────────────────────────────── +# Copy this file to .env so it's picked up by the docker compose yaml files +# Uncomment the values you would like to set +# No edits necessary, works out of the box -# Pin BOTH the upstream image tag and the ./onyx checkout to the same release for -# a reproducible, version-matched deployment. `latest` follows upstream main. + +################################################################################ +## COMMONLY MODIFIED CONFIGURATIONS +################################################################################ +## Version of Onyx to deploy, default is latest (main built nightly). +## Craft uses this same tag for the sandbox image; do not set a separate +## sandbox image for normal deployments. IMAGE_TAG=latest -# Branded web image tag (built locally; any value is fine). -AIDO_TAG=local +## Onyx Craft Configuration (off by default). +## When enabling Craft through install.sh --include-craft or by manually adding +## docker-compose.craft.yml, the sandbox image follows IMAGE_TAG above. +# ENABLE_CRAFT=true +# +## docker backend drives sandboxes via the host Docker socket (root-equivalent; +## trusted hosts only) and needs v4.0.6+ images. install.sh picks docker vs +## kubernetes by image tag. +# SANDBOX_BACKEND=docker +# +## SANDBOX_API_SERVER_URL must be a *public* HTTPS URL the sandbox can reach +## the same way any other Onyx client does — internal compose hostnames like +## "http://api_server:8080" do not resolve from inside the sandbox bridge. +# SANDBOX_API_SERVER_URL=https://onyx.your-org.example +# +## Sandbox bridge network. Created by install.sh (or manually: +## docker network create onyx_craft_sandbox +## Sandboxes join only this network — they cannot reach postgres, redis, +## minio, or any other compose service by name. +# SANDBOX_DOCKER_NETWORK=onyx_craft_sandbox +# +## Per-sandbox container resource limits. Defaults match K8s pod *requests* +## (1 CPU / 2Gi), not its limits (2 CPU / 10Gi), since single-VM compose +## deployments rarely have headroom to over-commit every sandbox. +# SANDBOX_DOCKER_MEMORY_LIMIT=2g +# SANDBOX_DOCKER_CPU_LIMIT=1.0 +# +## EC2 IMDS note: on EC2 the Docker daemon's default bridge allows traffic to +## 169.254.169.254 (Instance Metadata Service), which can hand out IAM role +## credentials. The fix is a host-level DOCKER-USER iptables rule that drops +## bridge traffic to that address. install.sh --include-craft installs this +## rule automatically when it has sudo/iptables access, and prints manual +## instructions otherwise. -# ── Object storage (MinIO) — REQUIRED, the compose refuses to start otherwise ── -MINIO_ROOT_USER=aido_minio_admin -MINIO_ROOT_PASSWORD=change-me-strong-password -S3_AWS_ACCESS_KEY_ID=aido_minio_admin -S3_AWS_SECRET_ACCESS_KEY=change-me-strong-password +## Auth Settings +### https://docs.onyx.app/deployment/authentication +AUTH_TYPE=oidc +SESSION_EXPIRE_TIME_SECONDS=604800 # 7 days +AUTH_COOKIE_EXPIRE_TIME_SECONDS=604800 # 7 days +### Signs password reset, email verification, OAuth login state, and captcha cookies. +### REQUIRED: the API server refuses to start with an empty value (secure by default). +### If using install.sh this is auto-generated; if setting manually, run: openssl rand -hex 32 +USER_AUTH_SECRET= +### Recommend to set this for security +# ENCRYPTION_KEY_SECRET= +### Bearer token for the API server's /metrics endpoint. Auth is REQUIRED by +### default: scrapers must send `Authorization: Bearer ` (Prometheus +### scrape config: `authorization`). If you set neither this token nor +### DISABLE_METRICS_AUTH, /metrics is locked (returns 401). +# METRICS_AUTH_TOKEN= +### Set to "true" to expose /metrics with NO authentication (explicit opt-out). +# DISABLE_METRICS_AUTH= +### Set to "true" to expose the interactive API docs and schema (/openapi.json, +### /docs, /redoc) publicly with NO authentication. Off by default so the API +### surface is not exposed; when off these routes are not registered (404). +# ENABLE_PUBLIC_DOCS= +### Optional +# API_KEY_HASH_ROUNDS= +### You can add a comma separated list of domains like onyx.app, only those domains will be allowed to signup/log in +# VALID_EMAIL_DOMAINS= +### Set to "true" to restrict GET /users to admins. Non-admins can't enumerate +### accounts or share agents with individual users; group sharing still works. +# USER_DIRECTORY_ADMIN_ONLY= -# ── Auth ── -# Easiest first-run option is `disabled` (no login wall) to verify branding. -# For production use `oidc` / `google_oauth` / `basic` and add the matching vars -# from Onyx's docs. See onyx/deployment/docker_compose/.env.* examples upstream. -AUTH_TYPE=disabled +## Chat Configuration +# HARD_DELETE_CHATS= +# MAX_ALLOWED_UPLOAD_SIZE_MB=250 +# Default per-user upload size limit (MB) when no admin value is set. +# Automatically clamped to MAX_ALLOWED_UPLOAD_SIZE_MB at runtime. +# DEFAULT_USER_FILE_MAX_UPLOAD_SIZE_MB=100 -# Public URL the app is served from (used for callbacks / absolute links). -WEB_DOMAIN=http://localhost:3000 +## Base URL for redirects +WEB_DOMAIN= +FQDN= +## Set to false to let any origin embed Onyx in an