Commit Graph

362 Commits

Author SHA1 Message Date
Markus Heiser
64100db904 [doc] improve documentation of make targets and ./manage script
BTW force modularization of the ./mange script into sub modules:

- utils/lib_sxng_data.sh
- utils/lib_sxng_node.sh
- utils/lib_sxng_static.sh
- utils/lib_sxng_test.sh
- utils/lib_sxng_themes.sh

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-08-06 19:37:12 +02:00
Markus Heiser
c9833ded9f [doc] update & fix documentation of the "SearXNG LXC suite"
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-05-21 18:12:39 +02:00
Markus Heiser
2499899554 [mod] Google: reversed engineered & upgrade to data_type: traits_v1
Partial reverse engineering of the Google engines including a improved language
and region handling based on the engine.traits_v1 data.

When ever possible the implementations of the Google engines try to make use of
the async REST APIs.  The get_lang_info() has been generalized to a
get_google_info() function / especially the region handling has been improved by
adding the cr parameter.

searx/data/engine_traits.json
  Add data type "traits_v1" generated by the fetch_traits() functions from:

  - Google (WEB),
  - Google images,
  - Google news,
  - Google scholar and
  - Google videos

  and remove data from obsolete data type "supported_languages".

  A traits.custom type that maps region codes to *supported_domains* is fetched
  from https://www.google.com/supported_domains

searx/autocomplete.py:
  Reversed engineered autocomplete from Google WEB.  Supports Google's languages and
  subdomains.  The old API suggestqueries.google.com/complete has been replaced
  by the async REST API: https://{subdomain}/complete/search?{args}

searx/engines/google.py
  Reverse engineering and extensive testing ..
  - fetch_traits():  Fetch languages & regions from Google properties.
  - always use the async REST API (formally known as 'use_mobile_ui')
  - use *supported_domains* from traits
  - improved the result list by fetching './/div[@data-content-feature]'
    and parsing the type of the various *content features* --> thumbnails are
    added

searx/engines/google_images.py
  Reverse engineering and extensive testing ..
  - fetch_traits():  Fetch languages & regions from Google properties.
  - use *supported_domains* from traits
  - if exists, freshness_date is added to the result
  - issue 1864: result list has been improved a lot (due to the new cr parameter)

searx/engines/google_news.py
  Reverse engineering and extensive testing ..
  - fetch_traits():  Fetch languages & regions from Google properties.
    *supported_domains* is not needed but a ceid list has been added.
  - different region handling compared to Google WEB
  - fixed for various languages & regions (due to the new ceid parameter) /
    avoid CONSENT page
  - Google News do no longer support time range
  - result list has been fixed: XPath of pub_date and pub_origin

searx/engines/google_videos.py
  - fetch_traits():  Fetch languages & regions from Google properties.
  - use *supported_domains* from traits
  - add paging support
  - implement a async request ('asearch': 'arc' & 'async':
    'use_ac:true,_fmt:html')
  - simplified code (thanks to '_fmt:html' request)
  - issue 1359: fixed xpath of video length data

searx/engines/google_scholar.py
  - fetch_traits():  Fetch languages & regions from Google properties.
  - use *supported_domains* from traits
  - request(): include patents & citations
  - response(): fixed CAPTCHA detection (Scholar has its own CATCHA manager)
  - hardening XPath to iterate over results
  - fixed XPath of pub_type (has been change from gs_ct1 to gs_cgt2 class)
  - issue 1769 fixed: new request implementation is no longer incompatible

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-24 10:37:42 +01:00
Markus Heiser
5820dc78ce [doc] slight improvements to the doc of the settings (base_url)
Closes: https://github.com/searxng/searxng/issues/2190

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-17 12:08:58 +01:00
Markus Heiser
eebb489fb7 [fix] make nvm.env exit with error when VERBOSE is unset
$ make nvm.install
    INFO:  install (update) NVM at /800GBPCIex4/share/SearXNG/.nvm
    INFO:  already cloned at: /800GBPCIex4/share/SearXNG/.nvm
      || Fetching origin
    INFO:  checkout v0.39.1
      || HEAD is now at 9600617 v0.39.1
    make: *** [Makefile:96: nvm.install] Error 1

