mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-10 17:59:17 +00:00
New Script: SearXNG (#2123)
* New Script: SearXNG * Update install/searxng-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update searxng.json --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
parent
7dcc717017
commit
3029e69767
47
ct/searxng.sh
Normal file
47
ct/searxng.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/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 Default Values
|
||||
APP="SearXNG"
|
||||
var_tags="search"
|
||||
var_cpu="2"
|
||||
var_ram="2048"
|
||||
var_disk="7"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
var_unprivileged="1"
|
||||
|
||||
# App Output & Base Settings
|
||||
header_info "$APP"
|
||||
base_settings
|
||||
|
||||
# Core
|
||||
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}"
|
116
install/searxng-install.sh
Normal file
116
install/searxng-install.sh
Normal file
@ -0,0 +1,116 @@
|
||||
#!/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 \
|
||||
curl \
|
||||
sudo \
|
||||
git \
|
||||
mc
|
||||
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 -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"
|
34
json/searxng.json
Normal file
34
json/searxng.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "SearXNG",
|
||||
"slug": "searxng",
|
||||
"categories": [
|
||||
0
|
||||
],
|
||||
"date_created": "2025-02-07",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8888,
|
||||
"documentation": "https://docs.searxng.org/",
|
||||
"website": "https://github.com/searxng/searxng",
|
||||
"logo": "https://raw.githubusercontent.com/searxng/searxng/master/src/brand/searxng-wordmark.svg",
|
||||
"description": "SearXNG is a free internet metasearch engine which aggregates results from up to 215 search services. Users are neither tracked nor profiled. Additionally, SearXNG can be used over Tor for online anonymity.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/searxng.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 7,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
Loading…
Reference in New Issue
Block a user