13 Commits

Author SHA1 Message Date
estebanthi
44660055af Switch to alpine chromium image
All checks were successful
CI / release (push) Successful in 2m17s
2026-01-18 15:07:34 +01:00
estebanthi
c14052556a fixed dockerfile
Some checks failed
CI / release (push) Failing after 2m16s
2026-01-18 14:34:32 +01:00
estebanthi
34822965d2 fixed byuild
All checks were successful
CI / release (push) Successful in 1m59s
2026-01-18 14:25:52 +01:00
estebanthi
2b65730d77 fixed
All checks were successful
CI / release (push) Successful in 1m45s
2026-01-18 14:17:43 +01:00
estebanthi
6557f28aab fixed dependencies
All checks were successful
CI / release (push) Successful in 1m54s
2026-01-18 14:10:33 +01:00
estebanthi
c8bfc9c219 fixed dependencies
Some checks failed
CI / release (push) Failing after 2m12s
2026-01-18 14:01:07 +01:00
estebanthi
0b019eaa04 fixed vulnerability
Some checks failed
CI / release (push) Failing after 1m55s
2026-01-18 13:54:38 +01:00
estebanthi
dcd929a4c5 Harden Docker production build
Some checks failed
CI / release (push) Failing after 37s
2026-01-18 11:38:14 +01:00
estebanthi
ca5402d15f fixed build
Some checks failed
CI / release (push) Failing after 2m54s
2026-01-18 08:51:15 +01:00
estebanthi
86ed863e59 fixed build
Some checks failed
CI / release (push) Failing after 51s
2026-01-18 08:48:30 +01:00
estebanthi
71aa54057f build
All checks were successful
CI / release (push) Successful in 18s
2026-01-17 16:26:12 +01:00
estebanthi
a7c78ba1b6 build 2026-01-17 16:24:55 +01:00
estebanthi
4586494580 updated ua 2026-01-17 16:20:57 +01:00
8 changed files with 1776 additions and 23 deletions

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
node_modules
cache
*.log
.DS_Store
.git

View File

@@ -0,0 +1,28 @@
name: CI
on:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
jobs:
release:
uses: Wavyzz/ci-workflows/.github/workflows/docker-build-publish.yml@v1
with:
registry_host: ${{ secrets.REGISTRY_HOST }}
images: |
[
{
"name": "cf-bypass-fast",
"cache_ref": "cf-bypass-fast:buildcache",
"dockerfile": "./Dockerfile",
"context": "./"
}
]
secrets:
registry_user: ${{ secrets.REGISTRY_USER }}
registry_password: ${{ secrets.REGISTRY_PASSWORD }}
ci_token: ${{ secrets.CI_GITEA_TOKEN }}

10
.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
node_modules/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.DS_Store
.env
.env.*
!.env.example

View File

@@ -1,29 +1,48 @@
FROM node:20-slim
FROM node:20-alpine AS build
# Install Chrome and dependencies
RUN apt update && apt install -y \
wget gnupg ca-certificates xvfb \
fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
libatk1.0-0 libxss1 libnss3 libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt install -y ./google-chrome-stable_current_amd64.deb \
&& rm google-chrome-stable_current_amd64.deb
ENV NODE_ENV=production
RUN apk add --no-cache python3 make g++
RUN corepack enable
# Set working directory
WORKDIR /app
# Copy and install dependencies
COPY package*.json ./
RUN npm install
COPY package.json pnpm-lock.yaml ./
RUN corepack prepare pnpm@10.28.0 --activate \
&& pnpm install --frozen-lockfile --prod \
&& pnpm store prune
# Copy app code
COPY . .
# Expose port (match your app's port)
FROM node:20-alpine
ENV NODE_ENV=production
ENV CHROME_PATH=/usr/bin/chromium-browser
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN apk add --no-cache chromium nss freetype harfbuzz ttf-freefont
# Remove npm/corepack to shrink attack surface and avoid bundled CVEs.
RUN rm -rf /usr/local/lib/node_modules/npm \
/usr/local/bin/npm \
/usr/local/bin/npx \
/usr/local/lib/node_modules/corepack \
/usr/local/bin/corepack
WORKDIR /app
COPY --from=build /app/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
COPY --from=build --chown=node:node /app/package.json /app/package.json
COPY --from=build --chown=node:node /app/index.js /app/index.js
COPY --from=build --chown=node:node /app/endpoints /app/endpoints
COPY --from=build --chown=node:node /app/node_modules /app/node_modules
RUN mkdir -p /app/cache && chown -R node:node /app
USER node
EXPOSE 10000
# Start Xvfb and run the bot
CMD rm -f /tmp/.X99-lock && \
Xvfb :99 -screen 0 1024x768x24 & \
export DISPLAY=:99 && \
npm start
CMD ["/usr/local/bin/docker-entrypoint.sh"]

