summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-24 10:00:29 +0100
committerGitHub <noreply@github.com>2020-12-24 10:00:29 +0100
commitd1291862122bcaffaaab36448dc6cc401c5c41b0 (patch)
tree14c35b1a7f46a2a76d91af1e0fbba4e5f9d8f3a9 /utils
parentc2aaf6f99276022a7e268fdb4dc29ce33a774813 (diff)
parent5fc9273e230af1e47486055769f9a32104acbda5 (diff)
downloadsearxng-d1291862122bcaffaaab36448dc6cc401c5c41b0.tar.gz
searxng-d1291862122bcaffaaab36448dc6cc401c5c41b0.zip
Merge pull request #2417 from return42/fix-seetings-template
[fix] use SEARX_SETTINGS_TEMPLATE from .config environment
Diffstat (limited to 'utils')
-rwxr-xr-xutils/searx.sh14
1 files changed, 11 insertions, 3 deletions
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