NoahCardoza / CloudProxy

Proxy server to bypass Cloudflare protection.
MIT License
537 stars 62 forks source link

Npm build / Docker build fails #49

Closed grobek closed 3 years ago

grobek commented 3 years ago

Describe the bug I wasn't able to compile the source code using docker build -t cloudproxy:latest . (or not inside the docker, it doesn't really matter in that case), it would give me the following errors:

1 package is looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 7.0.8 -> 7.14.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.14.0>
npm notice Run `npm install -g npm@7.14.0` to update!
npm notice

> cloud-proxy@2.1.1 build
> tsc

src/captcha/anti-captcha.ts(3,53): error TS2339: Property 'userAgent' does not exist on type 'SolverOptions'.
src/captcha/anti-captcha.ts(3,64): error TS2339: Property 'proxy' does not exist on type 'SolverOptions'.
src/captcha/anti-captcha.ts(3,71): error TS2339: Property 'apiKey' does not exist on type 'SolverOptions'.
npm notice
npm notice New minor version of npm available! 7.0.8 -> 7.14.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.14.0>
npm notice Run `npm install -g npm@7.14.0` to update!
npm notice
npm ERR! code 2
npm ERR! path /home/node/cloudproxy
npm ERR! command failed
npm ERR! command sh -c tsc

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2021-05-25T12_44_18_247Z-debug.log
The command '/bin/sh -c npm install &&     npm run build &&     rm -rf src tsconfig.json &&     npm prune --production' returned a non-zero code: 2

To Reproduce Steps to reproduce the behavior: docker build -t somename:latest .

Expected behavior A docker image of the program.

Suggested Solution So I've done some digging and I found out the following commit broke the code: https://github.com/NoahCardoza/CloudProxy/commit/280a640d814e39aac9f459b8214ed1b8efd080ff so I reverted that commit using

git revert 280a640d814e39aac9f459b8214ed1b8efd080ff

and then everything seemed to compile and build successfully, and afterwards I tested the program against a website I wanted to try, and it succeeded.

I hope it would be of some help.

NoahCardoza commented 3 years ago

Great work!

It just occurred to me that this issue stems from a captcha plugin someone added...

I'd rather fix that issue than revert, so if anyone wants to open a PR that would be great! Otherwise it might take me a little time to get to it.

Btw, does it still bypass CF @grobek ? I heard they were changing things around as you probably saw us chatting about in the Discord server...

Thanks a bunch for your work though!

grobek commented 3 years ago

Hey @NoahCardoza, yes, it does still pass CF, just now the only thing that’s needed to utilize is browser agent, ip and the generated cf_clearance. Though I didn’t try to check if it passes captcha and whatnot.

NoahCardoza commented 3 years ago

Great to hear! I think this should be a somewhat simple fix. Some more fields need to be added to the SolverOptions interface it looks like.