Without this fix we need to set VERBOSE environment to avoid the 'Error 1':

    $ VERBOSE=0 make nvm.install

BTW: fix an issue if there are any leftovers in ${NVM_DIR} from previos
installations

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-11 13:18:07 +01:00
Markus Heiser
c90e157ddd [LXC] ubuntu 21.10 upgrade to ubuntu 22.04 LTS [1]
[1] https://wiki.ubuntu.com/Releases

Tested by::

    # build the container ..
    $ sudo -H ./utils/lxc.sh build searxng-ubu2204

    # install a complete SearXNG suite ..
    $ sudo -H ./utils/lxc.sh cmd searxng-ubu2204 FORCE_TIMEOUT=0 ./utils/searxng.sh install all

    # install nginx to export the SearXNG instance by HTTP
    $ sudo -H ./utils/lxc.sh cmd searxng-ubu2204 FORCE_TIMEOUT=0 ./utils/searxng.sh install nginx

    # check instance
    $  sudo -H ./utils/lxc.sh cmd searxng-ubu2204 FORCE_TIMEOUT=0 ./utils/searxng.sh instance check
    INFO:  [searxng-ubu2204] FORCE_TIMEOUT=0 ./utils/searxng.sh instance check
    INFO:  wrapper:  utils/searxng.sh instance _call searxng.check

    SearXNG checks
    --------------
    ...
    INFO    searx                         : merge the default settings ( /usr/local/searxng/searxng-src/searx/settings.yml ) and the user settings ( /etc/searxng/settings.yml )
    INFO    searx                         : max_request_timeout=None
    INFO    searx.redisdb                 : connecting to Redis db=0 path='/usr/local/searxng-redis/run/redis.sock'
    INFO    searx.redisdb                 : connected to Redis

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-01 09:30:13 +01:00
Milad-Laly
0af41ab15c [fix] typos in utils/searxng.sh 2023-01-08 10:08:53 +01:00
llmII
4e2eb9922e Fix checksum virtualenv checks.
There's already precedence for not using GNUism sha256sum longopts as
seen in searxng/utils/lib_go.sh so update lib.sh to not use them either.
A nice side effect is now the sha256sum usage doesn't care if you're
using BSD sha256sum or GNU sha256sum which makes this work under FreeBSD.
2023-01-03 18:44:55 -06:00
Alexandre Flament
b971167ced move searx.shared.redisdb to searx.redisdb 2022-12-10 09:26:38 +01:00
Alexandre FLAMENT
e92755d358 Initialize Redis in searx/webapp.py
settings.yml:
* The default URL was unix:///usr/local/searxng-redis/run/redis.sock?db=0
* The default URL is now "false"

The default URL makes the log difficult to deal with:
if the admin didn't install a Redis instance, the logs record a false error.

It worked before because SearXNG initialized the Redis connection when the limiter started.

In this commit, SearXNG initializes Redis in searx/webapp.py
so various components can use Redis without taking care of the initialization step.
2022-11-05 17:45:52 +01:00
Markus Heiser
ba8959ad7c [fix] typos / reported by @kianmeng in searx PR-3366
[PR-3366] https://github.com/searx/searx/pull/3366

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-09-27 18:32:14 +02:00
Léon Tiekötter
2b94fef7ec [fix] uWSGI: increase buffer-size
Increase max size of a request, by default it is 4k [1].  4096 as buffer-size is
too small and will result in the preference urls not working.

