Commit Graph

48 Commits (master)

Author SHA1 Message Date
Markus Heiser 3d96a9839a [format.python] initial formatting of the python code
This patch was generated by black [1]::

    make format.python

[1] https://github.com/psf/black

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Alexandre Flament 430babca25 SearXNG: environment variables 3 years ago
Alexandre Flament 6abc37efc7 [mod] production mode: make sure to set the log level to WARNING
set:
* the root logger level to WARNING
* the werkzeug logger level to WARNING (useful when there is no uwsgi)
3 years ago
Alexandre Flament 577998106a [mod] debug mode: use coloredlogs package
in debug mode, add some padding to make the output more readable
in procution mode, add the timestamp
3 years ago
Markus Heiser 2a3b9a2e26 [pylint] searx: drop no longer needed 'missing-function-docstring'
Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 6fbf5180bf [mod] drop obsolete searx.brand namespace
The usages of the searx.brand namespace has been removed, the searx.brand
namespace is now longer needed.

The searx.brand namespace was an interim solution which has been added in commit
9e53470b4, see commit message there ...

    This patch is a first 'proof of concept'.  Later we can decide to remove the
    brand namespace entirely or not.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser c9220de690 [mod] drop unused setting option brand:twitter_url
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 3e50e8de3e [mod] drop usage of the searx.brand namespace (python procs)
Added function searx.get_setting(name, default=_unset):
  Returns the value to which ``name`` point.  If there is no such name in the
  settings and the ``default`` is unset, a KeyError exception is raised.

In all the python processes ..

- make docs
- make buildenv
- make install (setup.py)

the usage of the 'brand.*' name space is replaced by 'searx.get_setting'
function.

- brand.SEARX_URL        --> get_setting('server.base_url')
- brand.GIT_URL          --> get_setting('brand.git_url')
- brand.GIT_BRANCH'      --> get_setting('server.base_url')
- brand.ISSUE_URL        --> get_setting('brand.issue_url')
- brand.DOCS_URL         --> get_setting('brand.docs_url')
- brand.PUBLIC_INSTANCES --> get_setting('brand.public_instances')
- brand.CONTACT_URL      --> get_setting('general.contact_url', '')
- brand.WIKI_URL         --> get_setting('brand.wiki_url')
- brand.TWITTER_URL      --> get_setting('brand.twitter_url', '')

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 70bbd14b1a [mod] move hook to set Unix thread name into searx.unixthreadname
requires setproctitle (but optional)
3 years ago
Markus Heiser 495d86b520 [pylint] searx/__init__.py & searx/settings_defaults.py
BTW: normalize some indentations in searx/settings_defaults.py

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 4b07df62e5 [mod] move all default settings into searx.settings_defaults 3 years ago
Alexandre Flament b8f5adf500 [mod] searx.metrics.error_recorder: store relative file name instead of the full absolute file name. 3 years ago
Alexandre Flament df41b77121 [mod] /stats : detail per engine
allow to submit a github issue including the technical details
(exceptions, errors, warning, checker result)
3 years ago
Alexandre Flament 424e6abc7e [mod] settings.yml: move brand settings to a dedicated section 3 years ago
Markus Heiser 9e53470b4c [mod] get rid of searx/brand.py
Removes module searx/brand.py and creates a namespace at searx.brand.

This patch is a first 'proof of concept'.  Later we can decide to remove the
brand namespace entirely or not.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 568b9465e9 [mod] check secret_key when searx.webapp is imported
Without this commit the module searx checks the secret_key value.

With this commit, make docs, utils/standalone_searx.py,
utils/fetch_firefox_version.py works without SEARX_DEBUG=1

For reference see https://github.com/searx/searx/pull/2386
3 years ago
Alexandre Flament b4b81a5e1a [enh] settings.yml: add use_default_settings option (2nd version) 4 years ago
Alexandre Flament 1cfe7f2a75 [enh] settings.yml: add use_default_settings option
This change is backward compatible with the existing configurations.

