Merge pull request #13 from outis1one/claude/cleanup-setup-webui-bCgPE
fix whiptail capture bug (2>/dev/null killed selections); add artic; …
This commit is contained in:
@@ -81,24 +81,29 @@ NO_SAFESEARCH_ENGINES=(
|
|||||||
# Web engines without safe-search API
|
# Web engines without safe-search API
|
||||||
"mojeek" "naver" "baidu"
|
"mojeek" "naver" "baidu"
|
||||||
# Yandex: parameter exists but not reliably enforced for non-Russian queries
|
# Yandex: parameter exists but not reliably enforced for non-Russian queries
|
||||||
"yandex"
|
"yandex" "yandex images"
|
||||||
# Video frontends — no safe-search passthrough
|
# Video frontends — no safe-search passthrough
|
||||||
"invidious" "piped" "peertube" "sepiasearch"
|
"invidious" "piped" "peertube" "sepiasearch"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── Category → engine lists ───────────────────────────────────────────────────
|
# ── Category → engine lists ───────────────────────────────────────────────────
|
||||||
VIDEOS_ENGINES=(
|
VIDEOS_ENGINES=(
|
||||||
"youtube" "invidious" "piped" "peertube" "sepiasearch"
|
"youtube" "bing videos" "brave videos" "duckduckgo videos" "google videos" "qwant videos"
|
||||||
"dailymotion" "vimeo"
|
"dailymotion" "media.ccc.de" "wikcommons.videos"
|
||||||
"bing videos" "duckduckgo videos" "google videos"
|
"vimeo" "odysee" "rumble" "bitchute"
|
||||||
|
"invidious" "piped" "peertube" "sepiasearch"
|
||||||
)
|
)
|
||||||
IMAGES_ENGINES=(
|
IMAGES_ENGINES=(
|
||||||
"google images" "bing images" "duckduckgo images"
|
"google images" "bing images" "duckduckgo images" "brave images" "qwant images"
|
||||||
"brave images" "qwant images"
|
"startpage images" "mojeek images" "presearch images"
|
||||||
"flickr" "unsplash" "imgur" "deviantart" "openverse"
|
"openverse" "unsplash" "pexels" "pixabay images" "pinterest" "flickr"
|
||||||
|
"wikcommons.images" "artic" "yandex images"
|
||||||
|
"imgur" "deviantart" "artstation" "adobe stock"
|
||||||
)
|
)
|
||||||
NEWS_ENGINES=(
|
NEWS_ENGINES=(
|
||||||
"google news" "bing news" "duckduckgo news" "brave news" "qwant news"
|
"google news" "bing news" "duckduckgo news" "brave news" "qwant news"
|
||||||
|
"startpage news" "presearch news" "mojeek news"
|
||||||
|
"reuters" "yahoo news" "wikinews" "yep news"
|
||||||
)
|
)
|
||||||
SCIENCE_ENGINES=(
|
SCIENCE_ENGINES=(
|
||||||
"arxiv" "semantic scholar" "pubmed" "crossref" "base"
|
"arxiv" "semantic scholar" "pubmed" "crossref" "base"
|
||||||
@@ -123,7 +128,9 @@ fi
|
|||||||
# Helper: add to DISABLE_MAP unless explicitly re-enabled
|
# Helper: add to DISABLE_MAP unless explicitly re-enabled
|
||||||
mark_disabled() {
|
mark_disabled() {
|
||||||
local eng="$1"
|
local eng="$1"
|
||||||
[[ -n "${ENABLE_MAP[$eng]+x}" ]] && return # user said keep it
|
# Use set +u to safely check array key existence on bash < 4.4 (set -u quirk)
|
||||||
|
set +u; local _chk="${ENABLE_MAP[$eng]+x}"; set -u
|
||||||
|
[[ -n "$_chk" ]] && return # user said keep it
|
||||||
DISABLE_MAP["$eng"]=1
|
DISABLE_MAP["$eng"]=1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,12 +174,15 @@ SECRET_KEY=$(grep -oP '(?<=secret_key: ")[^"]+' "$SETTINGS" 2>/dev/null || true)
|
|||||||
|
|
||||||
# ── Build engine override block ───────────────────────────────────────────────
|
# ── Build engine override block ───────────────────────────────────────────────
|
||||||
ENGINE_BLOCK=""
|
ENGINE_BLOCK=""
|
||||||
|
# set +u: iterating empty associative arrays throws "unbound variable" on bash <4.4
|
||||||
|
set +u
|
||||||
for eng in "${!DISABLE_MAP[@]}"; do
|
for eng in "${!DISABLE_MAP[@]}"; do
|
||||||
ENGINE_BLOCK+=" - name: ${eng}\n disabled: true\n"
|
ENGINE_BLOCK+=" - name: ${eng}\n disabled: true\n"
|
||||||
done
|
done
|
||||||
for eng in "${!ENABLE_MAP[@]}"; do
|
for eng in "${!ENABLE_MAP[@]}"; do
|
||||||
ENGINE_BLOCK+=" - name: ${eng}\n disabled: false\n"
|
ENGINE_BLOCK+=" - name: ${eng}\n disabled: false\n"
|
||||||
done
|
done
|
||||||
|
set -u
|
||||||
|
|
||||||
# ── Write settings.yml ────────────────────────────────────────────────────────
|
# ── Write settings.yml ────────────────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
|
|||||||
+13
-6
@@ -593,7 +593,8 @@ if $INSTALL_AI && $SVC_SEARXNG; then
|
|||||||
[[ "$SEARXNG_SAFE_LEVEL" == "none" ]] && echo ON && return
|
[[ "$SEARXNG_SAFE_LEVEL" == "none" ]] && echo ON && return
|
||||||
case "$1" in
|
case "$1" in
|
||||||
mojeek|"mojeek images"|"mojeek news"|\
|
mojeek|"mojeek images"|"mojeek news"|\
|
||||||
yandex|baidu|naver|\
|
yandex|"yandex images"|\
|
||||||
|
baidu|naver|\
|
||||||
invidious|piped|peertube|sepiasearch|\
|
invidious|piped|peertube|sepiasearch|\
|
||||||
vimeo|bitchute|rumble|odysee|\
|
vimeo|bitchute|rumble|odysee|\
|
||||||
imgur|deviantart|artstation) echo OFF ;;
|
imgur|deviantart|artstation) echo OFF ;;
|
||||||
@@ -614,11 +615,15 @@ if $INSTALL_AI && $SVC_SEARXNG; then
|
|||||||
done
|
done
|
||||||
local _h=$(( ${#_n[@]} + 9 > 24 ? 24 : ${#_n[@]} + 9 ))
|
local _h=$(( ${#_n[@]} + 9 > 24 ? 24 : ${#_n[@]} + 9 ))
|
||||||
local _lh=$(( ${#_n[@]} < 14 ? ${#_n[@]} : 14 ))
|
local _lh=$(( ${#_n[@]} < 14 ? ${#_n[@]} : 14 ))
|
||||||
local _o _j
|
local _o _rc _j
|
||||||
if ! _o=$(whiptail --backtitle "SearXNG — $SEARXNG_SAFE_LEVEL" \
|
# Note: NO 2>/dev/null after the FD swap — that redirect would overwrite
|
||||||
|
# the pipe (FD2 after swap) with /dev/null, silently discarding selections.
|
||||||
|
_o=$(whiptail --backtitle "SearXNG — $SEARXNG_SAFE_LEVEL" \
|
||||||
--title "$_t" --checklist \
|
--title "$_t" --checklist \
|
||||||
"SPACE = toggle ENTER = confirm ESC = use defaults" \
|
"SPACE = toggle ENTER = confirm ESC = use defaults" \
|
||||||
"$_h" 76 "$_lh" "${_a[@]}" 3>&1 1>&2 2>&3 2>/dev/null); then
|
"$_h" 76 "$_lh" "${_a[@]}" 3>&1 1>&2 2>&3) && _rc=0 || _rc=$?
|
||||||
|
if [[ $_rc -ne 0 ]] || [[ -z "${_o//\"}" ]]; then
|
||||||
|
# ESC / cancel / empty selection → use pre-checked defaults
|
||||||
for _j in "${!_n[@]}"; do
|
for _j in "${!_n[@]}"; do
|
||||||
[[ "${_s[$_j]}" == "ON" ]] && printf '%s\n' "${_n[$_j]}"
|
[[ "${_s[$_j]}" == "ON" ]] && printf '%s\n' "${_n[$_j]}"
|
||||||
done
|
done
|
||||||
@@ -629,7 +634,7 @@ if $INSTALL_AI && $SVC_SEARXNG; then
|
|||||||
|
|
||||||
# Engines auto-disabled by configure script for moderate/strict.
|
# Engines auto-disabled by configure script for moderate/strict.
|
||||||
# If user re-enables one in the menu we pass --enable-engines to override.
|
# If user re-enables one in the menu we pass --enable-engines to override.
|
||||||
_SX_AUTOFF=(mojeek yandex baidu naver invidious piped peertube sepiasearch)
|
_SX_AUTOFF=(mojeek yandex "yandex images" baidu naver invidious piped peertube sepiasearch)
|
||||||
|
|
||||||
if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
||||||
# ── Web search ─────────────────────────────────────────────────────────
|
# ── Web search ─────────────────────────────────────────────────────────
|
||||||
@@ -667,6 +672,8 @@ if $INSTALL_AI && $SVC_SEARXNG; then
|
|||||||
"pinterest" "Pinterest" ON \
|
"pinterest" "Pinterest" ON \
|
||||||
"flickr" "Flickr" ON \
|
"flickr" "Flickr" ON \
|
||||||
"wikcommons.images" "Wikimedia Commons Images" ON \
|
"wikcommons.images" "Wikimedia Commons Images" ON \
|
||||||
|
"artic" "Art Institute of Chicago" ON \
|
||||||
|
"yandex images" "Yandex Images [no safe-search]" "$(_sxst 'yandex images')" \
|
||||||
"imgur" "Imgur [adult content]" "$(_sxst imgur)" \
|
"imgur" "Imgur [adult content]" "$(_sxst imgur)" \
|
||||||
"deviantart" "DeviantArt [adult content]" "$(_sxst deviantart)" \
|
"deviantart" "DeviantArt [adult content]" "$(_sxst deviantart)" \
|
||||||
"artstation" "ArtStation [adult content]" "$(_sxst artstation)" \
|
"artstation" "ArtStation [adult content]" "$(_sxst artstation)" \
|
||||||
@@ -739,7 +746,7 @@ if $INSTALL_AI && $SVC_SEARXNG; then
|
|||||||
"google images" "bing images" "duckduckgo images" "brave images" "qwant images"
|
"google images" "bing images" "duckduckgo images" "brave images" "qwant images"
|
||||||
"startpage images" "mojeek images" "presearch images"
|
"startpage images" "mojeek images" "presearch images"
|
||||||
"openverse" "unsplash" "pexels" "pixabay images" "pinterest" "flickr"
|
"openverse" "unsplash" "pexels" "pixabay images" "pinterest" "flickr"
|
||||||
"wikcommons.images" "imgur" "deviantart" "artstation" "adobe stock"
|
"wikcommons.images" "artic" "yandex images" "imgur" "deviantart" "artstation" "adobe stock"
|
||||||
# Videos
|
# Videos
|
||||||
"youtube" "bing videos" "brave videos" "duckduckgo videos" "google videos" "qwant videos"
|
"youtube" "bing videos" "brave videos" "duckduckgo videos" "google videos" "qwant videos"
|
||||||
"dailymotion" "media.ccc.de" "wikcommons.videos"
|
"dailymotion" "media.ccc.de" "wikcommons.videos"
|
||||||
|
|||||||
+13
-6
@@ -66,7 +66,8 @@ _sxst() {
|
|||||||
[[ "$SEARXNG_SAFE_LEVEL" == "none" ]] && echo ON && return
|
[[ "$SEARXNG_SAFE_LEVEL" == "none" ]] && echo ON && return
|
||||||
case "$1" in
|
case "$1" in
|
||||||
mojeek|"mojeek images"|"mojeek news"|\
|
mojeek|"mojeek images"|"mojeek news"|\
|
||||||
yandex|baidu|naver|\
|
yandex|"yandex images"|\
|
||||||
|
baidu|naver|\
|
||||||
invidious|piped|peertube|sepiasearch|\
|
invidious|piped|peertube|sepiasearch|\
|
||||||
vimeo|bitchute|rumble|odysee|\
|
vimeo|bitchute|rumble|odysee|\
|
||||||
imgur|deviantart|artstation) echo OFF ;;
|
imgur|deviantart|artstation) echo OFF ;;
|
||||||
@@ -86,11 +87,15 @@ _sxmenu() {
|
|||||||
done
|
done
|
||||||
local _h=$(( ${#_n[@]} + 9 > 24 ? 24 : ${#_n[@]} + 9 ))
|
local _h=$(( ${#_n[@]} + 9 > 24 ? 24 : ${#_n[@]} + 9 ))
|
||||||
local _lh=$(( ${#_n[@]} < 14 ? ${#_n[@]} : 14 ))
|
local _lh=$(( ${#_n[@]} < 14 ? ${#_n[@]} : 14 ))
|
||||||
local _o _j
|
local _o _rc _j
|
||||||
if ! _o=$(whiptail --backtitle "SearXNG — $SEARXNG_SAFE_LEVEL" \
|
# Note: NO 2>/dev/null after the FD swap — that redirect would overwrite
|
||||||
|
# the pipe (FD2 after swap) with /dev/null, silently discarding selections.
|
||||||
|
_o=$(whiptail --backtitle "SearXNG — $SEARXNG_SAFE_LEVEL" \
|
||||||
--title "$_t" --checklist \
|
--title "$_t" --checklist \
|
||||||
"SPACE = toggle ENTER = confirm ESC = use defaults" \
|
"SPACE = toggle ENTER = confirm ESC = use defaults" \
|
||||||
"$_h" 76 "$_lh" "${_a[@]}" 3>&1 1>&2 2>&3 2>/dev/null); then
|
"$_h" 76 "$_lh" "${_a[@]}" 3>&1 1>&2 2>&3) && _rc=0 || _rc=$?
|
||||||
|
if [[ $_rc -ne 0 ]] || [[ -z "${_o//\"}" ]]; then
|
||||||
|
# ESC / cancel / empty selection → use pre-checked defaults
|
||||||
for _j in "${!_n[@]}"; do
|
for _j in "${!_n[@]}"; do
|
||||||
[[ "${_s[$_j]}" == "ON" ]] && printf '%s\n' "${_n[$_j]}"
|
[[ "${_s[$_j]}" == "ON" ]] && printf '%s\n' "${_n[$_j]}"
|
||||||
done
|
done
|
||||||
@@ -99,7 +104,7 @@ _sxmenu() {
|
|||||||
for _id in $_o; do _id="${_id//\"/}"; printf '%s\n' "${_n[$(( _id-1 ))]}"; done
|
for _id in $_o; do _id="${_id//\"/}"; printf '%s\n' "${_n[$(( _id-1 ))]}"; done
|
||||||
}
|
}
|
||||||
|
|
||||||
_SX_AUTOFF=(mojeek yandex baidu naver invidious piped peertube sepiasearch)
|
_SX_AUTOFF=(mojeek yandex "yandex images" baidu naver invidious piped peertube sepiasearch)
|
||||||
|
|
||||||
if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
||||||
# ── Web search ─────────────────────────────────────────────────────────────
|
# ── Web search ─────────────────────────────────────────────────────────────
|
||||||
@@ -137,6 +142,8 @@ if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
|||||||
"pinterest" "Pinterest" ON \
|
"pinterest" "Pinterest" ON \
|
||||||
"flickr" "Flickr" ON \
|
"flickr" "Flickr" ON \
|
||||||
"wikcommons.images" "Wikimedia Commons Images" ON \
|
"wikcommons.images" "Wikimedia Commons Images" ON \
|
||||||
|
"artic" "Art Institute of Chicago" ON \
|
||||||
|
"yandex images" "Yandex Images [no safe-search]" "$(_sxst 'yandex images')" \
|
||||||
"imgur" "Imgur [adult content]" "$(_sxst imgur)" \
|
"imgur" "Imgur [adult content]" "$(_sxst imgur)" \
|
||||||
"deviantart" "DeviantArt [adult content]" "$(_sxst deviantart)" \
|
"deviantart" "DeviantArt [adult content]" "$(_sxst deviantart)" \
|
||||||
"artstation" "ArtStation [adult content]" "$(_sxst artstation)" \
|
"artstation" "ArtStation [adult content]" "$(_sxst artstation)" \
|
||||||
@@ -209,7 +216,7 @@ if command -v whiptail &>/dev/null && [[ -t 0 ]]; then
|
|||||||
"google images" "bing images" "duckduckgo images" "brave images" "qwant images"
|
"google images" "bing images" "duckduckgo images" "brave images" "qwant images"
|
||||||
"startpage images" "mojeek images" "presearch images"
|
"startpage images" "mojeek images" "presearch images"
|
||||||
"openverse" "unsplash" "pexels" "pixabay images" "pinterest" "flickr"
|
"openverse" "unsplash" "pexels" "pixabay images" "pinterest" "flickr"
|
||||||
"wikcommons.images" "imgur" "deviantart" "artstation" "adobe stock"
|
"wikcommons.images" "artic" "yandex images" "imgur" "deviantart" "artstation" "adobe stock"
|
||||||
# Videos
|
# Videos
|
||||||
"youtube" "bing videos" "brave videos" "duckduckgo videos" "google videos" "qwant videos"
|
"youtube" "bing videos" "brave videos" "duckduckgo videos" "google videos" "qwant videos"
|
||||||
"dailymotion" "media.ccc.de" "wikcommons.videos"
|
"dailymotion" "media.ccc.de" "wikcommons.videos"
|
||||||
|
|||||||
Reference in New Issue
Block a user