[1] https://uwsgi-docs.readthedocs.io/en/latest/Options.html#buffer-size
2022-07-31 12:40:06 +02:00
Markus Heiser
bded8750d5 [mod] fix minor leftovers from PR #1332
Related: https://github.com/searxng/searxng/pull/1332
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30 16:13:47 +02:00
Markus Heiser
692708aa77 [clean up] drop obsolete searx, filtron and morty install scripts
Since ./utils/searxng.sh is implemented, the old installation procedures from
filtron, morty and searx can be removed.

For users who want to upgrade, the procedures for removing old installations
have still been retained.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30 13:39:35 +02:00
Markus Heiser
ed8a169029 [doc] update documentation of the installation procedures
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30 13:39:35 +02:00
Markus Heiser
782f73540e [utils/searxng.sh] implement new script to install SearXNG
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30 13:39:35 +02:00
Markus Heiser
81bba44869 [install scripts] rename SEARX_<name> variables to SEARXNG_<name>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30 13:39:35 +02:00
Alexandre Flament
9b3efa6d8a theme: remove __common__ 2022-05-07 19:40:48 +02:00
Markus Heiser
e8541b6006 [theme] peel out oscar from SearXNG development
This is the first step of removing oscar theme

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-30 13:20:27 +02:00
Markus Heiser
463254e3b4 [fix] since git v2.35.2 root can't read from unsafe repository
Git v2.35.2 closes an security issue, it is no longer possible that root uses a
git repo that is owned by someone else, the error message is::

    fatal: unsafe repository ('/share/darmarit.org/cache/searxng' is owned by someone else)

The fix is to run the `git diff --name-only` not as root in a sudo command.

[1] https://github.blog/2022-04-12-git-security-vulnerability-announced/
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-22 17:37:04 +02:00
HZH
095beb8605
typo: wanr_msg -> warn_msg 2022-04-13 20:28:28 +08:00
Jabster28
89bcea56ec
don't reinstall existing packages on arch 2022-04-11 22:46:14 +01:00
Markus Heiser
7308a6e33c [LXC] ubuntu 20.10 EOL, upgrade to ubunut 21.10 [1]
[1] https://wiki.ubuntu.com/Releases

Tested by::

    # build the container ..
    $ sudo -H ./utils/lxc.sh build searx-ubu2110

    # open a shell in the container
    $ sudo -H ./utils/lxc.sh cmd searx-ubu2110 bash
    [root@searx-ubu2110 SearXNG]#

    # install a complete SearXNG suite ..
    [root@searx-ubu2110 SearXNG]# ./utils/searx.sh install all
    ...

    # install apache to export the SearXNG instance by HTTP
    [root@searx-ubu2110 SearXNG]# ./utils/searx.sh apache install
    ...
    INFO:  got 200 from http://10.174.184.94/searx

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-12 18:00:45 +01:00
Markus Heiser
1c79c1a3d2 [LXC] fedora33 EOL [1], upgrade to fedora35 [2]
[1] https://docs.fedoraproject.org/en-US/releases/eol/
[2] https://docs.fedoraproject.org/en-US/releases/f35/

Tested by::

    # build the container ..
    $ sudo -H ./utils/lxc.sh build searx-fedora35

    # open a shell in the container
    $ sudo -H ./utils/lxc.sh cmd searx-fedora35 bash
    [root@searx-fedora35 SearXNG]#

    # install a complete SearXNG suite ..
    [root@searx-fedora35 SearXNG]# ./utils/searx.sh install all
    ...

    # install apache to export the SearXNG instance by HTTP
    [root@searx-fedora35 SearXNG]# ./utils/searx.sh apache install
    ...
    INFO:  got 200 from http://10.174.184.94/searx

