-
This commit is contained in:
parent
4369db931c
commit
88b1ca23f4
42
ct/searxng.sh
Normal file
42
ct/searxng.sh
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
|
# Author: MickLesk (Canbiz)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/searxng/searxng
|
||||||
|
|
||||||
|
APP="SearXNG"
|
||||||
|
var_tags="${var_tags:-search}"
|
||||||
|
var_cpu="${var_cpu:-2}"
|
||||||
|
var_ram="${var_ram:-2048}"
|
||||||
|
var_disk="${var_disk:-7}"
|
||||||
|
var_os="${var_os:-debian}"
|
||||||
|
var_version="${var_version:-12}"
|
||||||
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
|
header_info "$APP"
|
||||||
|
variables
|
||||||
|
color
|
||||||
|
catch_errors
|
||||||
|
|
||||||
|
function update_script() {
|
||||||
|
header_info
|
||||||
|
check_container_storage
|
||||||
|
check_container_resources
|
||||||
|
if [[ ! -d /usr/local/searxng/searxng-src ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
if cd /usr/local/searxng/searxng-src && git pull | grep -q 'Already up to date'; then
|
||||||
|
msg_ok "There is currently no update available."
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
start
|
||||||
|
build_container
|
||||||
|
description
|
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n"
|
||||||
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}"
|
113
install/searxng-install.sh
Normal file
113
install/searxng-install.sh
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
|
# Author: MickLesk (Canbiz)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/searxng/searxng
|
||||||
|
|
||||||
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_os
|
||||||
|
|
||||||
|
msg_info "Installing Dependencies (Patience)"
|
||||||
|
$STD apt-get install -y \
|
||||||
|
redis-server \
|
||||||
|
build-essential \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev \
|
||||||
|
git
|
||||||
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
msg_info "Setup Python3"
|
||||||
|
$STD apt-get install -y \
|
||||||
|
python3 \
|
||||||
|
python3-{pip,venv,yaml,dev}
|
||||||
|
$STD pip install --upgrade pip setuptools wheel
|
||||||
|
$STD pip install pyyaml
|
||||||
|
msg_ok "Setup Python3"
|
||||||
|
|
||||||
|
msg_info "Setup SearXNG"
|
||||||
|
mkdir -p /usr/local/searxng /etc/searxng
|
||||||
|
useradd -d /etc/searxng searxng
|
||||||
|
chown searxng:searxng /usr/local/searxng /etc/searxng
|
||||||
|
$STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src
|
||||||
|
cd /usr/local/searxng/
|
||||||
|
sudo -u searxng python3 -m venv /usr/local/searxng/searx-pyenv
|
||||||
|
source /usr/local/searxng/searx-pyenv/bin/activate
|
||||||
|
$STD pip install --upgrade pip setuptools wheel
|
||||||
|
$STD pip install pyyaml
|
||||||
|
$STD pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src
|
||||||
|
SECRET_KEY=$(openssl rand -hex 32)
|
||||||
|
cat <<EOF >/etc/searxng/settings.yml
|
||||||
|
# SearXNG settings
|
||||||
|
use_default_settings: true
|
||||||
|
general:
|
||||||
|
debug: false
|
||||||
|
instance_name: "SearXNG"
|
||||||
|
privacypolicy_url: false
|
||||||
|
contact_url: false
|
||||||
|
server:
|
||||||
|
bind_address: "0.0.0.0"
|
||||||
|
port: 8888
|
||||||
|
secret_key: "${SECRET_KEY}"
|
||||||
|
limiter: true
|
||||||
|
image_proxy: true
|
||||||
|
redis:
|
||||||
|
url: "redis://127.0.0.1:6379/0"
|
||||||
|
ui:
|
||||||
|
static_use_hash: true
|
||||||
|
enabled_plugins:
|
||||||
|
- 'Hash plugin'
|
||||||
|
- 'Self Information'
|
||||||
|
- 'Tracker URL remover'
|
||||||
|
- 'Ahmia blacklist'
|
||||||
|
search:
|
||||||
|
safe_search: 2
|
||||||
|
autocomplete: 'google'
|
||||||
|
engines:
|
||||||
|
- name: google
|
||||||
|
engine: google
|
||||||
|
shortcut: gg
|
||||||
|
use_mobile_ui: false
|
||||||
|
- name: duckduckgo
|
||||||
|
engine: duckduckgo
|
||||||
|
shortcut: ddg
|
||||||
|
display_error_messages: true
|
||||||
|
EOF
|
||||||
|
chown searxng:searxng /etc/searxng/settings.yml
|
||||||
|
chmod 640 /etc/searxng/settings.yml
|
||||||
|
msg_ok "Setup SearXNG"
|
||||||
|
|
||||||
|
msg_info "Set up web services"
|
||||||
|
cat <<EOF >/etc/systemd/system/searxng.service
|
||||||
|
[Unit]
|
||||||
|
Description=SearXNG service
|
||||||
|
After=network.target redis-server.service
|
||||||
|
Wants=redis-server.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=searxng
|
||||||
|
Group=searxng
|
||||||
|
Environment="SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml"
|
||||||
|
ExecStart=/usr/local/searxng/searx-pyenv/bin/python -m searx.webapp
|
||||||
|
WorkingDirectory=/usr/local/searxng/searxng-src
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now searxng
|
||||||
|
msg_ok "Created Services"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
$STD apt-get autoremove
|
||||||
|
$STD apt-get autoclean
|
||||||
|
msg_ok "Cleaned"
|
Loading…
x
Reference in New Issue
Block a user