View File

@@ -75,12 +75,14 @@ Bypass Cloudflare protection and get cookies/tokens.
{
"mode": "iuam",
"domain": "https://olamovies.watch/generate",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
```
#### Parameters
- **`mode`** (required): `"iuam"` or `"turnstile"`
- **`domain`** (required): Target website URL
- **`user_agent`** (optional): User-Agent to use for the browser session
- **`proxy`** (optional): Proxy configuration object
#### Response (Success)

46
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/sh
set -eu
resolve_chrome_path() {
if [ -n "${CHROME_PATH:-}" ] && [ -x "$CHROME_PATH" ]; then
return 0
fi
for candidate in \
/usr/bin/chromium-browser \
/usr/bin/chromium \
/usr/bin/google-chrome-stable \
/usr/bin/google-chrome \
/opt/google/chrome/google-chrome; do
if [ -x "$candidate" ]; then
CHROME_PATH="$candidate"
return 0
fi
done
if command -v chromium-browser >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium-browser)"
return 0
fi
if command -v chromium >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium)"
return 0
fi
if command -v google-chrome-stable >/dev/null 2>&1; then
CHROME_PATH="$(command -v google-chrome-stable)"
return 0
fi
if command -v google-chrome >/dev/null 2>&1; then
CHROME_PATH="$(command -v google-chrome)"
return 0
fi
echo "No Chrome/Chromium executable found. Set CHROME_PATH to a valid binary." >&2
exit 1
}
resolve_chrome_path
export CHROME_PATH
export PUPPETEER_EXECUTABLE_PATH="${PUPPETEER_EXECUTABLE_PATH:-$CHROME_PATH}"
exec node index.js

View File

@@ -59,10 +59,10 @@ if (process.env.NODE_ENV !== 'development') {
async function createBrowser(proxyServer = null) {
const connectOptions = {
headless: false,
headless: "new",
turnstile: true,
connectOption: { defaultViewport: null },
disableXvfb: false,
disableXvfb: true,
}
if (proxyServer) {
@@ -97,6 +97,9 @@ app.post('/cloudflare', async (req, res) => {
if (!data || typeof data.mode !== 'string') {
return res.status(400).json({ message: 'Bad Request: missing or invalid mode' })
}
if (data.user_agent && typeof data.user_agent !== 'string') {
return res.status(400).json({ message: 'Bad Request: invalid user_agent' })
}
if (authToken && data.authToken !== authToken) {
return res.status(401).json({ message: 'Unauthorized' })
}
@@ -126,6 +129,9 @@ app.post('/cloudflare', async (req, res) => {
page = ctx.page
await page.goto('about:blank')
if (data.user_agent) {
await page.setUserAgent(data.user_agent)
}
switch (data.mode) {
case "turnstile":
@@ -167,4 +173,4 @@ app.use((req, res) => {
if (process.env.NODE_ENV === 'development') {
module.exports = app
}
}

1637
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff