88 files changed+7139−32214
.github/workflows/data-update.yml+1−1
@@ -29,7 +29,7 @@ jobs:
2929 - name: Set up Python
3030 uses: actions/setup-python@v2
3131 with:
32− python-version: '3.10'
32+ python-version: '3.9'
3333 architecture: 'x64'
3434
3535 - name: Install Python dependencies
.github/workflows/integration.yml+3−32
@@ -13,7 +13,7 @@ jobs:
1313 strategy:
1414 matrix:
1515 os: [ubuntu-20.04]
16− python-version: [3.7, 3.8, 3.9, "3.10"]
16+ python-version: [3.6, 3.7, 3.8, 3.9]
1717 steps:
1818 - name: Checkout
1919 uses: actions/checkout@v2
@@ -56,17 +56,6 @@ jobs:
5656 uses: actions/checkout@v2
5757 - name: Install Ubuntu packages
5858 run: sudo ./utils/searx.sh install packages
59− - name: Set up Python
60− uses: actions/setup-python@v2
61− with:
62− python-version: '3.9'
63− architecture: 'x64'
64− - name: Cache Python dependencies
65− id: cache-python
66− uses: actions/cache@v2
67− with:
68− path: ./local
69− key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
7059 - name: Install node dependencies
7160 run: make V=1 node.env
7261 - name: Build themes
@@ -79,21 +68,14 @@ jobs:
7968 - name: Checkout
8069 uses: actions/checkout@v2
8170 with:
82− fetch-depth: '0'
8371 persist-credentials: false
8472 - name: Install Ubuntu packages
8573 run: sudo ./utils/searx.sh install buildhost
8674 - name: Set up Python
8775 uses: actions/setup-python@v2
8876 with:
89− python-version: '3.10'
77+ python-version: '3.9'
9078 architecture: 'x64'
91− - name: Cache Python dependencies
92− id: cache-python
93− uses: actions/cache@v2
94− with:
95− path: ./local
96− key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
9779 - name: Build documentation
9880 run: |
9981 make V=1 docs.clean docs.html
@@ -115,7 +97,7 @@ jobs:
11597 - documentation
11698 env:
11799 DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
118− runs-on: ubuntu-20.04
100+ runs-on: ubuntu-18.04
119101 steps:
120102 - name: Checkout
121103 if: env.DOCKERHUB_USERNAME != null
@@ -123,17 +105,6 @@ jobs:
123105 with:
124106 # make sure "make docker.push" can get the git history
125107 fetch-depth: '0'
126− - name: Set up Python
127− uses: actions/setup-python@v2
128− with:
129− python-version: '3.9'
130− architecture: 'x64'
131− - name: Cache Python dependencies
132− id: cache-python
133− uses: actions/cache@v2
134− with:
135− path: ./local
136− key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
137108 - name: Set up QEMU
138109 if: env.DOCKERHUB_USERNAME != null
139110 uses: docker/setup-qemu-action@v1
.gitignore−2
@@ -26,5 +26,3 @@ dist/
2626local/
2727gh-pages/
2828searx.egg-info/
29−.env
30−geckodriver.log
.pylintrc+1−1
@@ -59,7 +59,7 @@ confidence=
5959# --enable=similarities". If you want to run only the classes checker, but have
6060# no Warning level messages displayed, use"--disable=all --enable=classes
6161# --disable=W"
62−disable=bad-whitespace, duplicate-code, consider-using-f-string
62+disable=bad-whitespace, duplicate-code
6363
6464# Enable the message, report, category or checker with the given id(s). You can
6565# either give multiple identifier separated by comma (,) or put this option
AUTHORS.rst−1
@@ -165,4 +165,3 @@ generally made searx better:
165165- @jhigginbotham
166166- @xenrox
167167- @OliveiraHermogenes
168−- Paul Alcock @Guilvareux
Dockerfile+4−5
@@ -1,4 +1,4 @@
1−FROM alpine:3.15
1+FROM alpine:3.12
22ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"]
33EXPOSE 8080
44VOLUME /etc/searx
@@ -46,19 +46,18 @@ RUN apk upgrade --no-cache \
4646 uwsgi \
4747 uwsgi-python3 \
4848 brotli \
49− && pip3 install --upgrade pip wheel setuptools \
49+ && pip3 install --upgrade pip \
5050 && pip3 install --no-cache -r requirements.txt \
5151 && apk del build-dependencies \
5252 && rm -rf /root/.cache
5353
54−COPY searx ./searx
55−COPY dockerfiles ./dockerfiles
54+COPY --chown=searx:searx . .
5655
5756ARG TIMESTAMP_SETTINGS=0
5857ARG TIMESTAMP_UWSGI=0
5958ARG VERSION_GITCOMMIT=unknown
6059
61−RUN /usr/bin/python3 -m compileall -q searx; \
60+RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \
6261 touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml; \
6362 touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \
6463 if [ ! -z $VERSION_GITCOMMIT ]; then\
README.rst+1−1
@@ -61,7 +61,7 @@ our homepage_.
6161.. _homepage: https://searx.github.io/searx
6262
6363contact:
64− openhub_ // twitter_ // IRC: #searx @ Libera (irc.libera.chat)
64+ openhub_ // twitter_ // IRC: #searx @ freenode
6565
6666.. _openhub: https://www.openhub.net/p/searx
6767.. _twitter: https://twitter.com/Searx_engine
docs/admin/update-searx.rst+2−2
@@ -23,7 +23,7 @@ How to update depends on the :ref:`installation` method. If you have used the
2323
2424.. code:: bash
2525
26− sudo -H ./utils/morty.sh update morty
26+ $ sudo -H ./utils/morty.sh update morty
2727
2828.. _inspect searx:
2929
@@ -55,5 +55,5 @@ How to debug depends on the :ref:`installation` method. If you have used the
5555
5656.. code:: bash
5757
58− sudo -H ./utils/morty.sh inspect service
58+ $ sudo -H ./utils/morty.sh inspect service
5959
docs/blog/index.rst+3−3
@@ -3,14 +3,14 @@ Blog
33====
44
55.. toctree::
6− :titlesonly:
7− :reversed:
6+ :maxdepth: 2
7+ :caption: Contents
88
9+ lxcdev-202006
910 python3
1011 admin
1112 intro-offline
1213 private-engines
13− lxcdev-202006
1414 command-line-engines
1515 search-indexer-engines
1616 sql-engines
docs/conf.py+1−2
@@ -10,7 +10,7 @@ from searx.version import VERSION_STRING
1010# Project --------------------------------------------------------------
1111
1212project = u'searx'
13−copyright = u'2015-2021, Adam Tauber, Noémi Ványi'
13+copyright = u'2015-2020, Adam Tauber, Noémi Ványi'
1414author = u'Adam Tauber'
1515release, version = VERSION_STRING, VERSION_STRING
1616highlight_language = 'none'
@@ -101,7 +101,6 @@ imgmath_font_size = 14
101101
102102html_theme_options = {"index_sidebar_logo": True}
103103html_context = {"project_links": [] }
104−html_context["project_links"].append(ProjectLink("Blog", "blog/index.html"))
105104if brand.GIT_URL:
106105 html_context["project_links"].append(ProjectLink("Source", brand.GIT_URL))
107106if brand.WIKI_URL:
docs/dev/engine_overview.rst+1−1
@@ -171,7 +171,7 @@ headers set HTTP header information
171171data set HTTP data information
172172cookies set HTTP cookies
173173verify bool Performing SSL-Validity check
174−follow_redirects bool Follow redirects
174+allow_redirects bool Follow redirects
175175max_redirects int maximum redirects, hard limit
176176soft_max_redirects int maximum redirects, soft limit. Record an error but don't stop the engine
177177raise_for_httperror bool True by default: raise an exception if the HTTP code of response is >= 300
manage+4−4
@@ -13,7 +13,7 @@ source_dot_config
1313
1414PY_SETUP_EXTRAS='[test]'
1515NPM_PACKAGES="less@2.7 less-plugin-clean-css grunt-cli"
16−GECKODRIVER_VERSION="v0.30.0"
16+GECKODRIVER_VERSION="v0.28.0"
1717# SPHINXOPTS=
1818
1919# These py files are linted by test.pylint(), all other files are linted by
@@ -224,7 +224,7 @@ docker.build() {
224224
225225 # build Docker image
226226 build_msg DOCKER "Building image ${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION}"
227− docker build \
227+ sudo docker build \
228228 --build-arg GIT_URL="${GIT_URL}" \
229229 --build-arg SEARX_GIT_VERSION="${SEARX_GIT_VERSION}" \
230230 --build-arg VERSION_GITCOMMIT="${VERSION_GITCOMMIT}" \
@@ -236,8 +236,8 @@ docker.build() {
236236 -t "${SEARX_IMAGE_NAME}:latest" -t "${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION}" .
237237
238238 if [ "$1" = "push" ]; then
239− docker push "${SEARX_IMAGE_NAME}:latest"
240− docker push "${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION}"
239+ sudo docker push "${SEARX_IMAGE_NAME}:latest"
240+ sudo docker push "${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION}"
241241 fi
242242 )
243243 dump_return $?
requirements-dev.txt+12−13
@@ -1,20 +1,19 @@
11mock==4.0.3
22nose2[coverage_plugin]==0.10.0
33cov-core==1.15.0
4−pycodestyle==2.8.0
5−pylint==2.12.2
6−splinter==0.17.0
7−transifex-client==0.14.3; python_version < '3.10'
8−transifex-client==0.12.1; python_version == '3.10'
9−selenium==4.1.0
10−twine==3.7.1
11−Pallets-Sphinx-Themes==2.0.2
4+pycodestyle==2.7.0
5+pylint==2.9.6
6+splinter==0.15.0
7+transifex-client==0.14.3
8+selenium==3.141.0
9+twine==3.4.1
10+Pallets-Sphinx-Themes==2.0.1
1211docutils==0.16
13−Sphinx==4.4.0
14−sphinx-issues==3.0.1
15−sphinx-jinja==1.4.0
12+Sphinx==4.1.2
13+sphinx-issues==1.2.0
14+sphinx-jinja==1.1.1
1615sphinx-tabs==3.2.0
1716sphinxcontrib-programoutput==0.17
1817sphinx-autobuild==2021.3.14
19−linuxdoc==20211220
20−aiounittest==1.4.1
18+linuxdoc==20210324
19+aiounittest==1.4.0
requirements.txt+7−7
@@ -1,16 +1,16 @@
1−certifi==2021.10.8
1+certifi==2021.5.30
22babel==2.9.1
33flask-babel==2.0.0
4−flask==2.0.2
5−jinja2==3.0.3
6−lxml==4.7.1
4+flask==1.1.2
5+jinja2==2.11.3
6+lxml==4.6.3
77pygments==2.8.0
88python-dateutil==2.8.2
9−pyyaml==6.0
10−httpx[http2]==0.21.3
9+pyyaml==5.4.1
10+httpx[http2]==0.17.1
1111Brotli==1.0.9
1212uvloop==0.16.0; python_version >= '3.7'
1313uvloop==0.14.0; python_version < '3.7'
14−httpx-socks[asyncio]==0.7.2
14+httpx-socks[asyncio]==0.3.1
1515langdetect==1.0.9
1616setproctitle==1.2.2
searx/autocomplete.py+7−24
@@ -24,7 +24,6 @@ from httpx import HTTPError
2424
2525
2626from searx import settings
27−from searx.data import ENGINES_LANGUAGES
2827from searx.network import get as http_get
2928from searx.exceptions import SearxEngineResponseException
3029
@@ -36,22 +35,6 @@ def get(*args, **kwargs):
3635 return http_get(*args, **kwargs)
3736
3837
39−def brave(query, lang):
40− # brave search autocompleter
41− url = 'https://search.brave.com/api/suggest?{query}'
42−
43− resp = get(url.format(query=urlencode({'q': query})))
44−
45− results = []
46−
47− if resp.ok:
48− data = loads(resp.text)
49− for suggestion in data[1]:
50− results.append(suggestion)
51−
52− return results
53−
54−
5538def dbpedia(query, lang):
5639 # dbpedia autocompleter, no HTTPS
5740 autocomplete_url = 'https://lookup.dbpedia.org/api/search.asmx/KeywordSearch?'
@@ -94,11 +77,12 @@ def google(query, lang):
9477
9578def startpage(query, lang):
9679 # startpage autocompleter
97− lui = ENGINES_LANGUAGES['startpage'].get(lang, 'english')
98− url = 'https://startpage.com/suggestions?{query}'
99− resp = get(url.format(query=urlencode({'q': query, 'segment': 'startpage.udog', 'lui': lui})))
100− data = resp.json()
101− return [e['text'] for e in data.get('suggestions', []) if 'text' in e]
80+ url = 'https://startpage.com/do/suggest?{query}'
81+
82+ resp = get(url.format(query=urlencode({'query': query}))).text.split('\n')
83+ if len(resp) > 1:
84+ return resp
85+ return []
10286
10387
10488def swisscows(query, lang):
@@ -136,8 +120,7 @@ def wikipedia(query, lang):
136120 return []
137121
138122
139−backends = {'brave': brave,
140− 'dbpedia': dbpedia,
123+backends = {'dbpedia': dbpedia,
141124 'duckduckgo': duckduckgo,
142125 'google': google,
143126 'startpage': startpage,
searx/data/__init__.py+14−39
@@ -1,50 +1,25 @@
1−# SPDX-License-Identifier: AGPL-3.0-or-later
2−# lint: pylint
3−"""This module holds the *data* created by::
4−
5− make data.all
6−
7−"""
8−
9−__all__ = [
10− 'ENGINES_LANGUAGES',
11− 'CURRENCIES',
12− 'USER_AGENTS',
13− 'EXTERNAL_URLS',
14− 'WIKIDATA_UNITS',
15− 'EXTERNAL_BANGS',
16− 'OSM_KEYS_TAGS',
17− 'ahmia_blacklist_loader',
18−]
19−
201import json
212from pathlib import Path
223
4+
5+__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'EXTERNAL_URLS', 'WIKIDATA_UNITS', 'EXTERNAL_BANGS',
6+ 'bangs_loader', 'ahmia_blacklist_loader']
237data_dir = Path(__file__).parent
248
259
26−def _load(filename):
27− with open(data_dir / filename, encoding='utf-8') as f:
28− return json.load(f)
10+def load(filename):
11+ with open(data_dir / filename, encoding='utf-8') as fd:
12+ return json.load(fd)
2913
3014
3115def ahmia_blacklist_loader():
32− """Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
33− names. The MD5 values are fetched by::
34−
35− searx_extra/update/update_ahmia_blacklist.py
36−
37− This function is used by :py:mod:`searx.plugins.ahmia_filter`.
38−
39− """
40− with open(str(data_dir / 'ahmia_blacklist.txt'), encoding='utf-8') as f:
41− return f.read().split()
16+ with open(str(data_dir / 'ahmia_blacklist.txt'), encoding='utf-8') as fd:
17+ return fd.read().split()
4218
4319
44−ENGINES_LANGUAGES = _load('engines_languages.json')
45−CURRENCIES = _load('currencies.json')
46−USER_AGENTS = _load('useragents.json')
47−EXTERNAL_URLS = _load('external_urls.json')
48−WIKIDATA_UNITS = _load('wikidata_units.json')
49−EXTERNAL_BANGS = _load('external_bangs.json')
50−OSM_KEYS_TAGS = _load('osm_keys_tags.json')
20+ENGINES_LANGUAGES = load('engines_languages.json')
21+CURRENCIES = load('currencies.json')
22+USER_AGENTS = load('useragents.json')
23+EXTERNAL_URLS = load('external_urls.json')
24+WIKIDATA_UNITS = load('wikidata_units.json')
25+EXTERNAL_BANGS = load('external_bangs.json')
searx/data/ahmia_blacklist.txt−8485
This diff is too big to show here.
searx/data/currencies.json+172−63
This diff is too big to show here.
searx/data/engines_languages.json+23−60
This diff is too big to show here.
searx/data/external_bangs.json+5825−5826
This diff is too big to show here.
searx/data/osm_keys_tags.jsondeleted−15416
This diff is too big to show here.
searx/data/useragents.json+3−4
This diff is too big to show here.
searx/data/wikidata_units.json+5−33
This diff is too big to show here.
searx/engines/__init__.py+3−3
This diff is too big to show here.
searx/engines/command.py+1−1
This diff is too big to show here.
searx/engines/duckduckgo.py+47−96
This diff is too big to show here.
searx/engines/gigablast.py+13−24
This diff is too big to show here.
searx/engines/google.py+13−23
This diff is too big to show here.
searx/engines/google_images.py+1−1
This diff is too big to show here.
searx/engines/google_videos.py+1−1
This diff is too big to show here.
searx/engines/imdb.pydeleted−55
This diff is too big to show here.
searx/engines/invidious.py+2−2
This diff is too big to show here.
searx/engines/meilisearch.py+1−1
This diff is too big to show here.
searx/engines/mysql_server.py−2
This diff is too big to show here.
searx/engines/onesearch.pydeleted−57
This diff is too big to show here.
searx/engines/openstreetmap.py+67−397
This diff is too big to show here.
searx/engines/prowlarr.pydeleted−80
This diff is too big to show here.
searx/engines/qwant.py+69−175
This diff is too big to show here.
searx/engines/rumble.py+1−1
This diff is too big to show here.
searx/engines/stackexchange.pydeleted−67
This diff is too big to show here.
searx/engines/stackoverflow.pynew file+64
This diff is too big to show here.
searx/engines/startpage.py+20−100
This diff is too big to show here.
searx/engines/tineye.pydeleted−86
This diff is too big to show here.
searx/engines/xpath.py+1−1
This diff is too big to show here.
searx/engines/xpath_flex.pydeleted−121
This diff is too big to show here.
searx/engines/yahoo.py+91−93
This diff is too big to show here.
searx/engines/yggtorrent.py+2−2
This diff is too big to show here.
searx/external_urls.py+2−14
This diff is too big to show here.
searx/network/__init__.py+29−28
This diff is too big to show here.
searx/network/client.py+51−42
This diff is too big to show here.
searx/network/network.py+16−71
This diff is too big to show here.
searx/plugins/self_info.py+1−1
This diff is too big to show here.
searx/plugins/tracker_url_remover.py+1−1
This diff is too big to show here.
searx/preferences.py+3−3
This diff is too big to show here.
searx/results.py+6−20
This diff is too big to show here.
searx/search/__init__.py+2−5
This diff is too big to show here.
searx/search/checker/impl.py+1−1
This diff is too big to show here.
searx/search/processors/online.py+3−4
This diff is too big to show here.
searx/settings.yml+40−146
This diff is too big to show here.
searx/settings_loader.py+2−2
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev-dark.css−2
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev-dark.min.css+1−1
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev-dark.min.css.map+1−1
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev.css−2
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev.min.css+1−1
This diff is too big to show here.
searx/static/themes/oscar/css/logicodev.min.css.map+1−1
This diff is too big to show here.
searx/static/themes/oscar/js/searx.js+83
This diff is too big to show here.
searx/static/themes/oscar/src/js/leaflet_map.js+83
This diff is too big to show here.
searx/static/themes/oscar/src/less/logicodev/results.less−30
This diff is too big to show here.
searx/static/themes/oscar/src/less/logicodev/search.less−2
This diff is too big to show here.
searx/static/themes/simple/js/searx.js+87
This diff is too big to show here.
searx/static/themes/simple/js/searx_src/searx_mapresult.js+87
This diff is too big to show here.
searx/static/themes/simple/less/style.less−32
This diff is too big to show here.
searx/templates/oscar/result_templates/map.html+48−52
This diff is too big to show here.
searx/templates/oscar/result_templates/products.html+1−2
This diff is too big to show here.
searx/templates/simple/result_templates/map.html+52−35
This diff is too big to show here.
searx/utils.py+6−12
This diff is too big to show here.
searx/webadapter.py+1−1
This diff is too big to show here.
searx/webapp.py+18−54
This diff is too big to show here.
searx_extra/update/update_external_bangs.py+1−1
This diff is too big to show here.
searx_extra/update/update_osm_keys_tags.pydeleted−209
This diff is too big to show here.
tests/unit/network/test_network.py+10−10
This diff is too big to show here.
tests/unit/test_external_bangs.py+6
This diff is too big to show here.
tests/unit/test_results.py+4−4
This diff is too big to show here.
tests/unit/test_utils.py+2−2
This diff is too big to show here.
tests/unit/test_webapp.py−5
This diff is too big to show here.
utils/filtron.sh+2−2
This diff is too big to show here.
utils/searx.sh+1−1
This diff is too big to show here.