- Add scripts/provision-hub-tokens.sh. It adds the five HUB_TOKEN_* keys to ~/.config/environment.d/10-secrets.conf. It is idempotent, keeps mode 600, leaves a mode-600 backup, and never prints a value. It uses openssl when present and /dev/urandom otherwise (this host has no openssl). - docker-compose.yml: run the container as the host user. The image's distroless nonroot user cannot read the 0600 secrets file. With nonroot the Hub read no tokens and every /ask returned 401. - Document the deploy steps, the finding, and the dry-run evidence in docs/outline/04-agent-runbook.md, docs/outline/02-config-and-env.md, README.md. Dry run on port 18788 with a scratch secrets file: /health ok with omniroute ok, control action refused, bad token 401. The host secrets file and the running hub container were not touched. Co-Authored-By: Paperclip <noreply@paperclip.ing>
41 lines
1.6 KiB
YAML
41 lines
1.6 KiB
YAML
services:
|
|
hub:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: central-ai-hub:local
|
|
container_name: hub
|
|
restart: unless-stopped
|
|
# The secrets file is bind-mounted read-only with mode 0600, owned by the
|
|
# host user. The image's distroless nonroot user (65532) cannot read it, so
|
|
# the container runs as the host user instead. No host file change needed.
|
|
user: "${HUB_UID:-1000}:${HUB_GID:-100}"
|
|
ports:
|
|
- "8788:8788"
|
|
environment:
|
|
HUB_PORT: "8788"
|
|
HUB_ROUTING_FILE: "/app/routing.md"
|
|
HUB_LOG_PATH: "/tmp/hub.log"
|
|
# Data projects that speak /ask (comma-separated name=url). Empty until a
|
|
# project is ready. The Hub reads each project's /capabilities.
|
|
HUB_PROJECTS: "${HUB_PROJECTS:-}"
|
|
# House TTS. The Hub starts speech and does not wait.
|
|
JERVIS_URL: "${JERVIS_URL:-http://192.168.20.13:8501}"
|
|
# Secrets are never hard-coded. The Hub keys (HUB_TOKEN_*, OMNIROUTE_API_KEY,
|
|
# PAPERCLIP_API_KEY, HUB_PROJECT_<NAME>_TOKEN) come from environment.d. The
|
|
# file is mounted read-only; the Hub reads it when the environment is empty.
|
|
HUB_SECRETS_FILE: "/run/secrets/hub.env"
|
|
volumes:
|
|
# routing.md is human-edited and stays outside the image.
|
|
- "./routing.md:/app/routing.md:ro"
|
|
- "${HOME}/.config/environment.d/10-secrets.conf:/run/secrets/hub.env:ro"
|
|
# The distroless image has no writable path except this tmpfs. The log lives here.
|
|
tmpfs:
|
|
- /tmp
|
|
healthcheck:
|
|
test: ["CMD", "/app/hub", "-healthcheck"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 5s
|