diff options
| -rw-r--r-- | .config.sh | 5 | ||||
| -rw-r--r-- | searx/data/useragents.json | 8 | ||||
| -rwxr-xr-x | utils/lib.sh | 14 | ||||
| -rw-r--r-- | utils/makefile.include | 2 | ||||
| -rw-r--r-- | utils/makefile.lxc | 7 | ||||
| -rw-r--r-- | utils/makefile.python | 26 | ||||
| -rwxr-xr-x | utils/searx.sh | 14 |
7 files changed, 45 insertions, 31 deletions
diff --git a/.config.sh b/.config.sh index f9bac7383..7eed5f681 100644 --- a/.config.sh +++ b/.config.sh @@ -28,7 +28,10 @@ fi # SEARX_INTERNAL_URL="127.0.0.1:8888" # SEARX_SETTINGS_TEMPLATE="${REPO_ROOT}/utils/templates/etc/searx/use_default_settings.yml" -# Only change, if you maintain a searx brand in your searx fork. +# Only change, if you maintain a searx brand in your searx fork (GIT_URL) which +# is not hold by branch 'master'. The branch has to be a local branch, in the +# repository from which you install (which is most often the case). If you want +# to install branch 'foo', don't forget to run 'git branch foo origin/foo' once. # GIT_BRANCH="${GIT_BRANCH:-master}" # filtron.sh diff --git a/searx/data/useragents.json b/searx/data/useragents.json index d464ec5f6..b296f823b 100644 --- a/searx/data/useragents.json +++ b/searx/data/useragents.json @@ -1,12 +1,12 @@ { "versions": [ - "75.0", - "74.0.1", - "74.0" + "84.0.1", + "84.0", + "83.0" ], "os": [ "Windows NT 10.0; WOW64", "X11; Linux x86_64" ], "ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}" -} +}
\ No newline at end of file diff --git a/utils/lib.sh b/utils/lib.sh index 0d93138cc..83dd75077 100755 --- a/utils/lib.sh +++ b/utils/lib.sh @@ -41,7 +41,7 @@ DOT_CONFIG="${DOT_CONFIG:-${REPO_ROOT}/.config.sh}" source_dot_config() { if [[ ! -e "${DOT_CONFIG}" ]]; then - err_msg "configuration does not extsts at: ${DOT_CONFIG}" + err_msg "configuration does not exists at: ${DOT_CONFIG}" return 42 fi # shellcheck disable=SC1090 @@ -159,7 +159,7 @@ clean_stdin() { } wait_key(){ - # usage: waitKEY [<timeout in sec>] + # usage: wait_key [<timeout in sec>] clean_stdin local _t=$1 @@ -639,7 +639,7 @@ nginx_distro_setup() { NGINX_DEFAULT_SERVER=/etc/nginx/nginx.conf # Including *location* directives from a dedicated config-folder into the - # server directive is, what what fedora and centos (already) does. + # server directive is, what fedora and centos (already) does. NGINX_APPS_ENABLED="/etc/nginx/default.d" # We add a apps-available folder and linking configurations into the @@ -692,7 +692,7 @@ nginx_reload() { nginx_install_app() { - # usage: nginx_install_app [<template option> ...] <myapp> + # usage: nginx_install_app [<template option> ...] <myapp.conf> # # <template option>: see install_template @@ -1381,7 +1381,7 @@ in_container() { LXC_ENV_FOLDER= if in_container; then # shellcheck disable=SC2034 - LXC_ENV_FOLDER="lxc/$(hostname)/" + LXC_ENV_FOLDER="lxc-env/$(hostname)/" fi lxc_init_container_env() { @@ -1413,8 +1413,8 @@ LXC_BASE_PACKAGES_centos="bash git python3" case $DIST_ID in ubuntu|debian) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_debian}" ;; arch) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_arch}" ;; - fedora) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_fedora}" ;; - centos) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_centos}" ;; + fedora) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_fedora}" ;; + centos) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_centos}" ;; *) err_msg "$DIST_ID-$DIST_VERS: pkg_install LXC_BASE_PACKAGES not yet implemented" ;; esac diff --git a/utils/makefile.include b/utils/makefile.include index 35a5134d9..879dcc23c 100644 --- a/utils/makefile.include +++ b/utils/makefile.include @@ -5,7 +5,7 @@ PHONY += lxc-activate lxc-purge lxc-activate: @$(MAKE) -s -f "$$(dirname $(abspath $(lastword $(MAKEFILE_LIST))))/makefile.lxc" lxc-activate lxc-purge: - $(Q)rm -rf ./lxc + $(Q)rm -rf ./lxc-env else include /.lxcenv.mk endif diff --git a/utils/makefile.lxc b/utils/makefile.lxc index fd999e40d..95a8d4317 100644 --- a/utils/makefile.lxc +++ b/utils/makefile.lxc @@ -9,10 +9,10 @@ # sudo make ./utils/makefile.lxc lxc-activate # sudo make ./utils/makefile.lxc lxc-deactivate -LXC_ENV_FOLDER=lxc/$(shell hostname)/ +LXC_ENV_FOLDER=lxc-env/$(shell hostname)/ lxc-help:: - @echo 'LXC: running in container LXC_ENV_FOLDER=$(LXC_ENV_FOLDER)' + @echo ' LXC: running in container LXC_ENV_FOLDER=$(LXC_ENV_FOLDER)' # If not activated, serve target 'lxc-activate' .. ifeq (,$(wildcard /.lxcenv.mk)) @@ -24,6 +24,9 @@ else PHONY += lxc-deactivate lxc-deactivate: rm /.lxcenv.mk +$(LXC_ENV_FOLDER): + $(Q)mkdir -p $(LXC_ENV_FOLDER) + $(Q)echo placeholder > $(LXC_ENV_FOLDER).placeholder endif .PHONY: $(PHONY) diff --git a/utils/makefile.python b/utils/makefile.python index 12e3e1236..42ad16d23 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -75,7 +75,9 @@ msg-python-exe: https://www.python.org or install it from your package\n\ manager. On debian based OS these requirements are\n\ installed by::\n\n\ - sudo -H apt-get install $(PYTHON)\n" | $(FMT) + sudo -H add-apt-repository ppa:deadsnakes/ppa\n\ + sudo -H apt update\n\ + sudo -H apt-get install $(PYTHON) $(PYTHON)-venv\n" ifeq ($(shell which $(PYTHON) >/dev/null 2>&1; echo $$?), 1) python-exe: msg-python-exe @@ -95,7 +97,13 @@ quiet_cmd_pyinstall = INSTALL $2 # $2 path to folder with setup.py, this uses pip from pyenv (not OS!) quiet_cmd_pyenvinstall = PYENV install $2 - cmd_pyenvinstall = $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS) + cmd_pyenvinstall = \ + if ! cat $(PY_ENV)/requirements.sha256 2>/dev/null | sha256sum --check --status 2>/dev/null; then \ + $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS) ;\ + sha256sum requirements*.txt > $(PY_ENV)/requirements.sha256 ;\ + else \ + echo "PYENV $2 already installed"; \ + fi # Uninstall the package. Since pip does not uninstall the no longer needed # depencies (something like autoremove) the depencies remain. @@ -113,6 +121,8 @@ quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate cmd_virtualenv = \ if [ ! -d "./$(PY_ENV)" ];then \ $(PYTHON) -m venv $(VTENV_OPTS) $2; \ + $(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -U pip wheel setuptools; \ + $(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt; \ else \ echo "PYENV using virtualenv from $2"; \ fi @@ -193,8 +203,6 @@ pyclean: pyenv: $(PY_ENV) $(PY_ENV): python-exe $(call cmd,virtualenv,$(PY_ENV)) - $(Q)$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -U pip wheel pip setuptools - $(Q)$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt PHONY += pylint-exe pylint-exe: $(PY_ENV) @@ -220,16 +228,8 @@ PHONY += pydebug pydebug: $(PY_ENV) DEBUG=$(DEBUG) $(PY_ENV_BIN)/pytest $(DEBUG) -v $(TEST_FOLDER)/$(TEST) -# install / uninstall python objects into virtualenv (PYENV) -pyenv-install: $(PY_ENV) - @$(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e . - @echo "ACTIVATE $(call normpath,$(PY_ENV_ACT)) " - -pyenv-uninstall: $(PY_ENV) - @$(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) uninstall --yes . - # runs python interpreter from ./local/py<N>/bin/python -pyenv-python: pyenv-install +pyenv-python: pyenvinstall $(PY_ENV_BIN)/python -i # With 'dependency_links=' setuptools supports dependencies on packages hosted diff --git a/utils/searx.sh b/utils/searx.sh index 5a24a016e..3a21e2225 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -36,7 +36,7 @@ GIT_BRANCH="${GIT_BRANCH:-master}" SEARX_PYENV="${SERVICE_HOME}/searx-pyenv" SEARX_SRC="${SERVICE_HOME}/searx-src" SEARX_SETTINGS_PATH="/etc/searx/settings.yml" -SEARX_SETTINGS_TEMPLATE="${REPO_ROOT}/utils/templates/etc/searx/use_default_settings.yml" +SEARX_SETTINGS_TEMPLATE="${SEARX_SETTINGS_TEMPLATE:-${REPO_ROOT}/utils/templates/etc/searx/use_default_settings.yml}" SEARX_UWSGI_APP="searx.ini" # shellcheck disable=SC2034 SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket" @@ -157,7 +157,7 @@ install / remove :searx-src: clone $GIT_URL :pyenv: create/remove virtualenv (python) in $SEARX_PYENV :uwsgi: install searx uWSGI application - :settings: reinstall settings from ${REPO_ROOT}/searx/settings.yml + :settings: reinstall settings from ${SEARX_SETTINGS_TEMPLATE} :packages: install needed packages from OS package manager :buildhost: install packages from OS package manager needed by buildhosts update searx @@ -388,6 +388,14 @@ clone_searx() { err_msg "to clone searx sources, user $SERVICE_USER hast to be created first" return 42 fi + if [[ ! $(git show-ref "refs/heads/${GIT_BRANCH}") ]]; then + warn_msg "missing local branch ${GIT_BRANCH}" + info_msg "create local branch ${GIT_BRANCH} from start point: origin/${GIT_BRANCH}" + git branch "${GIT_BRANCH}" "origin/${GIT_BRANCH}" + fi + if [[ ! $(git branch --show-current) == "${GIT_BRANCH}" ]]; then + warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git branch --show-current)" + fi export SERVICE_HOME git_clone "$REPO_ROOT" "$SEARX_SRC" \ "$GIT_BRANCH" "$SERVICE_USER" @@ -412,7 +420,7 @@ install_settings() { mkdir -p "$(dirname ${SEARX_SETTINGS_PATH})" if [[ ! -f ${SEARX_SETTINGS_PATH} ]]; then - info_msg "install settings ${REPO_ROOT}/searx/settings.yml" + info_msg "install settings ${SEARX_SETTINGS_TEMPLATE}" info_msg " --> ${SEARX_SETTINGS_PATH}" cp "${SEARX_SETTINGS_TEMPLATE}" "${SEARX_SETTINGS_PATH}" configure_searx |