Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EzSolver (optimized fork)

Based on the original open-source project
ismoiloffS/EzSolver by Ismoiloff
License: MIT (see LICENSE)

This repository keeps the original simple launch path that already works for most users, and only adds a few practical production fixes.

HTTP API is fully compatible with upstream EzSolver.


Relationship to the original project

Original This fork
Author / base ismoiloffS/EzSolver same solve flow
Launch uc.start(browser_executable_path, headless=False, user_data_dir=...) same + sandbox=False default
API POST /solve unchanged

What we did not change

  • POST /solve request/response JSON
  • success: {"token": "...", "elapsed": 4.23}
  • error: {"error": "..."} with HTTP 500
  • CLI client usage

Minimal hardening (only when needed)

  1. Default EZ_NO_SANDBOX=1sandbox=False (root/docker/www)
  2. Writable profile fallback if /tmp/ts_profile is owned by another user
  3. Service binds 0.0.0.0, default MAX_WORKERS=2
  4. Default unique profile per solve + short start gap (reduces concurrent first-fail)

Requirements

  • Python 3.8+
  • Google Chrome / Chromium
  • pip install nodriver
  • Linux headless: sudo apt install xvfb

Install

git clone https://github.com/50521136/EzSolver.git
cd EzSolver
pip install nodriver
# Linux:
sudo apt install -y xvfb google-chrome-stable

Run service

Defaults are already baked into service.py. No export required:

python service.py

Equivalent built-in defaults:

  • EZ_NO_SANDBOX=1
  • MAX_WORKERS=2
  • unique profile on
  • try raise open-files soft limit to 65535
  • bind 0.0.0.0:8191

Optional CLI overrides:

python service.py --workers 2 --port 8191
python service.py --workers 1
python service.py --sandbox          # only if you really need sandbox on
python service.py --shared-profile   # original shared profile mode
python service.py --nofile 65535     # default; use --nofile 0 to skip

Env vars still work if your panel/process manager sets them.

Service listens on http://0.0.0.0:8191.

API (compatible with upstream)

Solve

curl -s -X POST http://127.0.0.1:8191/solve \
  -H "Content-Type: application/json" \
  -d '{"sitekey":"0x4AAAA...","siteurl":"https://example.com/","timeout":45}'

Success:

{"token":"0....","elapsed":12.34}

Failure:

{"error":"..."}

Health

curl -s http://127.0.0.1:8191/health

CLI client

python clientsend.py <sitekey> <siteurl> [timeout]

Environment variables

Variable Default Meaning
PORT 8191 HTTP port
MAX_WORKERS 2 concurrent Chrome workers
EZ_NO_SANDBOX 1 pass sandbox=False to nodriver
TS_PROFILE_DIR /tmp/ts_profile (Linux) profile directory
CHROME_PATH auto-detect Chrome/Chromium binary
EZ_UNIQUE_PROFILE 1 unique profile per solve (set 0 for shared)
EZ_START_GAP 1.0 min seconds between Chrome launches
EZ_KEEP_PROFILE 0 keep unique profiles if 1

If it worked with original but not this fork

Pull latest and run the same way you ran original:

git pull
export EZ_NO_SANDBOX=1
python service.py

If you still see Permission denied: /tmp/ts_profile:

sudo rm -rf /tmp/ts_profile
export TS_PROFILE_DIR=$HOME/.cache/ezsolver/ts_profile
mkdir -p "$TS_PROFILE_DIR"
python service.py

If you still see Failed to connect to browser:

sudo apt install -y xvfb google-chrome-stable
export CHROME_PATH=/usr/bin/google-chrome-stable
python service.py

Credits

Original project by Ismoiloff: ismoiloffS/EzSolver


Long-running process hygiene

Each solve now:

  1. browser.stop()
  2. hard-kills leftover Chrome for that profile
  3. deletes unique profile dirs (w_*)

Service also runs a background janitor every EZ_JANITOR_SEC (default 120s).

Manual cleanup if needed:

pkill -f "chrome.*ts_profile" || true
rm -rf /tmp/ts_profile/w_* 2>/dev/null || true
ulimit -n 65535

If you see Too many open files, restart service with MAX_WORKERS=1 and raise ulimit -n.

About

Optimized/production-hardened fork of ismoiloffS/EzSolver. Same POST /solve API. Fixes Too many open files via unique profiles + Chrome process cleanup.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages