From 91a59ff3502803611953820e2923348440f807d0 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sat, 3 Aug 2019 13:53:14 +0200 Subject: [fix] Docker: without -f parameter, settings.yml is not replaced by the new version (#1668) Before this commit, the existing settings.yml were always replaced. --- dockerfiles/docker-entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dockerfiles/docker-entrypoint.sh') diff --git a/dockerfiles/docker-entrypoint.sh b/dockerfiles/docker-entrypoint.sh index 60e26fd94..c731e0a89 100755 --- a/dockerfiles/docker-entrypoint.sh +++ b/dockerfiles/docker-entrypoint.sh @@ -71,7 +71,7 @@ EOF } update_conf() { - FORCE_CONF_UPDATE="$1" + FORCE_CONF_UPDATE=$1 CONF="$2" NEW_CONF="${2}.new" OLD_CONF="${2}.old" @@ -81,7 +81,7 @@ update_conf() { if [ -f "${CONF}" ]; then if [ "${REF_CONF}" -nt "${CONF}" ]; then # There is a new version - if [ $FORCE_CONF_UPDATE ]; then + if [ $FORCE_CONF_UPDATE -ne 0 ]; then # Replace the current configuration printf '⚠️ Automaticaly update %s to the new version\n' "${CONF}" if [ ! -f "${OLD_CONF}" ]; then @@ -107,7 +107,7 @@ update_conf() { } # make sure there are uwsgi settings -update_conf "${FORCE_CONF_UPDATE}" "${UWSGI_SETTINGS_PATH}" "/usr/local/searx/dockerfiles/uwsgi.ini" "patch_uwsgi_settings" +update_conf ${FORCE_CONF_UPDATE} "${UWSGI_SETTINGS_PATH}" "/usr/local/searx/dockerfiles/uwsgi.ini" "patch_uwsgi_settings" # make sure there are searx settings update_conf "${FORCE_CONF_UPDATE}" "${SEARX_SETTINGS_PATH}" "/usr/local/searx/searx/settings.yml" "patch_searx_settings" -- cgit v1.2.3 From 2485d41bdd59fb820241241769ea9ad833ea470c Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Mon, 14 Oct 2019 02:02:41 +0200 Subject: :whale: Config for instance name and autocomplete Signed-off-by: mathieu.brunot --- dockerfiles/docker-entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dockerfiles/docker-entrypoint.sh') diff --git a/dockerfiles/docker-entrypoint.sh b/dockerfiles/docker-entrypoint.sh index c731e0a89..8b4c34860 100755 --- a/dockerfiles/docker-entrypoint.sh +++ b/dockerfiles/docker-entrypoint.sh @@ -29,6 +29,8 @@ do printf " -f Always update on the configuration files (existing files are renamed with the .old suffix)\n" printf " Without this option, new configuration files are copied with the .new suffix\n" printf "\nEnvironment variables:\n\n" + printf " INSTANCE_NAME settings.yml : general.instance_name\n" + printf " AUTOCOMPLETE settings.yml : search.autocomplete\n" printf " BASE_URL settings.yml : server.base_url\n" printf " MORTY_URL settings.yml : result_proxy.url\n" printf " MORTY_KEY settings.yml : result_proxy.key\n" @@ -53,6 +55,8 @@ patch_searx_settings() { # update settings.yml sed -i -e "s|base_url : False|base_url : ${BASE_URL}|g" \ + -e "s/instance_name : \"searx\"/instance_name : \"${INSTANCE_NAME}\"/g" \ + -e "s/autocomplete : \"\"/autocomplete : \"${AUTOCOMPLETE}\"/g" \ -e "s/ultrasecretkey/$(openssl rand -hex 32)/g" \ "${CONF}" -- cgit v1.2.3