Merge pull request #516 from return42/searxng/filtron

[mod] filtron.sh - install github.com/searxng/filtron
This commit is contained in:
Markus Heiser 2021-11-23 00:23:23 +01:00 committed by GitHub
commit ef3f084c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 10 deletions

View file

@ -16,7 +16,7 @@ How to protect an instance
:local: :local:
:backlinks: entry :backlinks: entry
.. _filtron: https://github.com/asciimoo/filtron .. _filtron: https://github.com/searxng/filtron
SearXNG depends on external search services. To avoid the abuse of these services SearXNG depends on external search services. To avoid the abuse of these services
it is advised to limit the number of requests processed by SearXNG. it is advised to limit the number of requests processed by SearXNG.
@ -30,7 +30,7 @@ filtron & go
============ ============
.. _Go: https://golang.org/ .. _Go: https://golang.org/
.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md .. _filtron README: https://github.com/searxng/filtron/blob/master/README.md
Filtron needs Go_ installed. If Go_ is preinstalled, filtron_ is simply Filtron needs Go_ installed. If Go_ is preinstalled, filtron_ is simply
installed by ``go get`` package management (see `filtron README`_). If you use installed by ``go get`` package management (see `filtron README`_). If you use

View file

@ -48,6 +48,6 @@
.. code-block:: bash .. code-block:: bash
$ sudo -i -u \"${SERVICE_USER}\" $ sudo -i -u \"${SERVICE_USER}\"
(${SERVICE_USER}) $ go get -v -u github.com/asciimoo/filtron (${SERVICE_USER}) $ go get -v -u github.com/searxng/filtron
.. END install filtron .. END install filtron

View file

@ -13,8 +13,8 @@
<installation apache>`) <installation apache>`)
.. _Go: https://golang.org/ .. _Go: https://golang.org/
.. _filtron: https://github.com/asciimoo/filtron .. _filtron: https://github.com/searxng/filtron
.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md .. _filtron README: https://github.com/searxng/filtron/blob/master/README.md
To simplify installation and maintenance of a filtron instance you can use the To simplify installation and maintenance of a filtron instance you can use the
script :origin:`utils/filtron.sh`. In most cases you will install filtron_ script :origin:`utils/filtron.sh`. In most cases you will install filtron_
@ -30,7 +30,7 @@ into this user account:
#. Create a separated user account (``filtron``). #. Create a separated user account (``filtron``).
#. Download and install Go_ binary in user's $HOME (``~filtron``). #. Download and install Go_ binary in user's $HOME (``~filtron``).
#. Install filtron with the package management from Go_ (``go get -v -u #. Install filtron with the package management from Go_ (``go get -v -u
github.com/asciimoo/filtron``) github.com/searxng/filtron``)
#. Setup a proper rule configuration :origin:`[ref] #. Setup a proper rule configuration :origin:`[ref]
<utils/templates/etc/filtron/rules.json>` (``/etc/filtron/rules.json``). <utils/templates/etc/filtron/rules.json>` (``/etc/filtron/rules.json``).
#. Setup a systemd service unit :origin:`[ref] #. Setup a systemd service unit :origin:`[ref]

View file

@ -337,7 +337,8 @@ EOF
echo "export SERVICE_HOME=$SERVICE_HOME" echo "export SERVICE_HOME=$SERVICE_HOME"
tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" tee_stderr <<EOF | sudo -i -u "$SERVICE_USER"
grep -qFs -- 'source $GO_ENV' ~/.profile || echo 'source $GO_ENV' >> ~/.profile touch "$GO_ENV"
grep -qFs -- 'source "$GO_ENV"' ~/.profile || echo 'source "$GO_ENV"' >> ~/.profile
EOF EOF
} }
@ -348,13 +349,13 @@ filtron_is_installed() {
install_filtron() { install_filtron() {
rst_title "Install filtron in user's ~/go-apps" section rst_title "Install filtron in user's ~/go-apps" section
echo echo
go.install github.com/asciimoo/filtron@latest "${SERVICE_USER}" go.install github.com/searxng/filtron@latest "${SERVICE_USER}"
} }
update_filtron() { update_filtron() {
rst_title "Update filtron" section rst_title "Update filtron" section
echo echo
go.install github.com/asciimoo/filtron@latest "${SERVICE_USER}" go.install github.com/searxng/filtron@latest "${SERVICE_USER}"
} }
install_rules() { install_rules() {

View file

@ -337,7 +337,8 @@ EOF
echo "export SERVICE_HOME=$SERVICE_HOME" echo "export SERVICE_HOME=$SERVICE_HOME"
tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" tee_stderr <<EOF | sudo -i -u "$SERVICE_USER"
grep -qFs -- 'source $GO_ENV' ~/.profile || echo 'source $GO_ENV' >> ~/.profile touch $GO_ENV
grep -qFs -- 'source "$GO_ENV"' ~/.profile || echo 'source "$GO_ENV"' >> ~/.profile
EOF EOF
} }