Commit Graph

5634 Commits

Author SHA1 Message Date
Martin Fischer
180d4d068b [refactor] refactor SwitchableSetting
The previous implementation used two hash sets and a list.
... that's not necessary ... a single hash map suffices.

And it's also less error prone ... because the previous data structure
allowed a setting to be enabled and disabled at the same time.
2022-01-06 18:56:02 +01:00
Alexandre Flament
df52ee711b
Merge pull request #700 from dalf/update-gh-workflow
[mod] GitHub workflow: use cache
2022-01-06 18:21:46 +01:00
Martin Fischer
56fbf22108 [refactor] stop SwitchableSetting from subclassing Setting
Previously the default_value was abused for the cookie name.
Having SwitchableSetting subclass Setting doesn't even make sense
in the first place since none of the Setting methods apply.
2022-01-06 18:13:13 +01:00
Martin Fischer
1196abcfce
Merge pull request #706 from not-my-profile/remove-broken-quest-op
[fix] remove broken ? search operator
2022-01-06 17:44:34 +01:00
Markus Heiser
5305ff8cb6
Merge pull request #705 from not-my-profile/leaflet-gitattr
[fix] prevent leaflet.{css,js} from polluting git grep results
2022-01-06 15:36:59 +01:00
Martin Fischer
a0486cf827 [fix] prevent leaflet.{css,js} from polluting git grep results
Fixes #704.
2022-01-06 14:33:19 +01:00
Martin Fischer
83f8a8fc6d [refactor] remove pointless tuple 2022-01-06 14:21:15 +01:00
Martin Fischer
bb06758a7b [refactor] add type hints & remove Setting._post_init
Previously the Setting classes used a horrible _post_init
hack that prevented proper type checking.
2022-01-06 14:21:14 +01:00
Martin Fischer
61935c72ef [fix] remove broken ? search operator
The ? search operator has been broken for some time and
currently only raises the question why it's still there.

## Context ##

The query "Paris !images" searches for "Paris" in the "images" category.

Once upon a time Searx supported "Paris ?images" to search for "Paris"
in the currently enabled categories and the "images" category.

The feature makes sense ... the ? syntax does not.
We will hopefully introduce a +!images syntax in the future.

Fixes #702.
2022-01-06 14:10:58 +01:00
Alexandre Flament
93c6829b27
Merge pull request #699 from dalf/uwsgi
[mod] adjust dockerfiles/uwsgi.ini
2022-01-06 09:50:41 +01:00
Alexandre Flament
03189d60f4
Merge pull request #697 from searxng/remove-nl-be
Delete searx/translations/nl_BE
2022-01-06 09:26:12 +01:00
Alexandre Flament
aedd6279b3
Merge pull request #634 from not-my-profile/powered-by
Introduce `categories_as_tabs` & group engines in tabs
2022-01-06 09:22:02 +01:00
Alexandre Flament
55ae74d725 [mod] adjust dockerfiles/uwsgi.ini 2022-01-05 21:06:25 +01:00
Alexandre Flament
1f7059e040 [mod] GitHub workflow: use cache 2022-01-05 20:59:59 +01:00
Alexandre Flament
40684f6b5e
Delete searx/translations/nl_BE
See https://github.com/searxng/searxng/issues/540
2022-01-05 20:36:24 +01:00
Markus Heiser
0ebad8220f
Merge pull request #688 from dalf/settings_enable_stats
[enh] settings.yml: implement general.enable_metrics
2022-01-05 18:53:49 +00:00
Martin Fischer
160f3e022e
Merge pull request #683 from return42/fix-doc
Document & Pylint scripts in searxng_extra/update
2022-01-05 19:46:00 +01:00
Alexandre Flament
9004e84b6e
Merge pull request #596 from dalf/upgrade-httpx
Upgrade httpx
2022-01-05 19:13:48 +01:00
Alexandre Flament
d3ecadd3f8
Merge pull request #679 from dalf/brand-searxng
searxng.org: update setup.py & settings.yml
2022-01-05 19:07:53 +01:00
Alexandre Flament
2134703b4b [enh] settings.yml: implement general.enable_metrics
* allow not to record metrics (response time, etc...)
* this commit doesn't change the UI. If the metrics are disabled
  /stats and /stats/errors will return empty response.
  in /preferences, the columns response time and reliability will be empty.
2022-01-05 19:03:04 +01:00
Alexandre Flament
e64c3deab7 [mod] upgrade httpx 0.21.2
httpx 0.21.2 and httpcore 0.14.4 fix multiple issues:
* https://github.com/encode/httpx/releases/tag/0.21.2
* https://github.com/encode/httpcore/releases/tag/0.14.4

so most of the workarounds in searx.network have been removed.
2022-01-05 18:46:00 +01:00
Martin Fischer
a7199bc085
Merge pull request #694 from return42/fix-c7f27404
[fix] debug console (pdb) in a session started by `make run`
2022-01-05 18:40:46 +01:00
Markus Heiser
295876abaa [pylint] add scripts from searxng_extra/update to pylint
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-05 16:09:40 +01:00
Markus Heiser
ffea5d8ef5 [docs] add documentation for the scripts in searxng_extra/update
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-05 16:09:40 +01:00
Martin Fischer
a4c2cfb837 [enh] change categories_as_tabs from a list to a dict
The tab icon names are currently hard coded in the templates.
This commit lets us introduce an icon property in the future, e.g:

