summaryrefslogtreecommitdiff
path: root/utils/lib.sh
AgeCommit message (Collapse)Author
2021-11-16[fix] filtron & morty - install golang binary that fits to arch & osMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/507 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-17[mod] utils/lib.sh: add pyenv.activateAlexandre Flament
* initialize virtualenv (pyenv.install) * activate virtualenv close #310
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-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-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-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-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-25[brand] searxng -- fix links to issue tracker & WEB-GUIMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@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-01-02[fix] remove Ubuntu 19.10 from the LXC suite (EOL)Markus Heiser
Official support for Ubuntu 19.10 'Eoan Ermine' ended on July 17, 2020. The image has been dropped [1] from https://images.linuxcontainers.org [1] https://github.com/lxc/lxc-ci/commit/d161de601bffe4055d77b9d52a826ce5d81567d9 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-12-26[mod] LXC_ENV_FOLDER moved from ./lxc to ./lxc-envMarkus Heiser
BTW: - add target $(LXC_ENV_FOLDER) - fix indentations Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-12-26[fix] utils/lib.sh: various typos in messages and commentsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-12-18[fix] yum installation of 'Development Tools'Markus Heiser
'yum install' does not support '@development-tools' notation for group installation. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-12-18[mod] remove obsolete virtualenv commandMarkus Heiser
Installation and use of the command 'virtualenv' was only needed in py2 and py2 is no longer suported by searx. In py3 the command is replaced by 'python -m venv'. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-09-28[fix] migration from github.com/asciimoo/searx to github.com/searx/searx : ↵Alexandre Flament
fix URLs
2020-08-01Utility scripts adapted to run on CentOS 7 (#2112)Eliesemoule
2020-04-22[fix] old images need an initial 'apt update'Markus Heiser
see https://github.com/asciimoo/searx/pull/1803#issuecomment-616684353 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-13tooling box: added nginx + polished bash scripts and environmentMarkus Heiser
- add installation method for nginx sites, morty and filtron - clean up PUBLIC_URL environment in and outside of containers - clean up comand lines - handle uWSGI quirks on fedora (emperor mode) - handle Python quirks on debian (there is no 'python' command anymore) - lib.sh: add die and die_caller functions - lxc_suite_install_info is now a function - lint: shellcheck Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-11nginx: normalize installation (docs and script)s over all distrosMarkus Heiser
This is the revision of the documentation about the varous nginx installation variants. It also implements the nginx installation scripts for morty and filtron. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-10bash scripts: source code cleaned up (shellcheck)Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-08Changes from the installation tests on (all) LXC containers.Markus Heiser
Tested and fixed HTTP & uWSGI installation on: ubu1604 ubu1804 ubu1910 ubu2004 fedora31 archlinux Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-07apache: normalize installation (docs and script)s over all distrosMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-06docs: rework of chapter "Install with apache"Markus Heiser
BTW: normalize installation-nginx.rst
2020-04-05[fix] creation of /.lxcenv in containersMarkus Heiser
In utils/lib.sh there are two functions with the same name, but different tasks. Rename one of them from lxc_init_container() into lxc_init_container_env(). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-04misc: fix variuous marginalsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-03utils/lxc.sh: support build of selected containersMarkus Heiser
$ sudo -H ./utils/lxc.sh build <name> $ sudo -H ./utils/lxc.sh show [images|suite|info|config [<name>]] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-04-02LXC: add virtualenv to LXC_BASE_PACKAGESMarkus Heiser
Commit 09a40625 adds virtualenv dependency. BTW remove deprecated --no-site-packages. Not having access to global site-packages is now the default behavior. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-30[fix] make test.sh: fix various shellcheck error messagesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-23lxc.sh install base: add bash and python3 to LXC_BASE_PACKAGESMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-23LXC: set LXC_ENV_FOLDER=lxc/$(shell hostname)/Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-18./utils/lxc.sh: add command 'install base'Markus Heiser
to install basic packages like git and *build essentials*:: $ ./utils/lxc.sh install base Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-18LXC: add /.lxcenvMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-08shellcheck: minor fixes to support all dsitrosMarkus Heiser
checked with:: sudo ./utils/lxc.sh cmd -- make test.sh on ubu1804, ubu1910, fedora31 and archlinux. All checks OK except: ubu1604: uses shellcheck v0.3.7 (from 04/2015) which is no longer supported! Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-07LXC: separate lxc-suite from lxc & improved command line.Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-06docs: improve description of uwsgi & ngingx setupMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-03docs: generic doocumentation for searx-uwsgiMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-02docs: generic documentation from the installation scriptsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-27LXC: improved UX when working with a bunch of containersMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-26LXC: install searx-suite installs searx, filtron & morty on all containersMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-25utils/lib.sh: make uWSGI installation available for all distrosMarkus Heiser
support: ubuntu, debin, fedora, archlinux Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-23utils/serx.sh: make uWSGI installation available for all distros (WIP)Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-23LXC: normalize package installation & user creation.Markus Heiser
utils/lib.sh: - get DIST_ID & DIST_VERSION from /etc/os-release - pkg_[install|remove|...] supports ubuntu, debian, archlinux & fedora utils/lxc.sh - Workaround for the "setrlimit(RLIMIT_CORE): Operation not permitted" error:: 'Set disable_coredump false' >> /etc/sudo.conf utils/[searx.sh|filtron.sh|morty.sh] - switched user creation from 'adduser' perl script to 'useradd' built-in command utils/searx.sh - install packages for ubuntu, debian, archlinux & fedora Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-16tooling box: misc fixes from lxc testsMarkus Heiser
Tested by: sudo -H ./utils/lxc.sh build containers sudo -H ./utils/lxc.sh cmd /share/searx/utils/searx.sh install all sudo -H ./utils/lxc.sh cmd /share/searx/utils/filtron.sh install all sudo -H ./utils/lxc.sh cmd /share/searx/utils/morty.sh install all Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-16shellcheck: fix usse -n instead of ! -z (SC2236 SC2237)Markus Heiser
- https://www.shellcheck.net/wiki/SC2236 -- Use -n instead of ! -z. - https://www.shellcheck.net/wiki/SC2237 -- Use [ -n .. ] instead of ! [ -z .... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-11filtron.sh: add 'install rules' commandMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-04tooling box ./utils/*: minor fix from production testMarkus Heiser
2020-02-04utils & Makefile: add .config.mk & .config.sh for searx brandsMarkus Heiser
By isolating the environment of makefiles and bash scripts into .config.mk and .config.sh it is simple to maintain searx brands by setting some central environments. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>