summaryrefslogtreecommitdiff
path: root/utils
AgeCommit message (Collapse)Author
2021-09-17[mod] utils/lib.sh: add pyenv.activateAlexandre Flament
* initialize virtualenv (pyenv.install) * activate virtualenv close #310
2021-09-04[fix] Wording for Morty & Filtron error messageAllen
2021-08-20[fix] utils/searx.sh install settings - do not eval the templateMarkus Heiser
The settings template in utils/templates/etc/searx/settings.yml does not include any replacements (shell environment variables). BTW: utils/filtron.sh & utils/lib.sh Add some more messages to installation procedures, to be more clear. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-01manage script: remove unused reference to utils/brand.env and .config.shAlexandre Flament
2021-07-30[mod] searx.sh - improve some messages prompted while installationMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-30[fix] searx.sh - get_installed_version_variables()Markus Heiser
Fix the quotation marks in the command line to run python -m searx.version Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-30[fix] buildenv: first unset environment / then import searx packageMarkus Heiser
The first import of names from the searx package implies loading the settings.yml. Before this is done, the enviroment variables must be unset to not overwrite the values from the settings.yml Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-30version based on the git repositoryAlexandre Flament
This commit remove the need to update the brand for GIT_URL and GIT_BRANCH: there are read from the git repository. It is possible to call python -m searx.version freeze to freeze the current version. Useful when the code is installed outside git (distro package, docker, etc...)
2021-07-27Revert "[brand] !!DO NOT MERGE!! this patch uses branch fix-searx.sh @return42"Alexandre Flament
This reverts commit e946c3462c2b44fb154d0b6595f4f42605a326e5.
2021-07-24[brand] !!DO NOT MERGE!! this patch uses branch fix-searx.sh @return42Markus Heiser
Do not merge this patch in master branch of SearXNG! This branch exists only for testing the feature branch fix-searx.sh @return42. This patch changes the buildenv to:: GIT_URL='https://github.com/return42/searxng' GIT_BRANCH='fix-searx.sh' SEARX_PORT='7777' SEARX_BIND_ADDRESS='127.0.0.12' To test installation procedure, clone feature branch (fix-searx.sh):: $ cd ~/Downloads $ git clone --branch fix-searx.sh https://github.com/return42/searxng searxng $ cd searxng $ ./utils/searx.sh install all ... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[fix] ./utils/filtron.sh - FILTRON_TARGET from YAML settingsMarkus Heiser
The filtron target is the SearXNG installation and the default of FILTRON_TARGET is taken from the YAML configuration ('server.port' & 'server.bind_address'). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[fix] test.robot - do not use environment from ./utils/brand.envMarkus Heiser
Some defaults in the settings.yml are taken from the environment. By example; The manage scripts sources the ./utils/brand.env and sets SEARX_PORT environment. This enviroment *wins over* any settings in a YAML file. Whe we run a:: make test.robot The searx/settings_robot.yml is used, in this file the server settings are:: server: port: 11111 bind_address: 127.0.0.1 To get in use of the 'port: 11111' we have to unset the SEARX_PORT environment which was sourced before. The function buildenv.unset_env() can be called in all use cases where the enviroment from ./utils/brand.env is not wanted. ATM it unset the enviroment variables:: unset GIT_URL unset GIT_BRANCH unset SEARX_URL unset SEARX_PORT unset SEARX_BIND_ADDRESS Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[mod] reduce enviroment variables in shell scripts to what is neededMarkus Heiser
Not all settings from the 'brand:' section of the YAML files are needed in the shell scripts. This patch reduce the variables in ./utils/brand.env to what is needed. The following ('brand:' settings) can be removed from this file: - ISSUE_URL - DOCS_URL - PUBLIC_INSTANCES - WIKI_URL Tasks running outside of an *installed instance*, need the following settings from the YAML configuration: - GIT_URL <--> brand.git_url - GIT_BRANCH <--> brand.git_branch - SEARX_URL <--> server.base_url (aka PUBLIC_URL) - SEARX_PORT <--> server.port - SEARX_BIND_ADDRESS <--> server.bind_address Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[mod] utils/searx.sh - add command 'inspect settings'Markus Heiser
Inspect YAML setting <key> from SearXNG instance (${SEARX_SRC}):: utils/searx.sh inspect settings server.base_url utils/lib_install.sh should not log on stdout which is used for the output of function prompt_installation_setting(). Turned build_msg (stdout) into info_msg (stderr). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[brand] searx.sh & morty.sh - renamed 'searx' into 'SearXNG'Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[mod] utils/.searx.sh: add commands: install [dot-config|init-src]Markus Heiser
This patch implements two new commands: install dot-config : - copy ./config.sh to ${SEARX_SRC} - implemented in new function install_DOT_CONFIG install init-src: - sync files (SEARX_SRC_INIT_FILES) with ${SEARX_SRC} - implemented in new function init_SEARX_SRC() new functions: verify_continue_install() and prompt_installation_status() These functions are used in installation procedures to get the status of the installation procedure. The status is based on the existing function: usage: install_searx_get_state Prompts a string indicating the status of the installation procedure missing-searx-clone: There is no clone at ${SEARX_SRC} missing-searx-pyenv: There is no pyenv in ${SEARX_PYENV} installer-modified: There are files modified locally in the installer (clone), see ${SEARX_SRC_INIT_FILES} description. python-installed: Scripts can be executed in instance's environment - user: ${SERVICE_USER} - pyenv: ${SEARX_PYENV} Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[mod] normalize .config.sh with settings.ymlMarkus Heiser
In commit 94851790 we have centralized all SearXNG setups in the settings.yml file: 94851790 [mod] move brand options from Makefile to settings.yml This step has not yet been completed for the installation procedures! Since all SearXNG setups are done in the settings.yml these environment variables needs to be removed from the ./conf.sh file. Scripts and other tasks running outside of an instance got the needed values from the ./utils/brand.env file. By example: ATM the environment variables of the ./config.sh file are in conflict with them from settings.yml: - PUBLIC_URL --> {server:base_url} - SEARX_INTERNAL_HTTP --> {server:bind_address}.{server:port} - GIT_BRANCH --> {brand:GIT_URL} These environment variable of a SearXNG instance and additional - SEARX_SETTINGS_TEMPLATE has been remove from the '.config.sh' file. With this patch, the main focus of ./conf.sh resists on environment variables needed for the installation of morty, filtron software. modified .config.sh: - removed no longer supported variables (see above) - add comment about: SearXNG setup in settings.yml modified utils/searx.sh: - SEARX_INTERNAL_HTTP no longer take from .config.sh - SEARX_SETTINGS_PATH /etc/searx/settings.yml - SEARX_SETTINGS_TEMPLATE obsolete modified utils/lib_install.sh: Initialize environment variables SEARX_PYENV, SEARX_SETTINGS_PATH and PUBLIC_URL. modified: utils/morty.sh Add missing hint about SEARX_SETTINGS_PATH and move PUBLIC_URL to utils/lib_install.sh modified: utils/morty.sh Move PUBLIC_URL to utils/lib_install.sh Renamed utils/templates/etc/searx/use_default_settings.yml -> settings.yml - removed option which can't be modified after installation - add some comments with examples Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[fix] utils/build_env.py and add documentationMarkus Heiser
modified docs/admin/engines/settings.rst - Fix documentation and add section 'brand'. - Add remarks about **buildenv** variables. - Add remarks about settings from environment variables $SEARX_DEBUG, $SEARX_PORT, $SEARX_BIND_ADDRESS and $SEARX_SECRET modified docs/admin/installation-searx.rst & docs/build-templates/searx.rst Fix template location /templates/etc/searx/settings.yml modified docs/dev/makefile.rst Add description of the 'make buildenv' target and describe - we have all SearXNG setups are centralized in the settings.yml file - why some tasks need a utils/brand.env (aka instance's buildenv) modified manage Settings file from repository's working tree are used by default and ask user if a /etc/searx/settings.yml file exists. modified searx/settings.yml Add comments about when it is needed to run 'make buildenv' modified searx/settings_defaults.py Default for server:port is taken from enviroment variable SEARX_PORT. modified utils/build_env.py - Some defaults in the settings.yml are taken from the environment, e.g. SEARX_BIND_ADDRESS (searx.settings_defaults.SHEMA). When the 'brand.env' file is created these enviroment variables should be unset first. - The CONTACT_URL enviroment is not needed in the utils/brand.env Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[mod] load .config.sh from installation (utils/lib_install.sh)Markus Heiser
**new** utils/lib_install.sh: Used to initialize installation procedures - Modified source_dot_config function that - loads .config.sh from an existing installation (at SEARX_SRC). - initialize **SEARX_SRC_INIT_FILES** - functions like: - install_log_searx_instance() - install_searx_get_state() **modified** utils/searx.sh - obsolete environment SEARX_INSTANCE_NAME has been replaced by string 'SearXNG'. **modified** utils/filtron.sh, utils/morty.sh, utils/searx.sh - source utils/lib_install.sh - normalize logging of environment variables using new function install_log_searx_instance() **modified** utils/lib.sh - fix marginal typos **Installation scripts** The utils/lib_install.sh is sourced by the installations scripts: - utils/searx.sh - utils/morty.sh - utils/filtron.sh If '${SEARX_SRC}/.config.sh' exists, the modified source_dot_config() function loads this configuration (instead of './.config.sh'). **SEARX_SRC_INIT_FILES** Array of file names to sync into a installation at $SEARX_SRC. The file names are relative to the $REPO_ROOT. Set by function init_SEARX_SRC_INIT_FILES(). Most often theses are files like: - .config.sh - searx/settings.yml - utils/brand.env - ... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[mod] make pyenv.OK() less verbose when pyenv is OKMarkus Heiser
Prompt the verbose messages ... PYENV [check] import yaml --> OK PYENV OK only when environment $VERBOSE is active. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-21[mod] drop unused setting option brand:twitter_urlMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-18[mod] drop usage of the searx.brand namespace (python procs)Markus Heiser
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>
2021-07-03[fix] pacman --noprogressbar in shell scriptsMarkus Heiser
From pacman's man page: --noprogressbar Do not show a progress bar when downloading files. This can be useful for scripts that call pacman and capture the output. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-03[fix] utils/lib.sh: in a pipe, do not print ASCII escape codeMarkus Heiser
In 2a12637 an ASCII escape code was added, such escape codes should not be written to pipes (when the output is not a terminal). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-28Merge pull request #174 from searxng/static_scriptAlexandre Flament
[mod] add make targets to manage the build files in the /searx/static directory
2021-06-27[fix] utils/lib.sh: prefix_stdout show cursor (ANSI escape \e[?25h)Markus Heiser
Some piped commands hide the cursor, show cursory when the stream ends. Most often this is a bug of the command which piped. The command should not hide the cursor when it writes to a pipe. I have seen this bug with the package manager (pacman) from ArchLinux. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[mod] move functions from utils/manage_static.sh to ./manage scriptMarkus Heiser
The functions: - static.build.commit - static.build.commit.drop - static.build.restore are imported into the ./manage script. To avoid name collisions some variables and fucntions has been renamed by adding the prefix *static_*. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[mod] utils/manage_static.sh: remove git_log_current_branchMarkus Heiser
Marginal simplification of the procedure to get only the last local commit which is not in remotes. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[mod] utils/manage_static.sh: simplify git restore actionsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[mod] utils/manage_static.sh: add script to shellcheckMarkus Heiser
- add script to shellcheck, - fix error messages from shellcheck and - moved global variables to local variables (lower case) No functional change! Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[mod] add make targets to manage the build files in the /searx/static directoryAlexandre Flament
The idea is to avoid conflict when there are differents branches with changes are made on the static files. A solution is to ask the administrators to build the files from the sources, but it requires to install the npm dependencies. So the solution in this commit keep the sources and the build files in the same git repository. In one branch, the modification of the source (*.less, *.js) are commited without the built files. The built files are commited in a uniq commit, with a commit message "Static build" In case of merge or rebase, this commit can be dropped. New make targets: * static.build.commit.drop: drop the last "Static build". The command checks that there are only build files in the commit. * static.build.commit : call "make static.build.commit.drop" call "make themes.all" commit the files * static.git.restore.staged: git restore --staged <build files> * static.git.restore: git restore <build files> Related to https://github.com/searxng/searxng/issues/137
2021-06-25Merge pull request #173 from return42/fix-lxc-iptablesMarkus Heiser
[mod] utils/lxc.sh: detect conflict of docker & LXC in the iptables
2021-06-23[mod] utils/lxc.sh: detect conflict of docker & LXC in the iptablesMarkus Heiser
Docker is blocking network of existing LXC containers / there is a conflict in the iptables setup of Docker & LXC. With this patch: - utils/lxc.sh checks internet connectivity (instead of silently hang) - Chapter "Internet Connectivity & Docker" describes the problem and made a suggestion for a solution a solution Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-23[fix] utils/searx.sh: signature of YAML settings has been changedMarkus Heiser
In 5a7b12ee we changed the signature of the YAML settings, this patch takes this into account. Related-to: 5a7b12ee [yamllint] searx/settings.yml Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-22[mod] simple theme: include fontsAlexandre Flament
"npm run webfont" to build the fonts directory. It requires fontforge and ttfautohint distro packages. partial revert of commit 7137d2893f33e9158e8563a21d9586119d175269
2021-06-17[enh] ./manage node.env - check build tools firstMarkus Heiser
The node.env build environment require npm, ttfautohint and fontforge installed in the OS. These tools can be installed by:: sudo -H ./utils/searx.sh install buildhost If one of the tools is not installed, the script node.env stops with a appropriate message. BTW: We ignore CentOS-7 as developer & build platform Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-16[mod] simple theme: remove src/less/ion.lessAlexandre Flament
This file is generated by webfont. * It is now generated as searx/static/themes/simple/ion.less * It is generated before the .less compilation. * .gitignore includes this file Add two new package depedencies: fontforge ttfautohint See utils/searx.sh
2021-06-13[fix] utils/morty.sh - PUBLIC_URL_MORTY is based on PUBLIC_URLMarkus Heiser
The public URL of the searx instance: PUBLIC_URL="https://mydomain.xy/searx" The default is SEARX_URL which is taken from ./utils/brand.env. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-12[yamllint] ./utils/templates/etc/searx/*.ymlMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-28[enh] add settings option to enable/disable search formatsMarkus Heiser
Access to formats can be denied by settings configuration:: search: formats: [html, csv, json, rss] Closes: https://github.com/searxng/searxng/issues/95 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-28[fix] typo: 'interactiv' --> 'interactive'Markus Heiser
Reported-by: https://github.com/searxng/searxng/pull/38#pullrequestreview-646940531 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-28[filtron.sh] make filtron rule file configurableMarkus Heiser
To select a different file with filtron rules, set environment FILTRON_RULES_TEMPLATE the default is utils/templates/etc/filtron/rules.json The installation is done by the new function install_rules() which offers a multiple choice in case of collisions (known from searx.sh install setup). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-25[brand] searxng -- fix links to issue tracker & WEB-GUIMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-23[mod] replace makefile boilerplate by 'manage' scriptMarkus Heiser
Replaces the make targets with the bash scripts Signed-off-by: Markus Heiser <markus@darmarit.de>
2021-04-23[fix] do not spit out error messages for utils/lxc.sh --helpMarkus Heiser
Error:: $ utils/lxc.sh --help ERROR: missing command lxc ... This breaks also docs build:: $ make docs ... WARNING: Unexpected return code 42 from command '../utils/lxc.sh --help' ... Signed-off-by: Markus Heiser <markus@darmarit.de>
2021-04-23[enh] utils/lib.sh - commands to build Sphinx-doc & deploy gh-pagesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-23[enh] utils/lib.sh - commands pyenv, pyenv.drop pyenv.(un)installMarkus Heiser
Implement a boilerplate to manage performance optimized virtualenv builds. Shell scripts can use (e.g.) 'pyenv.cmd' to execute command in the virtualenv without having to worry about whether and how the environment is provided. :: pyenv.cmd which python ..../local/py3/bin/python pyenv.cmd which pip ..../local/py3/bin/pip If pyenv.cmd released multiple times the installation will only rebuild if the function 'pyenv.OK' fails. Function 'pyenv.OK' make some test to validate that the virtualenv exists and works as expected. The check also fails if requirements listed requirements-dev.txt and requirements.txt has been edited. Among these tests 'pyenv.OK' calls 'pyenv.check' which implements a python script that validate the python installation. Here is an example how a 'pyenv.check' implementation could look like:: pyenv.check() { cat <<EOF import yaml print('import yaml --> OK') EOF } Signed-off-by: Markus Heiser <markus@darmarit.de>
2021-04-23[fix] utils/searx.sh - Double quote to prevent globbingMarkus Heiser
Fix issues reported by `make test.sh` Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-22More brandingAlexandre Flament
2021-04-22searxng brandAlexandre Flament