mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
[doc] recommend to use 'use_default_settings=True'
Since #2291 is merged, it is recommend to use:: use_default_settings=True 1. Add a template file use_default_settings.yml:: SEARX_SETTINGS_TEMPLATE="${REPO_ROOT}/utils/templates/etc/searx/use_default_settings.yml" 2. In Chapter "Configuration" recommend to make use of 'use_default_settings=True' and describe it 3. Rewrite of docs/admin/settings.rst - move chapter 'settings.yml location' to the top - update and split chapter 'Global Settings' 4. Add environment SEARX_SETTINGS_TEMPLATE to .config.sh 5. Use environment $SEARX_SETTINGS_TEMPLATE in the utils/searx.sh script Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
c1a9732268
commit
a70b9b9f61
6 changed files with 186 additions and 106 deletions
|
@ -36,6 +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_UWSGI_APP="searx.ini"
|
||||
# shellcheck disable=SC2034
|
||||
SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket"
|
||||
|
@ -139,7 +140,7 @@ usage() {
|
|||
cat <<EOF
|
||||
usage::
|
||||
$(basename "$0") shell
|
||||
$(basename "$0") install [all|user|searx-src|pyenv|uwsgi|packages|buildhost]
|
||||
$(basename "$0") install [all|user|searx-src|pyenv|uwsgi|packages|settings|buildhost]
|
||||
$(basename "$0") update [searx]
|
||||
$(basename "$0") remove [all|user|pyenv|searx-src]
|
||||
$(basename "$0") activate [service]
|
||||
|
@ -413,14 +414,14 @@ install_settings() {
|
|||
if [[ ! -f ${SEARX_SETTINGS_PATH} ]]; then
|
||||
info_msg "install settings ${REPO_ROOT}/searx/settings.yml"
|
||||
info_msg " --> ${SEARX_SETTINGS_PATH}"
|
||||
cp "${REPO_ROOT}/searx/settings.yml" "${SEARX_SETTINGS_PATH}"
|
||||
cp "${SEARX_SETTINGS_TEMPLATE}" "${SEARX_SETTINGS_PATH}"
|
||||
configure_searx
|
||||
return
|
||||
fi
|
||||
|
||||
rst_para "Diff between origin's setting file (+) and current (-):"
|
||||
echo
|
||||
$DIFF_CMD "${SEARX_SETTINGS_PATH}" "${SEARX_SRC}/searx/settings.yml"
|
||||
echo "${SEARX_SETTINGS_PATH}" "${SEARX_SETTINGS_TEMPLATE}"
|
||||
$DIFF_CMD "${SEARX_SETTINGS_PATH}" "${SEARX_SETTINGS_TEMPLATE}"
|
||||
|
||||
local action
|
||||
choose_one action "What should happen to the settings file? " \
|
||||
|
@ -434,7 +435,7 @@ install_settings() {
|
|||
"use origin settings")
|
||||
backup_file "${SEARX_SETTINGS_PATH}"
|
||||
info_msg "install origin settings"
|
||||
cp "${SEARX_SRC}/searx/settings.yml" "${SEARX_SETTINGS_PATH}"
|
||||
cp "${SEARX_SETTINGS_TEMPLATE}" "${SEARX_SETTINGS_PATH}"
|
||||
;;
|
||||
"start interactiv shell")
|
||||
backup_file "${SEARX_SETTINGS_PATH}"
|
||||
|
@ -442,7 +443,7 @@ install_settings() {
|
|||
sudo -H -i
|
||||
rst_para 'Diff between new setting file (-) and current (+):'
|
||||
echo
|
||||
$DIFF_CMD "${SEARX_SRC}/searx/settings.yml" "${SEARX_SETTINGS_PATH}"
|
||||
$DIFF_CMD "${SEARX_SETTINGS_TEMPLATE}" "${SEARX_SETTINGS_PATH}"
|
||||
wait_key
|
||||
;;
|
||||
esac
|
||||
|
|
22
utils/templates/etc/searx/use_default_settings.yml
Normal file
22
utils/templates/etc/searx/use_default_settings.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
use_default_settings: True
|
||||
|
||||
general:
|
||||
debug : False # Debug mode, only for development
|
||||
instance_name : "searx" # displayed name
|
||||
|
||||
search:
|
||||
safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict
|
||||
autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default
|
||||
default_lang : "" # Default search language - leave blank to detect from browser information or use codes from 'languages.py'
|
||||
|
||||
server:
|
||||
port : 8888
|
||||
bind_address : "127.0.0.1" # address to listen on
|
||||
secret_key : "ultrasecretkey" # change this!
|
||||
base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
|
||||
image_proxy : False # Proxying image results through searx
|
||||
|
||||
# uncomment below section if you have running morty proxy
|
||||
#result_proxy:
|
||||
# url : http://127.0.0.1:3000/
|
||||
# key : !!binary "your_morty_proxy_key"
|
Loading…
Add table
Add a link
Reference in a new issue