Skip to content

Commit 3029e69

Browse files
New Script: SearXNG (#2123)
* New Script: SearXNG * Update install/searxng-install.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update searxng.json --------- Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 7dcc717 commit 3029e69

File tree

3 files changed

+197
-0
lines changed

3 files changed

+197
-0
lines changed

ct/searxng.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/searxng/searxng
7+
8+
# App Default Values
9+
APP="SearXNG"
10+
var_tags="search"
11+
var_cpu="2"
12+
var_ram="2048"
13+
var_disk="7"
14+
var_os="debian"
15+
var_version="12"
16+
var_unprivileged="1"
17+
18+
# App Output & Base Settings
19+
header_info "$APP"
20+
base_settings
21+
22+
# Core
23+
variables
24+
color
25+
catch_errors
26+
27+
function update_script() {
28+
header_info
29+
check_container_storage
30+
check_container_resources
31+
if [[ ! -d /usr/local/searxng/searxng-src ]]; then
32+
msg_error "No ${APP} Installation Found!"
33+
exit
34+
fi
35+
if cd /usr/local/searxng/searxng-src && git pull | grep -q 'Already up to date'; then
36+
msg_ok "There is currently no update available."
37+
fi
38+
exit
39+
}
40+
start
41+
build_container
42+
description
43+
44+
msg_ok "Completed Successfully!\n"
45+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
46+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
47+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}"

install/searxng-install.sh

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/searxng/searxng
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies (Patience)"
17+
$STD apt-get install -y \
18+
redis-server \
19+
build-essential \
20+
libffi-dev \
21+
libssl-dev \
22+
curl \
23+
sudo \
24+
git \
25+
mc
26+
msg_ok "Installed Dependencies"
27+
28+
msg_info "Setup Python3"
29+
$STD apt-get install -y \
30+
python3 \
31+
python3-{pip,venv,yaml,dev}
32+
$STD pip install --upgrade pip setuptools wheel
33+
$STD pip install pyyaml
34+
msg_ok "Setup Python3"
35+
36+
msg_info "Setup SearXNG"
37+
mkdir -p /usr/local/searxng /etc/searxng
38+
useradd -d /etc/searxng searxng
39+
chown searxng:searxng /usr/local/searxng /etc/searxng
40+
$STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src
41+
cd /usr/local/searxng/
42+
sudo -u searxng python3 -m venv /usr/local/searxng/searx-pyenv
43+
source /usr/local/searxng/searx-pyenv/bin/activate
44+
$STD pip install --upgrade pip setuptools wheel
45+
$STD pip install pyyaml
46+
$STD pip install -e /usr/local/searxng/searxng-src
47+
SECRET_KEY=$(openssl rand -hex 32)
48+
cat <<EOF >/etc/searxng/settings.yml
49+
# SearXNG settings
50+
use_default_settings: true
51+
general:
52+
debug: false
53+
instance_name: "SearXNG"
54+
privacypolicy_url: false
55+
contact_url: false
56+
server:
57+
bind_address: "0.0.0.0"
58+
port: 8888
59+
secret_key: "${SECRET_KEY}"
60+
limiter: true
61+
image_proxy: true
62+
redis:
63+
url: "redis://127.0.0.1:6379/0"
64+
ui:
65+
static_use_hash: true
66+
enabled_plugins:
67+
- 'Hash plugin'
68+
- 'Self Information'
69+
- 'Tracker URL remover'
70+
- 'Ahmia blacklist'
71+
search:
72+
safe_search: 2
73+
autocomplete: 'google'
74+
engines:
75+
- name: google
76+
engine: google
77+
shortcut: gg
78+
use_mobile_ui: false
79+
- name: duckduckgo
80+
engine: duckduckgo
81+
shortcut: ddg
82+
display_error_messages: true
83+
EOF
84+
chown searxng:searxng /etc/searxng/settings.yml
85+
chmod 640 /etc/searxng/settings.yml
86+
msg_ok "Setup SearXNG"
87+
88+
msg_info "Set up web services"
89+
cat <<EOF >/etc/systemd/system/searxng.service
90+
[Unit]
91+
Description=SearXNG service
92+
After=network.target redis-server.service
93+
Wants=redis-server.service
94+
95+
[Service]
96+
Type=simple
97+
User=searxng
98+
Group=searxng
99+
Environment="SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml"
100+
ExecStart=/usr/local/searxng/searx-pyenv/bin/python -m searx.webapp
101+
WorkingDirectory=/usr/local/searxng/searxng-src
102+
Restart=always
103+
104+
[Install]
105+
WantedBy=multi-user.target
106+
EOF
107+
systemctl enable -q --now searxng
108+
msg_ok "Created Services"
109+
110+
motd_ssh
111+
customize
112+
113+
msg_info "Cleaning up"
114+
$STD apt-get autoremove
115+
$STD apt-get autoclean
116+
msg_ok "Cleaned"

json/searxng.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "SearXNG",
3+
"slug": "searxng",
4+
"categories": [
5+
0
6+
],
7+
"date_created": "2025-02-07",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8888,
12+
"documentation": "https://docs.searxng.org/",
13+
"website": "https://github.com/searxng/searxng",
14+
"logo": "https://raw.githubusercontent.com/searxng/searxng/master/src/brand/searxng-wordmark.svg",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/searxng.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 2048,
23+
"hdd": 7,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)