To build wheel `python3-devel` needs to be added to SEARX_PACKAGES_fedora::

    |searx|   × Building wheel for setproctitle (pyproject.toml) did not run successfully.
    |searx|   │ exit code: 1
    ...
    |searx|       In file included from src/spt.h:15,
    |searx|                        from src/setproctitle.c:14:
    |searx|       src/spt_python.h:16:10: fatal error: Python.h: No such file or directory
    |searx|          16 | #include <Python.h>
    |searx|             |          ^~~~~~~~~~
    |searx|       compilation terminated.
    |searx|       error: command '/usr/bin/gcc' failed with exit code 1
    |searx|       [end of output]
    ...
    |searx|   ERROR: Failed building wheel for setproctitle

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-12 17:44:00 +01:00
Markus Heiser
8d69ee5e7f [mod] Serving static files with uWSGI (searxng.ini)
1. Serving static files with uWSGI by using static file mount points [1].
2. Expires set to one year since there are hashes [2]

[1] https://uwsgi-docs.readthedocs.io/en/latest/StaticFiles.html#mode-3-using-static-file-mount-points
[2] https://github.com/searxng/searxng/pull/932

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-08 18:13:13 +01:00
Markus Heiser
5eedd5b72a [fix] socket in SearXNG's uWSGI app (searxng.ini)
Use SEARX_UWSGI_SOCKET in uWSGI systemd service

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-08 17:44:27 +01:00
Markus Heiser
e48e2a9914 [fix] APACHE_SEARX_SITE=searxng.conf renamed in 2b125214
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-08 17:18:02 +01:00
Martin Fischer
7ce7625117
Merge pull request #804 from return42/minor-fix
[mod] lib_nvm.sh: minor improvements / no functional change
2022-01-24 17:58:16 +01:00
Markus Heiser
309147d86f [mod] introduce node.env.devtools function 2022-01-24 07:51:31 +01:00
Martin Fischer
cac0352986 [mod] remove .nvm_packages, add eslint to package.json 2022-01-23 08:00:39 +01:00
Markus Heiser
a163385474 [mod] lib_nvm.sh: minor improvements / no functional change
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-22 19:57:25 +01:00
Markus Heiser
977e9a4330
Merge pull request #686 from return42/lib_redis
Add redis DB and connector
2022-01-11 19:55:14 +01:00
Markus Heiser
fe8b88c8a4 [mod] script to build & install a redis instance
A script to build & install a simple & isolated redis service, dedicated to
SearXNG and connected via Unix socket.

    $ ./manage redis.help
    redis.:
      devpkg    : install essential packages to compile redis
      build     : build redis binaries at /800GBPCIex4/share/SearXNG/dist/redis/6.2.6/amd64
      install   : create user (searxng-redis) and install systemd service (searxng-redis)
      remove    : delete user (searxng-redis) and remove service (searxng-redis)
      shell     : start bash interpreter from user searxng-redis
      src       : clone redis source code to <path> and checkput 6.2.6
      useradd   : create user (searxng-redis) at /usr/local/searxng-redis
      userdel   : delete user (searxng-redis)
      addgrp    : add <user> to group (searxng-redis)
      rmgrp     : remove <user> from group (searxng-redis)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-03 14:34:26 +01:00
Alexandre Flament
76cbfbbdda reference docs.searxng.org 2022-01-02 21:18:29 +01:00
Markus Heiser
c89d2aab3f [mod] make static.build.commit more robust
- use single quote in the STATIC_BUILT_PATHS to avoid bash globbing
- don't try to commit if no files have been changed

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-01 20:25:39 +01:00
Markus Heiser
9349c71c54 [mod] themes/simple/img/searxng.svg -> src/brand/searxng.svg
* move `searx/static/themes/simple/img/searxng.svg` to `src/brand/searxng.svg`

* README.rst can use it without a reference to a theme.

* the simple theme can create `searx/static/themes/simple/img/searxng.png` using
  the svg2png task

