@phi-code-admin/camofox-browser 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/AGENTS.md +571 -571
  2. package/Dockerfile +86 -86
  3. package/LICENSE +21 -21
  4. package/README.md +691 -691
  5. package/camofox.config.json +10 -10
  6. package/lib/auth.js +134 -134
  7. package/lib/camoufox-executable.js +189 -189
  8. package/lib/config.js +153 -153
  9. package/lib/cookies.js +119 -119
  10. package/lib/downloads.js +168 -168
  11. package/lib/extract.js +74 -74
  12. package/lib/fly.js +54 -54
  13. package/lib/images.js +88 -88
  14. package/lib/inflight.js +16 -16
  15. package/lib/launcher.js +47 -47
  16. package/lib/macros.js +31 -31
  17. package/lib/metrics.js +184 -184
  18. package/lib/openapi.js +105 -105
  19. package/lib/persistence.js +89 -89
  20. package/lib/plugins.js +178 -175
  21. package/lib/proxy.js +277 -277
  22. package/lib/reporter.js +1102 -1102
  23. package/lib/request-utils.js +59 -59
  24. package/lib/resources.js +76 -76
  25. package/lib/snapshot.js +41 -41
  26. package/lib/tmp-cleanup.js +108 -108
  27. package/lib/tracing.js +137 -137
  28. package/openclaw.plugin.json +268 -268
  29. package/package.json +148 -148
  30. package/plugin.ts +758 -758
  31. package/plugins/persistence/AGENTS.md +37 -37
  32. package/plugins/persistence/README.md +48 -48
  33. package/plugins/persistence/index.js +124 -124
  34. package/plugins/vnc/AGENTS.md +42 -42
  35. package/plugins/vnc/README.md +165 -165
  36. package/plugins/vnc/apt.txt +7 -7
  37. package/plugins/vnc/index.js +142 -142
  38. package/plugins/vnc/spawn.js +8 -8
  39. package/plugins/vnc/vnc-launcher.js +64 -64
  40. package/plugins/vnc/vnc-watcher.sh +82 -82
  41. package/plugins/youtube/AGENTS.md +25 -25
  42. package/plugins/youtube/apt.txt +1 -1
  43. package/plugins/youtube/index.js +206 -206
  44. package/plugins/youtube/post-install.sh +5 -5
  45. package/plugins/youtube/youtube.js +301 -301
  46. package/run.sh +37 -37
  47. package/scripts/exec.js +8 -8
  48. package/scripts/generate-openapi.js +24 -24
  49. package/scripts/install-plugin-deps.sh +63 -63
  50. package/scripts/plugin.js +342 -342
  51. package/scripts/sync-version.js +25 -25
  52. package/server.js +6062 -6059
  53. package/tsconfig.json +12 -12
