2020-06-19 11:15:15 +02:00
<!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" / >
2020-09-30 10:35:05 +02:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
2020-06-19 11:15:15 +02:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2021-03-27 20:39:04 +01:00
< title > utils/filtron.sh — Searx Documentation (Searx-1.0.0.tex)< / title >
2020-06-19 11:15:15 +02:00
< link rel = "stylesheet" href = "../_static/pygments.css" type = "text/css" / >
2021-01-05 16:45:49 +01:00
< link rel = "stylesheet" href = "../_static/searx.css" type = "text/css" / >
2021-02-17 20:54:37 +01:00
< link rel = "stylesheet" type = "text/css" href = "../_static/tabs.css" / >
2020-06-19 11:15:15 +02:00
< script id = "documentation_options" data-url_root = "../" src = "../_static/documentation_options.js" > < / script >
< script src = "../_static/jquery.js" > < / script >
< script src = "../_static/underscore.js" > < / script >
< script src = "../_static/doctools.js" > < / script >
2021-02-17 20:54:37 +01:00
< script src = "../_static/tabs.js" > < / script >
2020-06-19 11:15:15 +02:00
< link rel = "index" title = "Index" href = "../genindex.html" / >
< link rel = "search" title = "Search" href = "../search.html" / >
< link rel = "next" title = "utils/morty.sh" href = "morty.sh.html" / >
< link rel = "prev" title = "utils/searx.sh" href = "searx.sh.html" / >
< script > DOCUMENTATION _OPTIONS . URL _ROOT = '../' ; < / script >
< / head > < body >
< div class = "related" role = "navigation" aria-label = "related navigation" >
< h3 > Navigation< / h3 >
< ul >
< li class = "right" style = "margin-right: 10px" >
< a href = "../genindex.html" title = "General Index"
accesskey="I">index< / a > < / li >
2020-11-04 14:12:59 +01:00
< li class = "right" >
< a href = "../py-modindex.html" title = "Python Module Index"
>modules< / a > |< / li >
2020-06-19 11:15:15 +02:00
< li class = "right" >
< a href = "morty.sh.html" title = "utils/morty.sh"
accesskey="N">next< / a > |< / li >
< li class = "right" >
< a href = "searx.sh.html" title = "utils/searx.sh"
accesskey="P">previous< / a > |< / li >
2021-03-27 20:39:04 +01:00
< li class = "nav-item nav-item-0" > < a href = "../index.html" > Searx Documentation (Searx-1.0.0.tex)< / a > » < / li >
2021-03-05 09:46:32 +01:00
< li class = "nav-item nav-item-1" > < a href = "index.html" accesskey = "U" > Tooling box < code class = "docutils literal notranslate" > < span class = "pre" > utils< / span > < / code > for administrators< / a > » < / li >
2020-09-30 10:35:05 +02:00
< li class = "nav-item nav-item-this" > < a href = "" > < code class = "docutils literal notranslate" > < span class = "pre" > utils/filtron.sh< / span > < / code > < / a > < / li >
2020-06-19 11:15:15 +02:00
< / ul >
< / div >
< div class = "document" >
< div class = "documentwrapper" >
< div class = "bodywrapper" >
< div class = "body" role = "main" >
2021-04-08 19:47:22 +02:00
< div class = "section" id = "utils-filtron-sh" >
2020-06-19 11:15:15 +02:00
< span id = "filtron-sh" > < / span > < h1 > < code class = "docutils literal notranslate" > < span class = "pre" > utils/filtron.sh< / span > < / code > < a class = "headerlink" href = "#utils-filtron-sh" title = "Permalink to this headline" > ¶< / a > < / h1 >
2021-04-08 19:47:22 +02:00
< div class = "sidebar" >
2020-06-19 11:15:15 +02:00
< p class = "sidebar-title" > further reading< / p >
< ul class = "simple" >
< li > < p > < a class = "reference internal" href = "../admin/filtron.html#searx-filtron" > < span class = "std std-ref" > How to protect an instance< / span > < / a > < / p > < / li >
< li > < p > < a class = "reference internal" href = "../admin/architecture.html#architecture" > < span class = "std std-ref" > Architecture< / span > < / a > < / p > < / li >
< li > < p > < a class = "reference internal" href = "../admin/installation.html#installation" > < span class = "std std-ref" > Installation< / span > < / a > (< a class = "reference internal" href = "../admin/installation-nginx.html#installation-nginx" > < span class = "std std-ref" > nginx< / span > < / a > & < a class = "reference internal" href = "../admin/installation-apache.html#installation-apache" > < span class = "std std-ref" > apache< / span > < / a > )< / p > < / li >
< / ul >
2021-04-08 19:47:22 +02:00
< / div >
2020-06-19 11:15:15 +02:00
< p > To simplify installation and maintenance of a filtron instance you can use the
2020-09-30 10:35:05 +02:00
script < a class = "reference external" href = "https://github.com/searx/searx/blob/master/utils/filtron.sh" > git://utils/filtron.sh< / a > . In most cases you will install < a class = "reference external" href = "https://github.com/asciimoo/filtron" > filtron< / a >
2020-06-19 11:15:15 +02:00
simply by running the command:< / p >
< div class = "highlight-bash notranslate" > < div class = "highlight" > < pre > < span > < / span > sudo -H ./utils/filtron.sh install all
< / pre > < / div >
< / div >
< p > The script adds a < code class = "docutils literal notranslate" > < span class = "pre" > ${SERVICE_USER}< / span > < / code > (default:< code class = "docutils literal notranslate" > < span class = "pre" > filtron< / span > < / code > ) and installs < a class = "reference external" href = "https://github.com/asciimoo/filtron" > filtron< / a >
into this user account:< / p >
< ol class = "arabic simple" >
< li > < p > Create a separated user account (< code class = "docutils literal notranslate" > < span class = "pre" > filtron< / span > < / code > ).< / p > < / li >
< li > < p > Download and install < a class = "reference external" href = "https://golang.org/" > Go< / a > binary in user’ s $HOME (< code class = "docutils literal notranslate" > < span class = "pre" > ~filtron< / span > < / code > ).< / p > < / li >
< li > < p > Install filtron with the package management from < a class = "reference external" href = "https://golang.org/" > Go< / a > (< code class = "docutils literal notranslate" > < span class = "pre" > go< / span > < span class = "pre" > get< / span > < span class = "pre" > -v< / span > < span class = "pre" > -u< / span >
< span class = "pre" > github.com/asciimoo/filtron< / span > < / code > )< / p > < / li >
2020-09-30 10:35:05 +02:00
< li > < p > Setup a proper rule configuration < a class = "reference external" href = "https://github.com/searx/searx/blob/master/utils/templates/etc/filtron/rules.json" > [ref]< / a > (< code class = "docutils literal notranslate" > < span class = "pre" > /etc/filtron/rules.json< / span > < / code > ).< / p > < / li >
< li > < p > Setup a systemd service unit < a class = "reference external" href = "https://github.com/searx/searx/blob/master/utils/templates/lib/systemd/system/filtron.service" > [ref]< / a >
2020-06-19 11:15:15 +02:00
(< code class = "docutils literal notranslate" > < span class = "pre" > /lib/systemd/system/filtron.service< / span > < / code > ).< / p > < / li >
< / ol >
2021-04-08 19:47:22 +02:00
< div class = "section" id = "create-user" >
2020-06-19 11:15:15 +02:00
< h2 > Create user< a class = "headerlink" href = "#create-user" title = "Permalink to this headline" > ¶< / a > < / h2 >
< div class = "sphinx-tabs docutils container" >
2021-03-12 20:15:53 +01:00
< div aria-label = "Tabbed content" class = "closeable" role = "tablist" > < button aria-controls = "panel-0-YmFzaA==" aria-selected = "true" class = "sphinx-tabs-tab group-tab" id = "tab-0-YmFzaA==" name = "YmFzaA==" role = "tab" tabindex = "0" > bash< / button > < / div > < div aria-labelledby = "tab-0-YmFzaA==" class = "sphinx-tabs-panel group-tab" id = "panel-0-YmFzaA==" name = "YmFzaA==" role = "tabpanel" tabindex = "0" > < div class = "highlight-sh notranslate" > < div class = "highlight" > < pre > < span > < / span > $ sudo -H useradd --shell /bin/bash --system < span class = "se" > \< / span >
2020-11-02 10:24:29 +01:00
--home-dir < span class = "s2" > " /usr/local/filtron" < / span > < span class = "se" > \< / span >
--comment < span class = "s2" > " Privacy-respecting metasearch engine" < / span > filtron
2020-06-19 11:15:15 +02:00
2020-11-02 10:24:29 +01:00
$ sudo -H mkdir < span class = "s2" > " /usr/local/filtron" < / span >
$ sudo -H chown -R < span class = "s2" > " filtron:filtron" < / span > < span class = "s2" > " /usr/local/filtron" < / span >
2020-06-19 11:15:15 +02:00
< / pre > < / div >
< / div >
2021-02-17 20:54:37 +01:00
< / div > < / div >
2021-04-08 19:47:22 +02:00
< / div >
< div class = "section" id = "install-go" >
2020-06-19 11:15:15 +02:00
< h2 > Install go< a class = "headerlink" href = "#install-go" title = "Permalink to this headline" > ¶< / a > < / h2 >
< div class = "sphinx-tabs docutils container" >
2021-03-12 20:15:53 +01:00
< div aria-label = "Tabbed content" class = "closeable" role = "tablist" > < button aria-controls = "panel-1-YmFzaA==" aria-selected = "true" class = "sphinx-tabs-tab group-tab" id = "tab-1-YmFzaA==" name = "YmFzaA==" role = "tab" tabindex = "0" > bash< / button > < / div > < div aria-labelledby = "tab-1-YmFzaA==" class = "sphinx-tabs-panel group-tab" id = "panel-1-YmFzaA==" name = "YmFzaA==" role = "tabpanel" tabindex = "0" > < div class = "highlight-bash notranslate" > < div class = "highlight" > < pre > < span > < / span > $ cat > < span class = "s2" > " /usr/local/filtron/.go_env" < / span > < span class = "s" > < < EOF< / span >
2020-06-19 11:15:15 +02:00
< span class = "s" > export GOPATH=/usr/local/filtron/go-apps< / span >
< span class = "s" > export PATH=$PATH:/usr/local/filtron/local/go/bin:$GOPATH/bin< / span >
< span class = "s" > EOF< / span >
2020-11-02 10:24:29 +01:00
$ sudo -i -u < span class = "s2" > " filtron" < / span >
2020-06-19 11:15:15 +02:00
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ < span class = "nb" > echo< / span > < span class = "s1" > ' source /usr/local/filtron/.go_env' < / span > > > ~/.profile
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ mkdir /usr/local/filtron/local
2020-11-02 10:24:29 +01:00
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ wget --progress< span class = "o" > =< / span > bar -O < span class = "s2" > " go1.13.5.linux-amd64.tar.gz" < / span > < span class = "se" > \< / span >
< span class = "s2" > " https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz" < / span >
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ tar -C /usr/local/filtron/local -xzf < span class = "s2" > " go1.13.5.linux-amd64.tar.gz" < / span >
2020-06-19 11:15:15 +02:00
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ which go
/usr/local/filtron/local/go/bin/go
< / pre > < / div >
< / div >
2021-02-17 20:54:37 +01:00
< / div > < / div >
2021-04-08 19:47:22 +02:00
< / div >
< div class = "section" id = "install-filtron" >
2020-06-19 11:15:15 +02:00
< h2 > Install filtron< a class = "headerlink" href = "#install-filtron" title = "Permalink to this headline" > ¶< / a > < / h2 >
2020-09-30 10:35:05 +02:00
< p > Install < a class = "reference external" href = "https://github.com/searx/searx/blob/master/utils/templates/etc/filtron/rules.json" > rules.json< / a > at
2020-06-19 11:15:15 +02:00
< code class = "docutils literal notranslate" > < span class = "pre" > /etc/filtron/rules.json< / span > < / code > (see < a class = "reference internal" href = "../admin/filtron.html#sample-configuration-of-filtron" > < span class = "std std-ref" > Sample configuration of filtron< / span > < / a > ) and
install filtron software and systemd unit:< / p >
< div class = "sphinx-tabs docutils container" >
2021-03-12 20:15:53 +01:00
< div aria-label = "Tabbed content" class = "closeable" role = "tablist" > < button aria-controls = "panel-2-YmFzaA==" aria-selected = "true" class = "sphinx-tabs-tab group-tab" id = "tab-2-YmFzaA==" name = "YmFzaA==" role = "tab" tabindex = "0" > bash< / button > < / div > < div aria-labelledby = "tab-2-YmFzaA==" class = "sphinx-tabs-panel group-tab" id = "panel-2-YmFzaA==" name = "YmFzaA==" role = "tabpanel" tabindex = "0" > < div class = "highlight-bash notranslate" > < div class = "highlight" > < pre > < span > < / span > $ sudo -i -u < span class = "s2" > " filtron" < / span >
2020-06-19 11:15:15 +02:00
< span class = "o" > (< / span > filtron< span class = "o" > )< / span > $ go get -v -u github.com/asciimoo/filtron
< / pre > < / div >
< / div >
2021-02-17 20:54:37 +01:00
< / div > < / div >
2020-06-19 11:15:15 +02:00
< div class = "sphinx-tabs docutils container" >
2021-03-12 20:15:53 +01:00
< div aria-label = "Tabbed content" class = "closeable" role = "tablist" > < button aria-controls = "panel-3-c3lzdGVtZA==" aria-selected = "true" class = "sphinx-tabs-tab group-tab" id = "tab-3-c3lzdGVtZA==" name = "c3lzdGVtZA==" role = "tab" tabindex = "0" > systemd< / button > < / div > < div aria-labelledby = "tab-3-c3lzdGVtZA==" class = "sphinx-tabs-panel group-tab" id = "panel-3-c3lzdGVtZA==" name = "c3lzdGVtZA==" role = "tabpanel" tabindex = "0" > < div class = "highlight-bash notranslate" > < div class = "highlight" > < pre > < span > < / span > < span class = "o" > [< / span > Unit< span class = "o" > ]< / span >
2020-06-19 11:15:15 +02:00
< span class = "nv" > Description< / span > < span class = "o" > =< / span > filtron
< span class = "nv" > After< / span > < span class = "o" > =< / span > syslog.target
< span class = "nv" > After< / span > < span class = "o" > =< / span > network.target
< span class = "o" > [< / span > Service< span class = "o" > ]< / span >
< span class = "nv" > Type< / span > < span class = "o" > =< / span > simple
< span class = "nv" > User< / span > < span class = "o" > =< / span > filtron
< span class = "nv" > Group< / span > < span class = "o" > =< / span > filtron
< span class = "nv" > WorkingDirectory< / span > < span class = "o" > =< / span > /usr/local/filtron
< span class = "nv" > ExecStart< / span > < span class = "o" > =< / span > /usr/local/filtron/go-apps/bin/filtron -api < span class = "s1" > ' 127.0.0.1:4005' < / span > -listen < span class = "s1" > ' 127.0.0.1:4004' < / span > -rules < span class = "s1" > ' /etc/filtron/rules.json' < / span > -target < span class = "s1" > ' 127.0.0.1:8888' < / span >
< span class = "nv" > Restart< / span > < span class = "o" > =< / span > always
< span class = "nv" > Environment< / span > < span class = "o" > =< / span > < span class = "nv" > USER< / span > < span class = "o" > =< / span > filtron < span class = "nv" > HOME< / span > < span class = "o" > =< / span > /usr/local/filtron
< span class = "c1" > # Some distributions may not support these hardening directives. If you cannot< / span >
< span class = "c1" > # start the service due to an unknown option, comment out the ones not supported< / span >
< span class = "c1" > # by your version of systemd.< / span >
< span class = "nv" > ProtectSystem< / span > < span class = "o" > =< / span > full
< span class = "nv" > PrivateDevices< / span > < span class = "o" > =< / span > yes
< span class = "nv" > PrivateTmp< / span > < span class = "o" > =< / span > yes
< span class = "nv" > NoNewPrivileges< / span > < span class = "o" > =< / span > < span class = "nb" > true< / span >
< span class = "o" > [< / span > Install< span class = "o" > ]< / span >
< span class = "nv" > WantedBy< / span > < span class = "o" > =< / span > multi-user.target
< / pre > < / div >
< / div >
2021-02-17 20:54:37 +01:00
< / div > < / div >
2021-04-08 19:47:22 +02:00
< / div >
< div class = "section" id = "overview" >
2020-06-19 11:15:15 +02:00
< span id = "filtron-sh-overview" > < / span > < h2 > Overview< a class = "headerlink" href = "#overview" title = "Permalink to this headline" > ¶< / a > < / h2 >
< p > The < code class = "docutils literal notranslate" > < span class = "pre" > --help< / span > < / code > output of the script is largely self-explanatory
(< a class = "reference internal" href = "index.html#toolboxing-common" > < span class = "std std-ref" > Common commands & environment< / span > < / a > ):< / p >
< div class = "highlight-text notranslate" > < div class = "highlight" > < pre > < span > < / span > usage::
filtron.sh shell
filtron.sh install [all|user|rules]
filtron.sh update [filtron]
filtron.sh remove [all]
filtron.sh activate [service]
filtron.sh deactivate [service]
filtron.sh inspect [service]
filtron.sh option [debug-on|debug-off]
filtron.sh apache [install|remove]
filtron.sh nginx [install|remove]
shell
start interactive shell from user filtron
install / remove
:all: complete setup of filtron service
:user: add/remove service user ' filtron' (/usr/local/filtron)
:rules: reinstall filtron rules /etc/filtron/rules.json
update filtron
Update filtron installation (/usr/local/filtron)
activate service
activate and start service daemon (systemd unit)
deactivate service
stop and deactivate service daemon (systemd unit)
inspect service
show service status and log
option
set one of the available options
2021-04-11 14:49:16 +02:00
apache (http://fv-az150-89/searx)
2020-06-19 11:15:15 +02:00
:install: apache site with a reverse proxy (ProxyPass)
:remove: apache site searx.conf
2021-04-11 14:49:16 +02:00
nginx (http://fv-az150-89/searx)
2020-06-19 11:15:15 +02:00
:install: nginx site with a reverse proxy (ProxyPass)
:remove: nginx site searx.conf
filtron rules: /etc/filtron/rules.json
If needed, set PUBLIC_URL of your WEB service in the ' .config.sh' file::
2021-04-11 14:49:16 +02:00
PUBLIC_URL : http://fv-az150-89/searx
PUBLIC_HOST : fv-az150-89
2020-06-19 11:15:15 +02:00
SERVICE_USER : filtron
FILTRON_TARGET : 127.0.0.1:8888
FILTRON_API : 127.0.0.1:4005
FILTRON_LISTEN : 127.0.0.1:4004
< / pre > < / div >
< / div >
2021-04-08 19:47:22 +02:00
< / div >
< / div >
2020-06-19 11:15:15 +02:00
2020-09-30 10:35:05 +02:00
< div class = "clearer" > < / div >
2020-06-19 11:15:15 +02:00
< / div >
< / div >
< / div >
< span id = "sidebar-top" > < / span >
< div class = "sphinxsidebar" role = "navigation" aria-label = "main navigation" >
< div class = "sphinxsidebarwrapper" >
< p class = "logo" > < a href = "../index.html" >
< img class = "logo" src = "../_static/searx_logo_small.png" alt = "Logo" / >
< / a > < / p >
< h3 > Project Links< / h3 >
< ul >
2020-09-30 10:35:05 +02:00
< li > < a href = "https://github.com/searx/searx" > Source< / a >
2020-06-19 11:15:15 +02:00
2020-09-30 10:35:05 +02:00
< li > < a href = "https://github.com/searx/searx/wiki" > Wiki< / a >
2020-06-19 11:15:15 +02:00
2021-01-12 10:55:12 +01:00
< li > < a href = "https://searx.space" > Public instances< / a >
2020-06-19 11:15:15 +02:00
< li > < a href = "https://twitter.com/Searx_engine" > Twitter< / a >
2021-01-12 10:55:12 +01:00
< li > < a href = "https://github.com/searx/searx/issues" > Issue Tracker< / a >
2020-06-19 11:15:15 +02:00
< / ul > < h3 > Navigation< / h3 >
< ul >
< li > < a href = "../index.html" > Overview< / a >
< ul >
2021-03-05 09:46:32 +01:00
< li > < a href = "index.html" > Tooling box < code class = "docutils literal notranslate" > < span class = "pre" > utils< / span > < / code > for administrators< / a >
2020-06-19 11:15:15 +02:00
< ul >
< li > Previous: < a href = "searx.sh.html" title = "previous chapter" > < code class = "docutils literal notranslate" > < span class = "pre" > utils/searx.sh< / span > < / code > < / a >
< li > Next: < a href = "morty.sh.html" title = "next chapter" > < code class = "docutils literal notranslate" > < span class = "pre" > utils/morty.sh< / span > < / code > < / a > < / ul >
< / li >
< / ul >
< / li >
< / ul >
< div id = "searchbox" style = "display: none" role = "search" >
< h3 id = "searchlabel" > Quick search< / h3 >
< div class = "searchformwrapper" >
< form class = "search" action = "../search.html" method = "get" >
< input type = "text" name = "q" aria-labelledby = "searchlabel" / >
< input type = "submit" value = "Go" / >
< / form >
< / div >
< / div >
< script > $ ( '#searchbox' ) . show ( 0 ) ; < / script >
< / div >
< / div >
< div class = "clearer" > < / div >
< / div >
< div class = "footer" role = "contentinfo" >
© Copyright 2015-2020, Adam Tauber, Noémi Ványi.
2021-04-03 23:51:52 +02:00
Created using < a href = "https://www.sphinx-doc.org/" > Sphinx< / a > 3.5.3.
2020-06-19 11:15:15 +02:00
< / div >
< script src = "../_static/version_warning_offset.js" > < / script >
< / body >
< / html >