Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

doc for freebsd13.1 and flaresolverr3.1.2#748

furonair started this conversation inShow and tell
Discussion options

Here are the instructions in order to getFlareSolverr configured and running at boot in aFreeBSD system or in aFreeBSD jail (which is my case).

This was made in freebsd 13.1-RELEASE-p6 in jail.

All instructions consider that you will be using theroot user to execute the commands and flaresover will runflaresolver with flaresolver user. Some caveat from the script for to do someparticular things.

I'll not enter in details about creation of jails.
But this should work to on the FreeBSD host OS.

1. Check if you need to set your date/time

rm /etc/localtimeln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

2. Update and upgrade your packages

Before anything else, make sure that your packages are updated and upgraded:

pkg updatepkg upgrade

3. Get FlareSolverr

Here you have the option to useGit or download the sources directly. It doesn't matter what you choose, the final product will be the same.

The advantage of theGit way is that it is easier to keepFlareSolverr updated.

So, follow 3.1 or 3.2, as you wish.

3.1 Using Git

Install the git-tiny package:

pkg install git-tiny

Then go to /usr/local/share folder and clone the repository:

cd /tmp/git clone https://github.com/FlareSolverr/FlareSolverr.git

3.2 Using Zip

Go to theFlareSolverr Github page, click onCode, then right-click on "Download ZIP" and then choose "Copy link address":

image

Then execute thefetch command to download the zip file, by pasting the copied address in the command line, and then run theunzip command to extract it:

cd /tmp/fetch https://github.com/FlareSolverr/FlareSolverr/archive/refs/heads/master.zipunzip master.zip

4. Installing the necessary packages and load necessary kernel module

Once you have the FlareSolverr source code downloaded through Git or Zip in /usr/local/share/FlareSolverr, the next step is to download the necessary packages.

4.1 Load Kernel module

Load kernel module required by linux compatibility package (probably just linux64 is required but is not my case and I did test). If you do please confirm.

#to load kernels module nowkldload -n -v linuxkldload -n -v linux64#to load kernels module at bootsysrc kld_list+="linux"sysrc kld_list+="linux64"

4.2 Install package

Install these packages and all their required dependencies:

pkg install python39 py39-pip chromium xorg-vfbserver linux_base-c7

158 of packages aprox should be installed and will require near a 3GiB of storage.

5. Installing virtuaenv and requirement

To keep most of thing clean on the host after the build will be completed

5.1. virtual

pip install virtualenv

5.2. Create and activate virtual env

virtualenv /tmp/venvsource /tmp/venv/bin/activate.csh

5.3. Installing requirements

cd /tmp/FlareSolverr-masterpip install pyinstallerpip install -r requirements.txtpip install -r test-requirements.txt

6. building the apps

cd ./src/python3 build_package.pycd ..

7. Doing somes particulars things to make it work!

7.1. Special folders

Thoses things are requireds because the program ask for access to particular folder.

mkdir /appchmod 777 /appmkdir /.undetected_chromedriverchmod 755 /.undetected_chromedrivermkdir /root/.undetected_chromedriverchmod 755 /root/.undetected_chromedrivercp /usr/local/bin/chromedriver /app/chromedriverchmod 777 /app/chromedrivercp /usr/local/bin/chromedriver /app/chromedriver.exechmod 777 /app/chromedriver.exe

7.3. Linux compatibility

Thoses things ar required for linux compatibility.