package/Dockerfile CHANGED
@@ -1,86 +1,86 @@
1
- FROM node:22-slim AS camofox-browser
2
-
3
- # Pinned Camoufox version for reproducible builds
4
- # Update these when upgrading Camoufox
5
- ARG CAMOUFOX_VERSION=135.0.1
6
- ARG CAMOUFOX_RELEASE=beta.24
7
- ARG ARCH=x86_64
8
-
9
- # Install dependencies for Camoufox (Firefox-based)
10
- RUN apt-get update && apt-get install -y \
11
- # Firefox dependencies
12
- libgtk-3-0 \
13
- libdbus-glib-1-2 \
14
- libxt6 \
15
- libasound2 \
16
- libx11-xcb1 \
17
- libxcomposite1 \
18
- libxcursor1 \
19
- libxdamage1 \
20
- libxfixes3 \
21
- libxi6 \
22
- libxrandr2 \
23
- libxrender1 \
24
- libxss1 \
25
- libxtst6 \
26
- # Mesa OpenGL/EGL for WebGL support (software rendering via llvmpipe)
27
- # Without these, Firefox cannot create WebGL contexts -- a major bot detection signal
28
- libegl1-mesa \
29
- libgl1-mesa-dri \
30
- libgbm1 \
31
- # Xvfb virtual display -- runs Camoufox as if on a real desktop (better anti-detection)
32
- xvfb \
33
- # Fonts
34
- fonts-liberation \
35
- fonts-noto-color-emoji \
36
- fontconfig \
37
- # Utils
38
- ca-certificates \
39
- curl \
40
- unzip \
41
- # yt-dlp runtime dependency
42
- python3-minimal \
43
- && rm -rf /var/lib/apt/lists/*
44
-
45
- # Pre-bake Camoufox browser binary into image via bind mount (downloaded by Makefile)
46
- # Note: unzip returns exit code 1 for warnings (Unicode filenames), so we use || true and verify
47
- RUN --mount=type=bind,source=dist,target=/dist \
48
- mkdir -p /root/.cache/camoufox \
49
- && (unzip -q /dist/camoufox-${ARCH}.zip -d /root/.cache/camoufox || true) \
50
- && chmod -R 755 /root/.cache/camoufox \
51
- && echo "{\"version\":\"${CAMOUFOX_VERSION}\",\"release\":\"${CAMOUFOX_RELEASE}\"}" > /root/.cache/camoufox/version.json \
52
- && test -f /root/.cache/camoufox/camoufox-bin && echo "Camoufox installed successfully"
53
-
54
- # Install yt-dlp for YouTube transcript extraction (no browser needed)
55
- RUN --mount=type=bind,source=dist,target=/dist \
56
- install -m 755 /dist/yt-dlp-${ARCH} /usr/local/bin/yt-dlp
57
-
58
- WORKDIR /app
59
-
60
- COPY package.json ./
61
- COPY scripts/ ./scripts/
62
- RUN npm install --production
63
-
64
- COPY server.js ./
65
- COPY camofox.config.json ./
66
- COPY lib/ ./lib/
67
- COPY plugins/ ./plugins/
68
- COPY scripts/ ./scripts/
69
-
70
- # Install default plugin dependencies (apt packages + post-install hooks)
71
- RUN scripts/install-plugin-deps.sh
72
-
73
- ENV NODE_ENV=production
74
- ENV CAMOFOX_PORT=9377
75
-
76
- EXPOSE 9377
77
-
78
- CMD ["sh", "-c", "node --max-old-space-size=${MAX_OLD_SPACE_SIZE:-128} server.js"]
79
-
80
- # Optional: rebuild plugin deps after adding third-party plugins
81
- # Usage: docker build --target with-plugins -t camofox-browser .
82
- FROM camofox-browser AS with-plugins
83
- COPY plugins/ ./plugins/
84
- COPY camofox.config.json ./
85
- COPY scripts/install-plugin-deps.sh /tmp/install-plugin-deps.sh
86
- RUN /tmp/install-plugin-deps.sh && rm /tmp/install-plugin-deps.sh
1
+ FROM node:22-slim AS camofox-browser
2
+
3
+ # Pinned Camoufox version for reproducible builds
4
+ # Update these when upgrading Camoufox
5
+ ARG CAMOUFOX_VERSION=135.0.1
6
+ ARG CAMOUFOX_RELEASE=beta.24
7
+ ARG ARCH=x86_64
8
+
9
+ # Install dependencies for Camoufox (Firefox-based)
10
+ RUN apt-get update && apt-get install -y \
11
+ # Firefox dependencies
12
+ libgtk-3-0 \
13
+ libdbus-glib-1-2 \
14
+ libxt6 \
15
+ libasound2 \
16
+ libx11-xcb1 \
17
+ libxcomposite1 \
18
+ libxcursor1 \
19
+ libxdamage1 \
20
+ libxfixes3 \
21
+ libxi6 \
22
+ libxrandr2 \
23
+ libxrender1 \
24
+ libxss1 \
25
+ libxtst6 \
26
+ # Mesa OpenGL/EGL for WebGL support (software rendering via llvmpipe)
27
+ # Without these, Firefox cannot create WebGL contexts -- a major bot detection signal
28
+ libegl1-mesa \
29
+ libgl1-mesa-dri \
30
+ libgbm1 \
31
+ # Xvfb virtual display -- runs Camoufox as if on a real desktop (better anti-detection)
32
+ xvfb \
33
+ # Fonts
34
+ fonts-liberation \
35
+ fonts-noto-color-emoji \
36
+ fontconfig \
37
+ # Utils
38
+ ca-certificates \
39
+ curl \
40
+ unzip \
41
+ # yt-dlp runtime dependency
42
+ python3-minimal \
43
+ && rm -rf /var/lib/apt/lists/*
44
+
45
+ # Pre-bake Camoufox browser binary into image via bind mount (downloaded by Makefile)
46
+ # Note: unzip returns exit code 1 for warnings (Unicode filenames), so we use || true and verify
47
+ RUN --mount=type=bind,source=dist,target=/dist \
48
+ mkdir -p /root/.cache/camoufox \
49
+ && (unzip -q /dist/camoufox-${ARCH}.zip -d /root/.cache/camoufox || true) \
50
+ && chmod -R 755 /root/.cache/camoufox \
51
+ && echo "{\"version\":\"${CAMOUFOX_VERSION}\",\"release\":\"${CAMOUFOX_RELEASE}\"}" > /root/.cache/camoufox/version.json \
52
+ && test -f /root/.cache/camoufox/camoufox-bin && echo "Camoufox installed successfully"
53
+
54
+ # Install yt-dlp for YouTube transcript extraction (no browser needed)
55
+ RUN --mount=type=bind,source=dist,target=/dist \
56
+ install -m 755 /dist/yt-dlp-${ARCH} /usr/local/bin/yt-dlp
57
+
58
+ WORKDIR /app
59
+
60
+ COPY package.json ./
61
+ COPY scripts/ ./scripts/
62
+ RUN npm install --production
63
+
64
+ COPY server.js ./
65
+ COPY camofox.config.json ./
66
+ COPY lib/ ./lib/
67
+ COPY plugins/ ./plugins/
68
+ COPY scripts/ ./scripts/
69
+
70
+ # Install default plugin dependencies (apt packages + post-install hooks)
71
+ RUN scripts/install-plugin-deps.sh
72
+
73
+ ENV NODE_ENV=production
74
+ ENV CAMOFOX_PORT=9377
75
+
76
+ EXPOSE 9377
77
+
78
+ CMD ["sh", "-c", "node --max-old-space-size=${MAX_OLD_SPACE_SIZE:-128} server.js"]
79
+
80
+ # Optional: rebuild plugin deps after adding third-party plugins
81
+ # Usage: docker build --target with-plugins -t camofox-browser .
82
+ FROM camofox-browser AS with-plugins
83
+ COPY plugins/ ./plugins/
84
+ COPY camofox.config.json ./
85
+ COPY scripts/install-plugin-deps.sh /tmp/install-plugin-deps.sh
86
+ RUN /tmp/install-plugin-deps.sh && rm /tmp/install-plugin-deps.sh
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Jo, Inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jo, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.