summaryrefslogtreecommitdiff
path: root/manage
AgeCommit message (Collapse)Author
2024-07-14[mod] revision of the settings_loaderMarkus Heiser
The intention of this PR is to modernize the settings_loader implementations. The concept is old (remember, this is partly from 2014), back then we only had one config file, meanwhile we have had a folder with config files for a very long time. Callers can now load a YAML configuration from this folder as follows :: settings_loader.get_yaml_cfg('my-config.yml') - BTW this is a fix of #3557. - Further the `existing_filename_or_none` construct dates back to times when there was not yet a `pathlib.Path` in all Python versions we supported in the past. - Typehints have been added wherever appropriate At the same time, this patch should also be downward compatible and not introduce a new environment variable. The localization of the folder with the configurations is further based on: SEARXNG_SETTINGS_PATH (wich defaults to /etc/searxng/settings.yml) Which means, the default config folder is `/etc/searxng/`. ATTENTION: intended functional changes! If SEARXNG_SETTINGS_PATH was set and pointed to a not existing file, the previous implementation silently loaded the default configuration. This behavior has been changed: if the file or folder does not exist, an EnvironmentError exception will be thrown in future. Closes: https://github.com/searxng/searxng/issues/3557 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-03-11[mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTIONMarkus Heiser
In the past, some files were tested with the standard profile, others with a profile in which most of the messages were switched off ... some files were not checked at all. - ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished - the distinction ``# lint: pylint`` is no longer necessary - the pylint tasks have been reduced from three to two 1. ./searx/engines -> lint engines with additional builtins 2. ./searx ./searxng_extra ./tests -> lint all other python files Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-03-11[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTIONMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-02-16[fix] remove twine from requirements-devMarkus Heiser
SearXNG is a rolling release / we do not deploy packages on PyPi Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-01-29[test.robot] update gecko driver / v0.34.0 required by firefox 121.*Markus Heiser
Update gecko driver to v0.34.0 [1] [1] https://github.com/mozilla/geckodriver/releases/tag/v0.34.0 Closes: https://github.com/searxng/searxng/issues/3141 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-01-09[mod] get rid of ./utils/brand.env and its workflowMarkus Heiser
All the environments defined in ./utils/brand.env are generated on the fly, so there is no longer a need to define the brand environment in this file and all the workflows to handle this file. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-10-13[fix] black --exclude option is a regular expressionMarkus Heiser
When ``searx/static/themes/simple/node_modules`` are installed the test from black runs into this path / Error:: $ make test TEST [yamllint] $YAMLLINT_FILES TEST [black] $BLACK_TARGETS --- searx/static/themes/simple/node_modules/flatted/python/test.py 2023-10-13 10:09:50.460026 +0000 +++ searx/static/themes/simple/node_modules/flatted/python/test.py 2023-10-13 10:10:04.974335 +0000 @@ -1,9 +1,11 @@ from flatted import stringify as _stringify, parse ... black --exclude option is not a comma separated list, its a regular expression / see: $ black --help ... --exclude TEXT A regular expression that matches files and directories that should be excluded on recursive searches ... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-10-01Upgrade dependenciesAlexandre Flament
* geckodriver: 0.33.0 * node 16.20.2 * pyright 1.1.329 * eslint 8.50.0
2023-08-06[doc] improve documentation of make targets and ./manage scriptMarkus Heiser
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-04-05[fix] ./manage: replace data.languages by data.traitsMarkus Heiser
Follow up of https://github.com/searxng/searxng/pull/2269 Related: - https://github.com/searxng/searxng/issues/2314 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-24[mod] replace engines_languages.json by engines_traits.jsonMarkus Heiser
Implementations of the *traits* of the engines. Engine's traits are fetched from the origin engine and stored in a JSON file in the *data folder*. Most often traits are languages and region codes and their mapping from SearXNG's representation to the representation in the origin search engine. To load traits from the persistence:: searx.enginelib.traits.EngineTraitsMap.from_data() For new traits new properties can be added to the class:: searx.enginelib.traits.EngineTraits .. hint:: Implementation is downward compatible to the deprecated *supported_languages method* from the vintage implementation. The vintage code is tagged as *deprecated* an can be removed when all engines has been ported to the *traits method*. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-11[mod] install developer tools by: make node.env.devMarkus Heiser
- rename ``./manage node.env.devtools`` to ``./manage node.env.dev`` - add ``make node.env.dev`` - remove local developer tools by ``make node.clean`` Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-01-21weblate: migration to https://translate.codeberg.org/Alexandre Flament
2023-01-20SearXNG version: fix make dockerAlexandre Flament
continuation of #2117 related to #2111 This commit: * fixes the Docker tag using an additional variable DOCKER_TAG, see searx/version.py * fixes the Docker labels org.label-schema.vcs-ref and org.opencontainers.image.revision * adds searx/version_frozen to .gitignore
2022-12-10[fix] follow up of PR-1856Alexandre Flament
- the environment variable SEARXNG_REDIS_URL overrides the setting value redis.url - ./manage sets SEARXNG_REDIS_URL to unix:///usr/local/searxng-redis/run/redis.sock if: - the socket exists - SEARXNG_REDIS_URL is not already defined Update of PR #1856 Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2022-07-30[fix] pyright repported errorsAlexandre Flament
The errors make pyright usage useless since a new error won't be seen [1]. [1] https://github.com/searxng/searxng/pull/1569 ``` searx/compat.py:11:27 - error: Expression of type "Type[cached_property[_T@cached_property]]" cannot be assigned to declared type "Type[cached_property]" "Type[cached_property[_T@cached_property]]" is incompatible with "Type[cached_property]" Type "Type[cached_property[_T@cached_property]]" cannot be assigned to type "Type[cached_property]" (reportGeneralTypeIssues) searx/utils.py:69:36 - error: Expression of type "None" cannot be assigned to parameter of type "str" Type "None" cannot be assigned to type "str" (reportGeneralTypeIssues) searx/utils.py:573:85 - error: Expression of type "None" cannot be assigned to parameter of type "int" Type "None" cannot be assigned to type "int" (reportGeneralTypeIssues) searx/webapp.py:1306:22 - error: Argument of type "str" cannot be assigned to parameter "__a" of type "BytesPath" in function "join" Type "str" cannot be assigned to type "BytesPath" "str" is incompatible with "bytes" "str" is incompatible with protocol "PathLike[bytes]" "__fspath__" is not present (reportGeneralTypeIssues) searx/webapp.py:1306:68 - error: Argument of type "Literal['themes']" cannot be assigned to parameter "paths" of type "BytesPath" in function "join" Type "Literal['themes']" cannot be assigned to type "BytesPath" "Literal['themes']" is incompatible with "bytes" "Literal['themes']" is incompatible with protocol "PathLike[bytes]" "__fspath__" is not present (reportGeneralTypeIssues) searx/webapp.py:1306:78 - error: Argument of type "str | Any | None" cannot be assigned to parameter "paths" of type "BytesPath" in function "join" Type "str | Any | None" cannot be assigned to type "BytesPath" Type "str" cannot be assigned to type "BytesPath" "str" is incompatible with "bytes" "str" is incompatible with protocol "PathLike[bytes]" "__fspath__" is not present (reportGeneralTypeIssues) searx/webapp.py:1306:85 - error: Argument of type "Literal['img']" cannot be assigned to parameter "paths" of type "BytesPath" in function "join" Type "Literal['img']" cannot be assigned to type "BytesPath" "Literal['img']" is incompatible with "bytes" "Literal['img']" is incompatible with protocol "PathLike[bytes]" "__fspath__" is not present (reportGeneralTypeIssues) searx/engines/mongodb.py:8:6 - warning: Import "pymongo" could not be resolved (reportMissingImports) searx/engines/mysql_server.py:9:8 - warning: Import "mysql.connector" could not be resolved (reportMissingImports) searx/engines/postgresql.py:9:8 - warning: Import "psycopg2" could not be resolved from source (reportMissingModuleSource) searx/engines/xpath.py:187:28 - warning: "categories" is not defined (reportUndefinedVariable) searx/search/__init__.py:184:82 - warning: "flask" is not defined (reportUndefinedVariable) searx/search/checker/background.py:19:26 - error: Type of "schedule" is partially unknown Type of "schedule" is "(delay: Any, func: Any, *args: Any) -> Literal[True]" (reportUnknownVariableType) searx/shared/__init__.py:8:12 - warning: Import "uwsgi" could not be resolved (reportMissingImports) searx/shared/shared_uwsgi.py:5:8 - warning: Import "uwsgi" could not be resolved (reportMissingImports) ```
2022-07-30[clean up] drop obsolete searx, filtron and morty install scriptsMarkus Heiser
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[doc] update documentation of the installation proceduresMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-06-15[fix] test.yamllint: return non-zero exit code on warningsMarkus Heiser
SearXNG's YAML files should be free of any warnings. This will stop the test when there are warnings like:: [warning] truthy value should be one of [false, true] (truthy) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-05-07[fix] format.python: regexp argument '--include' in BLACK_TARGETSMarkus Heiser
--include TEXT A regular expression that matches files and directories that should be included on recursive searches. An empty value means all files are included regardless of the name. ... Exclusions are calculated first, inclusions later. [default: \.pyi?$] Closes: https://github.com/searxng/searxng/issues/1142 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-30[theme] peel out oscar from SearXNG developmentMarkus Heiser
This is the first step of removing oscar theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-23[mod] add test.pybabel to cover issues in translation tasksMarkus Heiser
We need to cover issue related to pybabel/translation tasks. By example there was an issue [1] (fixed [2]) when upgrading jinja2 from 3.0.3 to 3.1.0 [3] that has not been covered by the CI tests. [1] https://github.com/searxng/searxng/runs/5688624325?check_suite_focus=true#step:6:348 [2] https://github.com/searxng/searxng/pull/1011 [3] https://github.com/searxng/searxng/pull/1008 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-22[test.pyright] suppress unneeded error & warning messagesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-16[mod] add i18n infrastructure for SearXNG message files (searxng.msg)Markus Heiser
With this patch ``searxng.msg`` files can be added to SearXNG. In ``searxng.msg`` files messages can be defined which are not captured by babel's gettext, like the generic names of the categories or messages that are stored in constants. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-12[mod] replace /help by /info pages and include pages in project docsMarkus Heiser
This patch implements a bolierplate to share content from info-pages of the SearXNG instance (URL /info) with the project documentation (path /docs/user). The info pages are using Markdown (CommonMark), to include them in the project documentation (reST) the myst-parser [1] is used in the Sphinx-doc build chain. If base_url is known (defined in settings.yml) links to the instance are also inserted into the project documentation:: searxng_extra/docs_prebuild [1] https://www.sphinx-doc.org/en/master/usage/markdown.html Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-25[test.pyright] suppress warnings about intentional monkey patchingMarkus Heiser
The warnings: - "logger" is not defined' - "supported_languages" is not defined' - "language_aliases" is not defined' are very verbose and superfluous, since these messages are related to intentional monkey patching. [1] https://github.com/searxng/searxng/pull/783#issuecomment-1019818178 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-24[mod] introduce node.env.devtools functionMarkus Heiser
2022-01-23[fix] ensure that test.pyright installs pyrightMartin Fischer
nodejs.ensure only sets up NVM if there isn't a system-wide installation of Node that matches our NODE_MINIMUM_VERSION. The ubuntu image in the CI comes with an up to date node version, so pyright from .nvm_packages is never installed. This commit fixes this by introducing a package.json file.
2022-01-23[mod] add test.pyright to test & ci.test targetsMartin Fischer
Since we currently have many type checking errors, we for now only test with typeCheckingMode: off which makes pyright only check files that contain a comment: # pyright: basic to enable basic type checking, or # pyright: strict to enable strict type checking.
2022-01-23[enh] clarify why we run pyright in the pyenvMartin Fischer
2022-01-23[mod] manage test.pyright: a commandline to run pyright testsMarkus Heiser
This patch implements the command and Makefile target:: ./manage test.pyright make test.pyright Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-18[fix] issue reported by: make test.shellMarkus Heiser
$ make test.shell ./manage line 716: build_msg TEST "[reST markup] ${RST_FILES[@]}"" ^-------------^ SC2145: Argument mixes string and array. Use * or separate argument. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-17[mod] CI target test.rst: test reST markup of README.rstMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-11Merge pull request #686 from return42/lib_redisMarkus Heiser
Add redis DB and connector
2022-01-05[fix] debug console (pdb) in a session started by `make run`Markus Heiser
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-04Merge pull request #664 from return42/themes.liveMarkus Heiser
[mod] manage: add themes.live command (rebuild on modification)
2022-01-03[mod] script to build & install a redis instanceMarkus Heiser
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>
2021-12-29[mod] live build of a theme: LIVE_THEME=simple make runMarkus Heiser
Environment variable to get live builds while modifying CSS & JS of a theme:: LIVE_THEME=simple make run Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-29[fix] remove leftover from 59f4c792Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-29[mod] manage: add themes.live command (rebuild on modification)Markus Heiser
To have a live build while editing the HTML client of a theme. The first argument of the command is the theme name: ./manage themes.live simple Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[mod] test.black: show issues (diff) reported by python-blackMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[mod] replace pycodestyle by blackAlexandre Flament
"make test.black" checks for the code style "make format.python" format the python code
2021-12-24[fix] ./manage: upgrade geckodriver when GECKODRIVER_VERSION changeAlexandre Flament
2021-12-23[test.robot] update gecko driver / required by selenium 4.1.0Markus Heiser
Update gecko driver to v0.30.0 [1] [1] https://github.com/mozilla/geckodriver/releases/tag/v0.30.0 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-17[fix] weblate: separate commit description from commit bodyMarkus Heiser
It is a common convention to separate commit description from commit body by a empty line [1]. [1] https://www.conventionalcommits.org/en/v1.0.0/#summary Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-14[simple theme] activate - SearXNG JavaScript Style GuideMarkus Heiser
Add the 'SearXNG JavaScript Style Guide' as one quality gate in the build chain of the simple theme:: make themes.simple make themes.simple.test In the github CI the `themes.all` target enforce a `themes.simple`. BTW: Remove 'jshint' left overs from 0ee316f3d Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-28[mod] simple theme: use sharp instead of convert to create .png from .svgAlexandre Flament
define a custom grunt task, since grunt-sharp is too old (it can't be installed). in gruntfile.js, the image tasks are moved at the end the build chain. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-20[brand] initial - folder src/brand for searxng-wordmarkMarkus Heiser
Folder src/brand is intended to place logo, wordmark and more in. This commit moves the origin (source) of searxng-wordmark.svg from the simple theme into this folder About the new created src/ folder: On the long term we can move all the files from static/themes/<name>/src/* into a src/themes/<name>/* folder. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-18Merge pull request #508 from return42/arm64Markus Heiser
[mod] Tools to install and maintain golang binaries & packages.
2021-11-16[mod] Tools to install and maintain NVM versions manager for Node.jsMarkus Heiser
[1] https://github.com/nvm-sh/nvm Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>