feat(browser): ship camofox v1.17.0 in compose, verified on a real instance
- compose: camofox service on by default (internal only, volume umt-camofox, healthcheck, CAMOFOX_REPLICAS=0 to skip); app depends on it with service_started/required=false and auto-registers camofox-env from BROWSER_PROVIDER_URL / BROWSER_ACCESS_KEY / BROWSER_ENABLED - docker/camofox/Dockerfile: builds upstream tag v1.17.0 (389c996); fixes the upstream Dockerfile (missing postinstall.js before npm ci, sh -c not forwarding SIGTERM so logins were never persisted on restart) - adapter fixes from the real container: coordinate click via evaluate + selector, focus typing with mode=keyboard, password values redacted from ARIA snapshots/extract, downloads field names, 410 after browser restart treated as lost tab; navigate reopens a tab in the same session - verified-capability table keyed by upstream version (1.17.0 all ten); other versions stay unverified; probe reports auth failures - settings: browser providers block (create/edit/delete/probe, capability table); API POST/PATCH/DELETE /browser/providers, POST .../probe - scripts/browser-verify: umtbr stack + mock NexusPHP run of REQ 4.7.4 items - docs: runbook browser §1/§7 (real-instance record), deploy §2.1 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b4c9b1ead2
commit
40dd0e69e4
29 files changed
+1661
-73
No files matched your search
@@ -0,0 +1,60 @@
|
||||
# camofox-browser 镜像(docker-compose.yml 的 camofox 服务)。
|
||||
# 上游 jo-inc/camofox-browser 不发布镜像;源码由命名上下文 upstream 提供(compose 里锁定 git tag v1.17.0,
|
||||
# commit 389c996ae3c7d42e539295a336ee6f975847f066)。本文件照抄上游 Dockerfile 的 camofox-browser 阶段,只改三处:
|
||||
# 1. 上游 v1.17.0 的 Dockerfile 在 `npm ci` 之前没有复制 postinstall.js,构建必然失败(MODULE_NOT_FOUND);
|
||||
# 这里先复制 postinstall.js 与 lib/(Camoufox 已预置,postinstall 见到 version.json 直接跳过下载);
|
||||
# 2. 可选 APT_MIRROR(国内构建换源,如 mirrors.ustc.edu.cn);
|
||||
# 3. CMD 用 exec 启动 node(见文件末尾)。
|
||||
# 手工构建:docker build -t camofox-browser:1.17.0 \
|
||||
# --build-context upstream=https://github.com/jo-inc/camofox-browser.git#v1.17.0 docker/camofox
|
||||
FROM node:22-trixie-slim AS camofox-browser
|
||||
|
||||
ARG CAMOUFOX_VERSION=152.0.4
|
||||
ARG CAMOUFOX_RELEASE=beta.28
|
||||
ARG ARCH=x86_64
|
||||
ARG APT_MIRROR=
|
||||
|
||||
RUN if [ -n "$APT_MIRROR" ]; then sed -i "[email protected]@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources; fi \
|
||||
&& apt-get update && apt-get install -y \
|
||||
libgtk-3-0 libdbus-glib-1-2 libxt6 libasound2 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 \
|
||||
libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
|
||||
libegl1 libgl1-mesa-dri libgbm1 \
|
||||
xvfb fonts-liberation fonts-noto-color-emoji fontconfig \
|
||||
ca-certificates curl unzip python3-minimal \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir -p /root/.cache/camoufox \
|
||||
&& curl -fL -o /tmp/camoufox.zip "https://github.com/daijro/camoufox/releases/download/v${CAMOUFOX_VERSION}-${CAMOUFOX_RELEASE}/camoufox-${CAMOUFOX_VERSION}-${CAMOUFOX_RELEASE}-lin.${ARCH}.zip" \
|
||||
&& (unzip -q /tmp/camoufox.zip -d /root/.cache/camoufox || true) \
|
||||
&& rm /tmp/camoufox.zip \
|
||||
&& chmod -R 755 /root/.cache/camoufox \
|
||||
&& echo "{\"version\":\"${CAMOUFOX_VERSION}\",\"release\":\"${CAMOUFOX_RELEASE}\"}" > /root/.cache/camoufox/version.json \
|
||||
&& test -f /root/.cache/camoufox/camoufox-bin
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=upstream package.json package-lock.json postinstall.js ./
|
||||
COPY --from=upstream scripts/ ./scripts/
|
||||
COPY --from=upstream lib/ ./lib/
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends build-essential python3 \
|
||||
&& npm ci --omit=dev \
|
||||
&& apt-get purge -y --auto-remove build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=upstream server.js camofox.config.json ./
|
||||
COPY --from=upstream mcp/ ./mcp/
|
||||
COPY --from=upstream plugins/ ./plugins/
|
||||
|
||||
RUN sh scripts/install-plugin-deps.sh
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/jo-inc/camofox-browser" \
|
||||
org.opencontainers.image.version="v1.17.0" \
|
||||
org.opencontainers.image.revision="389c996ae3c7d42e539295a336ee6f975847f066"
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV CAMOFOX_PORT=9377
|
||||
EXPOSE 9377
|
||||
# exec:让 node 成为 PID 1 收到 SIGTERM。上游用 `sh -c "node …"`,sh 不转发信号,docker stop/restart 等满宽限期后
|
||||
# SIGKILL,持久化插件的关机落盘(server:shutdown)不会执行,上次落盘之后的登录状态全部丢失(2026-09-28 实测)
|
||||
CMD ["sh", "-c", "exec node --max-old-space-size=${MAX_OLD_SPACE_SIZE:-128} server.js"]
|
||||
Reference in new issue
Block a user