rm -rf ./dist/package/flaresolverr/chrome/*cp /usr/local/bin/chrome ./dist/package/flaresolverr/chrome/chrome#showing the ELF mark on the filebrandelf ./dist/package/flaresolverr/*.so.*#change the ELF mark on the file (if is not 'Linux')brandelf -t Linux ./dist/package/flaresolverr/*.so.*#showing the result of the changebrandelf ./dist/package/flaresolverr/*.so.*# seams to be a a bug of the linux compatibility package installed earlier the file did not exist, created the file with# a simlink with a existing simlink in the hope it will be easier to find than the real fileln -s /compat/linux/usr/lib64/libc.so.6 /compat/linux/usr/lib64/libc.so.7

8. Create user

pw useradd flaresolverr -s /usr/sbin/nologin

9. Moving folder and changing owner and permission

mv ./dist/package/flaresolverr /usr/local/share/flaresolverrchown -R flaresolverr:flaresolverr /usr/local/share/flaresolverrchmod -R 770 /usr/local/share/flaresolverr

10. Create the rc.d config file to define the service

create the file

touch /usr/local/etc/rc.d/flaresolverrchmod 755 /usr/local/etc/rc.d/flaresolverr

edit the file with your prefered text editor

#!/bin/sh## PROVIDE: flaresolverr# REQUIRE: networking# KEYWORD: shutdown# flaresolverr_enable="YES". /etc/rc.subrname="flaresolverr"rcvar="flaresolverr_enable"flaresolverr_log_file="/var/log/flaresolverr/flaresolverr.log"start_precmd=flaresolverr_prestartstop_postcmd=flaresolverr_poststopload_rc_config ${name}# Defaults# Usable parameter in rc.conf with those default parameter: ${flaresolverr_enable:=NO}: ${flaresolverr_deamon_user:=flaresolverr}: ${flaresolverr_path:="/usr/local/share/flaresolverr"}: ${flaresolverr_LOG_LEVEL:="info"}: ${flaresolverr_LOG_HTML:="false"}: ${flaresolverr_CAPTCHA_SOLVER:="false"}: ${flaresolverr_TZ:="UTC"}: ${flaresolverr_HEADLESS:="true"}: ${flaresolverr_BROWSER_TIMEOUT:="40000"}: ${flaresolverr_PORT:="8191"}: ${flaresolverr_HOST:="0.0.0.0"}: ${flaresolverr_TEST_URL:="https://www.google.com"}pidfile_deamon="/var/run/flaresolverr/flaresolverr_deamon.pid"pidfile_child="/var/run/flaresolverr/flaresolverr_child.pid"procname="${flaresolverr_path}/flaresolverr"command="/usr/sbin/daemon"command_args="-f -p ${pidfile_child} -P ${pidfile_deamon} -o $flaresolverr_log_file -u ${flaresolverr_deamon_user} ${flaresolverr_path}/flaresolverr"flaresolverr_prestart(){    install -d -o root -g $flaresolverr_deamon_user /var/run/flaresolverr    install -d -o root -g $flaresolverr_deamon_user /var/log/flaresolverr    export LOG_LEVEL=$flaresolverr_LOG_LEVEL    export LOG_HTML=$flaresolverr_LOG_HTML    export CAPTCHA_SOLVER=$flaresolverr_CAPTCHA_SOLVER    export TZ=$flaresolverr_TZ    export HEADLESS=$flaresolverr_HEADLESS    export BROWSER_TIMEOUT=$flaresolverr_BROWSER_TIMEOUT    export PORT=$flaresolverr_PORT    export HOST=$flaresolverr_HOST    export TEST_URL=$flaresolverr_TEST_URL    }flaresolverr_poststop(){    sleep 2    killall -u ${flaresolverr_deamon_user} -c Xvfb}run_rc_command "$1"

11. Clean no more usefull files and folders

rm -rf /tmp/venv
rm -rf /tmp/FlareSolverr-master
rm -rf /tmp/build
rm -rf /tmp/master.zip

12. Enable service in rc.conf and start the deamon

sysrc flaresolverr_enable="YES"

You could find all allowed parameter to be used with the rc.d script within the file and configure the parameter with sysrc
Those parameter will be loaded as variable env

ex:

sysrc flaresolverr_PORT="80"

Now you should be able to start the deamon and enjoye!

service flaresolverr startservice flaresolverr statustail -f /var/log/flaresolverr/flaresolverr.log
You must be logged in to vote

Replies: 5 comments 9 replies

Comment options

Could you review and update this page in the Wiki?
https://github.com/FlareSolverr/FlareSolverr/wiki/Installing-FlareSolverr-in-FreeBSD-or-FreeNAS-TrueNAS-jail

You must be logged in to vote
2 replies
@furonair
Comment options

Since is done for version 2.x in with node JS this page is not relevant anymore. I didn't have the right to do change or propose change in the wiki to add the information I added in this discution. I will be glade to add this to the wiki for reference.

@ngosang
Comment options

I changed the Wiki. Thank you!

Comment options

updated to follow the change in 3.1.2

You must be logged in to vote
1 reply
@ilike2burnthing
Comment options

Thanks, updated.

Comment options

@ilike2burnthing Would you be able to review the information that I posted here:#95 (comment) and update the Wiki accordingly? I ran into a few issues when following the the guide and hope that the additional info helps anyone else that might find it helpful. Thanks. :)

You must be logged in to vote
4 replies
@dbolser
Comment options

Thanks@FroggMaster, did this get updated, or should I follow the guide here + your guide? (Or the guide on the wiki?) Where is the definitive guide :-)

Cheers,

@ilike2burnthing
Comment options

Click the linked issue and scroll down.

@dbolser
Comment options

So sorry, which link? It says 'LEGACY' is this whole guide old?

I'm seeing this error:

(venv) root@flaresolverr:/tmp/FlareSolverr # tail -f /var/log/flaresolverr/flaresolverr.log2025-01-25 18:04:55 INFO     FlareSolverr 3.3.212025-01-25 18:04:55 INFO     Testing web browser installation...2025-01-25 18:04:55 INFO     Platform: FreeBSD-14.2-RELEASE-amd64-64bit-ELF2025-01-25 18:04:55 INFO     Chrome / Chromium path: /usr/local/share/flaresolverr/_internal/chrome/chrome/usr/local/share/flaresolverr/_internal/chrome/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory2025-01-25 18:04:55 ERROR    Chrome / Chromium version not detected!

I know I'm being stupid, but I can normally follow a guide... don't know what I'm doing wrong.

@ilike2burnthing
Comment options

The only link in the comment you're replying to.

To skip a few steps here -https://github.com/FlareSolverr/FlareSolverr#from-source-code-freebsdtruenas-core

Comment options

Thanks@furonair, is the key information here getting all the versions lined up in a 'working' state, or is it around setting up the permissions / users 'just right'? I did the latter but still got issues, which I suspect may be related to versions (see#1434).

If versions are the sticking point, I'll try to create a 'matrix' of python / FlareSolverr / FreeBSD where it works vs. fails.

You must be logged in to vote
0 replies
Comment options

Right... Those instructions aren't working for me unfortunately.
On Mon, 27 Jan 2025 at 02:44, ilike2burnthing ***@***.***> wrote: The only link in the comment you're replying to. To skip a few steps here -https://github.com/FlareSolverr/FlareSolverr#from-source-code-freebsdtruenas-core — Reply to this email directly, view it on GitHub <#748 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAA7NE636V4DUAKWLSJ55JL2MWMRHAVCNFSM6AAAAABVQDQNUGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJWGM4TMNY> . You are receiving this because you commented.Message ID: ***@***.*** com>
You must be logged in to vote
2 replies
@ilike2burnthing
Comment options

Given the error, did you run this?

pkg install nss

@dbolser
Comment options

Thanks so much again@ilike2burnthing, in fact the above error was related to the out of date node version (I was following the old guide by mistake). On the new guide, on the forked code, it works :-) 🎉

Sorry for all the noise I've generated on the issues / discussion.

For absolute clarity (for idiots like me):

WORKING VERSION:

I needed to edit the code to point to chrome, but then it works.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
5 participants
@furonair@dbolser@ngosang@FroggMaster@ilike2burnthing

[8]ページ先頭

©2009-2025 Movatter.jp