diff --git a/stacks/camofox/docker-compose.yml b/stacks/camofox/docker-compose.yml new file mode 100644 index 0000000..f06410f --- /dev/null +++ b/stacks/camofox/docker-compose.yml @@ -0,0 +1,41 @@ +# camofox stack — self-hosted stealth headless browser (Camoufox/Firefox) REST API for the +# Hermes agent. Chosen over the native Playwright/Browserbase plugins for self-hosted, +# no-cloud-key, anti-detection browsing on valhalla. +# +# No published image: built on-host as camofox-browser:135.0.1-x86_64 via `make build` in the +# upstream clone (/storage1/hermes/workspace/clones/camofox-browser). pull_policy: never so +# Portainer's git redeploy uses the local image instead of trying to pull a non-existent +# registry tag. To make it survive a host rebuild, push to registry.ginnoir.com later (famapp +# pattern) and swap the image ref. +# +# Internal-only: published on the edge host-IP (172.20.0.1:9377) so host-side Hermes can reach +# it directly, and joined to `edge` so Caddy reaches it by container name. Bearer-auth enforced +# by camofox itself (CAMOFOX_ACCESS_KEY). Image pinned out of Watchtower. +services: + camofox: + image: camofox-browser:135.0.1-x86_64 + pull_policy: never + container_name: camofox + restart: unless-stopped + labels: + - "com.centurylabs.watchtower.enable=false" + env_file: + - stack.env + networks: [edge] + # Firefox-based browsers can crash with the default 64MB /dev/shm. + shm_size: "1gb" + volumes: + - /config/camofox/cookies:/data/cookies + - /config/camofox/profiles:/data/profiles + ports: + - "172.20.0.1:9377:9377" + healthcheck: + test: ["CMD", "curl", "-fsS", "http://localhost:9377/health"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 40s + +networks: + edge: + external: true diff --git a/stacks/camofox/stack.env b/stacks/camofox/stack.env new file mode 100644 index 0000000..9b02d68 --- /dev/null +++ b/stacks/camofox/stack.env @@ -0,0 +1,13 @@ +# camofox stack env — committed intentionally (homelab convention; secrets versioned in the +# private repo). LF line endings (enforced by .gitattributes). +# +# CAMOFOX_ACCESS_KEY — bearer required on all routes except /health, cookie-import, /stop. +# CAMOFOX_ADMIN_KEY — required for POST /stop. +# CAMOFOX_API_KEY — left UNSET on purpose: keeps the cookie-import endpoint disabled. +# CAMOFOX_COOKIES_DIR / CAMOFOX_PROFILE_DIR — explicit container paths (avoid home-dir ambiguity); +# mapped to /config/camofox/* binds on the host. +CAMOFOX_ACCESS_KEY=cc9dac55139c97431160468bcfa43bbe0ab862710990f762d04e5881da9574b3 +CAMOFOX_ADMIN_KEY=117606acac488bf9661dab6ed276bc2cb465799eaf5676f2f7576b57e44b0ef4 +CAMOFOX_PORT=9377 +CAMOFOX_COOKIES_DIR=/data/cookies +CAMOFOX_PROFILE_DIR=/data/profiles