FlareSolverr icon indicating copy to clipboard operation
FlareSolverr copied to clipboard

ARM build without Docker

Open LeVraiRoiDHyrule opened this issue 4 years ago • 10 comments

Hi,

Nearly all my indexers began to use Cloudflare protection. I would like to be able to use FlareSolverr but I'm on Raspberry pi 4, so ARM. I don't use docker as I have no app where it would be useful. I would like to be able to use flaresolverr directly with Jackett without the need of Docker.

Is that currently possible ? If not, I would like to suggest making it possible.

Thanks in advance

LeVraiRoiDHyrule avatar Feb 17 '21 12:02 LeVraiRoiDHyrule

I'm trying to do this too. I've got FlareSolverr successfully installed on a Pi (use the "source code / mac / dev" install directions) but it gives an error (but does not crash) when attempting to launch the browser/puppeteer.

Here's the installation steps I used (on a Pi 3):

sudo apt-get install npm
sudo npm install npm@latest -g
cd /opt/
sudo git clone https://github.com/FlareSolverr/FlareSolverr.git 
cd FlareSolverr
sudo npm install
sudo npm run build
sudo npm run start

It launches just fine, but when I have Jackett submit a test query, I get a syntax error from FlareSolverr:

2021-02-17T22:41:17.756Z INFO REQ-1 Incoming request: POST /v1
2021-02-17T22:41:17.776Z INFO REQ-1 Params: {"maxTimeout":60000,"cmd":"request.get","url":"https://ext.to/search/?q=test&order=age&sort=desc","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.35"}
Error: Failed to launch the browser process!
/opt/FlareSolverr/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: 22: /opt/FlareSolverr/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: Syntax error: "(" unexpected


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/opt/FlareSolverr/node_modules/puppeteer/lib/launcher/BrowserRunner.js:159:20)
    at Interface.helper_1.helper.addEventListener (/opt/FlareSolverr/node_modules/puppeteer/lib/launcher/BrowserRunner.js:149:65)
    at Interface.emit (events.js:203:15)
    at Interface.close (readline.js:397:8)
    at Socket.onend (readline.js:173:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
2021-02-17T22:41:18.123Z ERROR REQ-1 Failed to launch the browser process!
/opt/FlareSolverr/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: 22: /opt/FlareSolverr/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: Syntax error: "(" unexpected

bmn001 avatar Feb 18 '21 01:02 bmn001

"Puppeteer does not work on ARM based CPU." - https://github.com/FlareSolverr/FlareSolverr/pull/1

ilike2burnthing avatar Feb 18 '21 04:02 ilike2burnthing

Ah I see. FlareSolver itself lists ARM as a supported architecture, but the puppeteer component does not support ARM.

bmn001 avatar Feb 18 '21 16:02 bmn001

Docker being the workaround for that (afaik, haven't actually tried it).

ilike2burnthing avatar Feb 18 '21 17:02 ilike2burnthing

You can run flaresolverr on docker but keep the rest of your services normally. Personally, it works great

dmunozv04 avatar Feb 22 '21 22:02 dmunozv04

You can run flaresolverr on docker but keep the rest of your services normally. Personally, it works great

Yeah, I can but that's not optimal if I already have a lot of services without a single one in Docker, and adding docker to all my setup just for a service. I will try with that for now, but on the long term I would like to have a full non-docker ARM build if possible

LeVraiRoiDHyrule avatar Feb 28 '21 01:02 LeVraiRoiDHyrule

You can run flaresolverr on docker but keep the rest of your services normally. Personally, it works great

Yeah, I can but that's not optimal if I already have a lot of services without a single one in Docker, and adding docker to all my setup just for a service. I will try with that for now, but on the long term I would like to have a full non-docker ARM build if possible

I'm in the same boat as you. For the benefit of others who are running into this, here's the steps I used to install both Docker and FlareSolverr on a Raspberry Pi.

First, install Docker:

sudo apt update && sudo apt upgrade -VV
sudo reboot
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
rm get-docker.sh
sudo usermod -aG docker pi
sudo reboot

Finally, install FlareSolverr:

docker pull ghcr.io/flaresolverr/flaresolverr:latest
docker run -d \
  --name=flaresolverr \
  -p 8191:8191 \
  -e LOG_LEVEL=info \
  --restart unless-stopped \
  ghcr.io/flaresolverr/flaresolverr:latest

After a minute or two, FlareSolverr will be running on port 8191. It'll also be set to auto-run on every boot.

As for updating FlareSolverr, I'm not sure how to do that just yet. It might self-update? Or you might have to manually update the docker container every time there's a new release.

bmn001 avatar Mar 08 '21 21:03 bmn001

You can either manually update it or use Watchtower.

ilike2burnthing avatar Mar 08 '21 21:03 ilike2burnthing

I think the issue with an arm build is not being able to package a version of the driver (that works as a proxy )that will surely work with flaresolverr. For example, the raspberrypi foundation have different chrome builds with some changes

dmunozv04 avatar Mar 08 '21 21:03 dmunozv04

FlareSolverr can run in ARM and ARM64 using the Docker images. This is the recommended way, because:

  • You don't have to install Node and Chromium. Both packages are heavy and have a lot of dependencies. I have packed lightweight versions in the Docker image.
  • Docker images are tested by me and they include stable versions of all required packages. Furthermore the Docker images work in all Linux distributions with Docker support.
  • The overhead running Docker containers is low. I understand your concern but the Raspberry Pi 4 is more than capable of running dozens of Dockers.

If you want to install it from the source code you need to add more steps because Puppeteer is not able to install Chromium for ARM.

Instructions to install in ARM (not tested)

  1. Install chromium in the host OS: sudo apt-get install chromium
  2. Set the following environment variables. The Chomium path is just an example, find the chromium executable in your machine.
ENV PUPPETEER_PRODUCT=chrome \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
  1. Run npm install command to install FlareSolverr dependencies
  2. Run npm run build command to compile TypeScript code
  3. Run npm start command to start FlareSolverr

Let me know if it works for you. I will write the instructions in the Wiki.

ngosang avatar Mar 24 '21 22:03 ngosang

I recommend you to install FlareSolverr v3 with Docker. It's also possible to install from source code, read the readme. We are not providing binaries for FlareSolverr v3 but I will think about. #660

ngosang avatar Jan 06 '23 17:01 ngosang