categories_as_tabs:
  general:
    icon: search-outline
2022-01-05 11:03:44 +01:00
Martin Fischer
b38036d519 [fix] stop setting superfluous cookies for "non tab categories" 2022-01-05 11:03:44 +01:00
Martin Fischer
3dd534e5c0 [refactor] make group_engines_in_tab more readable 2022-01-05 11:03:44 +01:00
Martin Fischer
d01e8aa8cc [mod] introduce searx.engines.Engine for type hinting 2022-01-05 11:03:44 +01:00
Martin Fischer
3f76c9c96c [enh] enable English dictionaries by default
These dictionaries are no longer part of the general category,
so they're no longer queried by default -> we can enable them
by default without degrading general query performance.
2022-01-05 11:03:44 +01:00
Martin Fischer
abe53946d4 [enh] display help text for "Other" engines tab in preferences 2022-01-05 11:03:44 +01:00
Martin Fischer
6f07d51b62 [mod] improve variable name 2022-01-05 11:03:44 +01:00
Martin Fischer
1e195f5b95 [mod] move group_engines_in_tab to searx.webutils 2022-01-05 11:03:44 +01:00
Martin Fischer
5d74bf3820 [enh] move dictionaries, Erowid & IMDb out of general category
The general category is the category that is searched by default.
From a privacy standpoint it doesn't make sense to send all general
queries to specialized search engines that cannot deal with those
queries anyway.
2022-01-05 11:03:44 +01:00
Martin Fischer
ab90e2ac49 [enh] show categories not in any tab category in "Other" preferences tab
Previously we didn't have a good place to put search engines that don't
fit into any of the tab categories. This commit automatically puts
search engines that don't belong to any tab category in an "other"
category, that is only displayed in the user preferences (and not above
search results).
2022-01-05 11:03:44 +01:00
Martin Fischer
4ac6b5d32d [build] /static 2022-01-05 11:03:44 +01:00
Martin Fischer
a12cb6a807 [simple] improve styling of subcategory table headers in preferences 2022-01-05 11:03:44 +01:00
Martin Fischer
20a5e43e35 [enh] display language of engines in preferences 2022-01-05 11:03:44 +01:00
Martin Fischer
31e206361f [enh] group engines in preference tabs 2022-01-05 11:03:44 +01:00
Martin Fischer
b02f762687 [enh] add more categories 2022-01-05 11:00:11 +01:00
Markus Heiser
c9cfa6181b [fix] debug console (pdb) in a session started by make run
Commit c7f27404 moves the `python -m searx.webapp` process to the background.  A
background job can't open a simple python-debugger (pdb) console.

This patch moves all processes to the background except the searx.webapp.

Insert a break point somewhere in the webapp application::

    import pdb
    pdb.set_trace()

And start a debug session by::

    make run

and test you break point.

To test that the entire 'make run' stops in the case of an error in the
themes.live [1] background process try:

    make LIVE_THEME=typo-theme-name run

[1] https://github.com/searxng/searxng/pull/664#discussion_r776419585

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-05 10:09:17 +01:00
Markus Heiser
00d3a7477c
Merge pull request #664 from return42/themes.live
[mod] manage: add themes.live command (rebuild on modification)
2022-01-04 19:44:51 +01:00
Markus Heiser
d7b4306444 [fix] links in comments - https://docs.searxng.org/
fixed links from https://searxng.github.io/searxng/ to https://docs.searxng.org/
2022-01-04 16:04:49 +01:00
Markus Heiser
a6cfab93fa [enh] add redis connector searx/shared/redisdb.py
Add a redis connector, the default DB connector is a socket at::

    unix:///usr/local/searxng-redis/run/redis.sock?db=0

To set up a redis instance simply use::

    $ ./manage redis.build
    $ sudo -H ./manage redis.install

A hint for developers:

To get access rights to this instance, your developer account needs to be added
to the *searxng-redis* group::

    $ sudo -H ./manage redis.addgrp "${USER}"
    # don't forget to logout & login to get member of group

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-03 20:56:39 +01:00
Martin Fischer
8eb3167fba
Merge pull request #687 from dalf/fix-685
[fix] disabling all engines in a category makes the bang search in general
2022-01-03 20:42:05 +01:00
Alexandre Flament
41ae5aea2b [fix] disabling all engines in a category makes the bang search in general
with this commit, there is no result
2022-01-03 20:23:46 +01:00
Alexandre Flament
8e99c11c95
Merge pull request #680 from JamesClonk/master
fix minor typo
2022-01-03 18:25:54 +01:00
Markus Heiser
4f1130d663 [mod] test.shell: add utils/lib_redis.sh to shellcheck procedure
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-03 14:47:24 +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
Markus Heiser
a3332cd550
Merge pull request #684 from return42/fix-makefile
[fix] Makefile: mixed tab & space indentation
2022-01-03 13:57:59 +01:00
Markus Heiser
a585f7c66f [fix] Makefile: mixed tab & space indentation
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-03 13:51:35 +01:00