If a settings.yml loaded from an user defined location (SEARX_SETTINGS_PATH or /etc/searx/settings.yml),
then this settings can relied on the default settings.yml with this option:
user_default_settings:True
4 years ago
Noémi Ványi 116f7a6daa Force admins to set secret_key if debug mode is disabled
This commit also enables debug mode for unit tests.
4 years ago
Alexandre Flament 93f7f7eee2 [mod] upgrade requests to version 2.24.0. use ssl instead of pyopenssl.
requests 2.24.0 uses the ssl module except if it doesn't support SNI, in this case searx fallbacks to pyopenssl.
searx logs a critical message and exit if the ssl modules doesn't support SNI and pyOpenSSL is not installed.
searx logs a critical message and exit if the ssl version is older than 1.0.2.
in requirements.txt, pyopenssl is still required to install searx as a fallback.
4 years ago
Dalf 1022228d95 Drop Python 2 (1/n): remove unicode string and url_utils 4 years ago
Adam Tauber dff879d07d [fix] resolve minor review issues 4 years ago
Adam Tauber 1f2dc6c647 [enh] add external plugin support 4 years ago
Noémi Ványi 99435381a8 [enh] introduce private engines
This PR adds a new setting to engines named `tokens`.
It expects a list of tokens which lets searx validate
if the request should be accepted or not.
4 years ago
Nicolas Gelot db1dfa4a28 Add addr setup via SEARX_BIND_ADDRESS 5 years ago
Noémi Ványi 2478c5395d update pyyaml 5 years ago
Marc Abonce Seguin 829032f306 [fix] read utf-8 files (settings, languages, currency) with python3.5
Related to discussion in #1124
The io.open import is necessary for python2
6 years ago
Adam Tauber 8511e64f35
Merge pull request #1124 from JosephKiranBabu/python3-unicode-support
Make Python 3 able to read settings files with Unicode characters
6 years ago
Adam Tauber e303339370 [enh] overwrite secret_key from env with the SEARX_SECRET env var if exists - closes #845 6 years ago
Joseph Nuthalapati bdc803e185
Make Python 3 able to read settings files with Unicode characters
SearX currently doesn't start up when run with Python 3 as it tries to parse the
settings.yml file with ASCII codecs.
There are similar problems with engines_languages.json and currencies.json
Python 3 requires that files with Unicode characters be read with a 'b' flag.
This also works with Python 2 and hence can be integrated into the main source
code.

Tested with the latest Python 3.6.4rc1 on Debian unstable.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
6 years ago
Alexandre Flament 9c91ab33f8 [mod] settings.yml can be /etc/searx/settings.yml
The exact order is
* first from SEARX_SETTINGS_PATH,
* if not found then from searx code base,
* if not found then from /etc/searx/settings.yml
* if not found an exception stops searx loading
7 years ago
dalf 3e7554422b [mod] the environment variable SEARX_DEBUG can override the general.debug value in settings.yml 8 years ago
misnyo f86e212dba [fix]#485 AttributeError: 'module' object has no attribute 'old_where' 8 years ago
misnyo 35a2bc5650 [fix] #471 #463 fix old openssl(<1.0.2) requests verify error 9 years ago
Thomas Pointhuber 9cec9770be [fix] show debug output when enabled 9 years ago
Adam Tauber d2a636f75d [mod] https rewrite pluginification 9 years ago
Adam Tauber 6cbd29f674 [enh] logging added 9 years ago
Adam Tauber 5740cfbf1c [fix] pep8 part II. 10 years ago
Adam Tauber 20400c40c3 Merge pull request #97 from pointhi/https
Implementing https rewrite support
10 years ago
Thomas Pointhuber 0616d26feb improve https rewriting 10 years ago
Thomas Pointhuber 9b9f097adb Implementing https rewrite support #71
* parsing XML-Files which contain target, exclusions and rules
* convert regex if required (is a little hack, probably does not work
for all rules)
* check if target rule apply for http url, and use the rules to rewrite
it
* add pice of code, to check if domain name has not changed during
rewrite (should be rewritten, using publicsuffix instead of little hack)
10 years ago
Thomas Pointhuber bc30c4f4ad add comments to __init__.py
* add comments
* add licence-header
10 years ago
Matej Cotman dd4662978d fix: robot fw, entry points, some flake8, package searx egg 10 years ago
asciimoo 3afdd1d994 [enh] settings unification - new dependency: pyyaml 10 years ago
asciimoo d793c2733c [enh] engine types 11 years ago
asciimoo fad906453f [fix] result template tag fix 11 years ago
asciimoo 157dcaab62 [enh] result template added 11 years ago
asciimoo ae9fb1d7dc [enh] initial commit 11 years ago