Suggested-by: @dalf https://github.com/searxng/searxng/pull/561#issuecomment-981747902
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-29 19:53:28 +01:00
Markus Heiser
ee8b6aac36 [fix] searx.sh update: replace git pull by a hard reset
If the fetched branch has been rebased a 'git pull' will fails.  To get fetched
branch in the working tree, a git reset is needed.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-26 15:15:17 +01:00
Markus Heiser
ef3f084c49
Merge pull request #516 from return42/searxng/filtron
[mod] filtron.sh - install github.com/searxng/filtron
2021-11-23 00:23:23 +01:00
Markus Heiser
93e933278a [fix] filtron.sh & morty.sh: quote "$GO_ENV"
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-21 17:13:34 +01:00
Markus Heiser
c1bee0d96f [mod] filtron.sh - install github.com/searxng/filtron
SearXNG maintains a fork of filtron at [1]

[1] https://github.com/searxng/filtron

Related: https://github.com/searxng/searxng/issues/507#issuecomment-970254027
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-21 17:13:34 +01:00
Markus Heiser
5242a841a5 [mod] NVM: dev-tools pre-installed in NVM's node installation
The Node.js installation in the NVM environment can be used by IDEs and other
developer tasks.  The required developer packagaes are added to the file
./.nvm_packages and will be installed when Node.js is installed.  Initial we
start with:

- eslint

Having a dedicated developer enviroment, provided by nvm makes it easy to
integrate Node.js packages into various IDEs.  One example is shown in the
.dir-locals.el which is used by emacs.

[1] https://github.com/nvm-sh/nvm#default-global-packages-from-file-while-installing
[2] https://eslint.org

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20 17:08:22 +01:00
Markus Heiser
69dd025da9 [mod] nvm.cmd ... : run command ... in NVM environment
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20 15:40:18 +01:00
Markus Heiser
6b4cad768d [mod] NVM: pin Node.js to v16.13.0
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20 15:19:17 +01:00
Markus Heiser
3e2f3900b8 [fix] nvm.install: add missing popd / node.env exit with error (254)
Issue::

    $ make clean node.env
    ...
    CLEAN     [NVM] drop .nvm/
    ...
    INFO:  install Node.js by NVM
    ...
    Now using node v16.13.0 (npm v8.1.0)
    ...
    INSTALL   searx/static/themes/oscar/package.json
    npm ERR! code ENOENT
    npm ERR! syscall open
        # Here now comes the issue, caused by the missing 'popd' ..
    npm ERR! path SearXNG/.nvm/searx/static/themes/oscar/package.json
    npm ERR! errno -2
    npm ERR! enoent ENOENT: no such file or directory, open 'SearXNG/.nvm/searx/static/themes/oscar/package.json'
    ERROR: node.env exit with error (254)
    make: *** [Makefile:99: node.env] Error 254

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20 15:16:14 +01:00
Markus Heiser
c681570bb9 [fix] brand - partial revert of e82e37ce6
In commit e82e37ce6 accidentally the brand file was touched / partial
revert::

  export GIT_URL='https://github.com/searxng/searxng'
  export GIT_BRANCH='master'

Related: https://github.com/searxng/searxng/pull/515

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-19 14:01:58 +01:00
Markus Heiser
48752815ed [fix] make nvm.clean - don't raise error when NVM is not installed
Issue was::

    $ LANG=C make nvm.clean
    INFO:  NVM is not installed
    make: *** [Makefile:99: nvm.clean] Error 42

Now::

    $ LANG=C make nvm.clean
    CLEAN     [NVM] not installed

BTW: change info_msg to build_msg

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-19 13:19:54 +01:00
Markus Heiser
e82e37ce6d
Merge pull request #515 from return42/doc-theme
Various modification of the documentation and the theme sphinx-theme
2021-11-19 11:46:29 +01:00
Markus Heiser
1e997386e9
Merge pull request #508 from return42/arm64
[mod] Tools to install and maintain golang binaries & packages.
2021-11-18 19:49:01 +00:00
Markus Heiser
1dae0c0be0 [brand] SearXNG - docs rename links and fix documentation
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-18 18:27:26 +01:00
Markus Heiser
dc1442a2d1 [mod] Tools to install and maintain NVM versions manager for Node.js
[1] https://github.com/nvm-sh/nvm

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-16 23:31:11 +01:00