first commit
This commit is contained in:
1
utils/templates/etc/apache2
Symbolic link
1
utils/templates/etc/apache2
Symbolic link
@@ -0,0 +1 @@
|
||||
httpd
|
||||
41
utils/templates/etc/httpd/sites-available/searxng.conf
Normal file
41
utils/templates/etc/httpd/sites-available/searxng.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8; mode: apache -*-
|
||||
|
||||
LoadModule ssl_module ${APACHE_MODULES}/mod_ssl.so
|
||||
LoadModule headers_module ${APACHE_MODULES}/mod_headers.so
|
||||
LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so
|
||||
LoadModule proxy_http_module ${APACHE_MODULES}/mod_proxy_http.so
|
||||
# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so
|
||||
#
|
||||
# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog
|
||||
# CustomLog /dev/null combined env=dontlog
|
||||
|
||||
<Location ${SEARXNG_URL_PATH}>
|
||||
|
||||
Require all granted
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
|
||||
Allow from all
|
||||
|
||||
# add the trailing slash
|
||||
RedirectMatch 308 ${SEARXNG_URL_PATH}\$ ${SEARXNG_URL_PATH}/
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyPass http://${SEARXNG_INTERNAL_HTTP}
|
||||
|
||||
# see flaskfix.py
|
||||
RequestHeader set X-Scheme %{REQUEST_SCHEME}s
|
||||
RequestHeader set X-Script-Name ${SEARXNG_URL_PATH}
|
||||
|
||||
# see limiter.py
|
||||
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
|
||||
RequestHeader append X-Forwarded-For %{REMOTE_ADDR}s
|
||||
|
||||
</Location>
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
# Alias ${SEARXNG_URL_PATH}/static/ ${SEARXNG_STATIC}/
|
||||
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8; mode: apache -*-
|
||||
|
||||
LoadModule ssl_module ${APACHE_MODULES}/mod_ssl.so
|
||||
LoadModule headers_module ${APACHE_MODULES}/mod_headers.so
|
||||
LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so
|
||||
LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so
|
||||
# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so
|
||||
#
|
||||
# SetEnvIf Request_URI "${SEARXNG_URL_PATH}" dontlog
|
||||
# CustomLog /dev/null combined env=dontlog
|
||||
|
||||
<Location ${SEARXNG_URL_PATH}>
|
||||
|
||||
Require all granted
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
|
||||
Allow from all
|
||||
|
||||
# add the trailing slash
|
||||
RedirectMatch 308 ${SEARXNG_URL_PATH}\$ ${SEARXNG_URL_PATH}/
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyPass unix:${SEARXNG_UWSGI_SOCKET}|uwsgi://uwsgi-uds-searxng/
|
||||
|
||||
# see flaskfix.py
|
||||
RequestHeader set X-Scheme %{REQUEST_SCHEME}s
|
||||
RequestHeader set X-Script-Name ${SEARXNG_URL_PATH}
|
||||
|
||||
# see limiter.py
|
||||
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
|
||||
RequestHeader append X-Forwarded-For %{REMOTE_ADDR}s
|
||||
|
||||
</Location>
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
# Alias ${SEARXNG_URL_PATH}/static/ ${SEARXNG_STATIC}/
|
||||
@@ -0,0 +1,29 @@
|
||||
location ${SEARXNG_URL_PATH} {
|
||||
|
||||
proxy_pass http://${SEARXNG_INTERNAL_HTTP};
|
||||
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header Connection \$http_connection;
|
||||
|
||||
# see flaskfix.py
|
||||
proxy_set_header X-Scheme \$scheme;
|
||||
proxy_set_header X-Script-Name ${SEARXNG_URL_PATH};
|
||||
|
||||
# see limiter.py
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
|
||||
# proxy_buffering off;
|
||||
# proxy_request_buffering off;
|
||||
# proxy_buffer_size 8k;
|
||||
|
||||
}
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
# location ${SEARXNG_URL_PATH}/static/ {
|
||||
# alias ${SEARXNG_STATIC}/;
|
||||
# }
|
||||
@@ -0,0 +1,26 @@
|
||||
location ${SEARXNG_URL_PATH} {
|
||||
|
||||
uwsgi_pass unix://${SEARXNG_UWSGI_SOCKET};
|
||||
|
||||
include uwsgi_params;
|
||||
|
||||
uwsgi_param HTTP_HOST \$host;
|
||||
uwsgi_param HTTP_CONNECTION \$http_connection;
|
||||
|
||||
# see flaskfix.py
|
||||
uwsgi_param HTTP_X_SCHEME \$scheme;
|
||||
uwsgi_param HTTP_X_SCRIPT_NAME ${SEARXNG_URL_PATH};
|
||||
|
||||
# see limiter.py
|
||||
uwsgi_param HTTP_X_REAL_IP \$remote_addr;
|
||||
uwsgi_param HTTP_X_FORWARDED_FOR \$proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
# location ${SEARXNG_URL_PATH}/static/ {
|
||||
# alias ${SEARXNG_STATIC}/;
|
||||
# }
|
||||
46
utils/templates/etc/searxng/settings.yml
Normal file
46
utils/templates/etc/searxng/settings.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
# SearXNG settings
|
||||
|
||||
use_default_settings: true
|
||||
|
||||
general:
|
||||
debug: false
|
||||
instance_name: "SearXNG"
|
||||
|
||||
search:
|
||||
safe_search: 2
|
||||
autocomplete: 'duckduckgo'
|
||||
formats:
|
||||
- html
|
||||
|
||||
server:
|
||||
# Is overwritten by ${SEARXNG_SECRET}
|
||||
secret_key: "ultrasecretkey"
|
||||
limiter: true
|
||||
image_proxy: true
|
||||
# public URL of the instance, to ensure correct inbound links. Is overwritten
|
||||
# by ${SEARXNG_BASE_URL}.
|
||||
# base_url: http://example.com/location
|
||||
|
||||
redis:
|
||||
# URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}.
|
||||
url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
|
||||
|
||||
ui:
|
||||
static_use_hash: true
|
||||
|
||||
# preferences:
|
||||
# lock:
|
||||
# - autocomplete
|
||||
# - method
|
||||
|
||||
# engines:
|
||||
#
|
||||
# - name: fdroid
|
||||
# disabled: false
|
||||
#
|
||||
# - name: apk mirror
|
||||
# disabled: false
|
||||
#
|
||||
# - name: mediathekviewweb
|
||||
# categories: TV
|
||||
# disabled: false
|
||||
85
utils/templates/etc/uwsgi/apps-archlinux/searxng.ini
Normal file
85
utils/templates/etc/uwsgi/apps-archlinux/searxng.ini
Normal file
@@ -0,0 +1,85 @@
|
||||
# -*- mode: conf; coding: utf-8 -*-
|
||||
[uwsgi]
|
||||
|
||||
# uWSGI core
|
||||
# ----------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
|
||||
|
||||
# Who will run the code
|
||||
uid = ${SERVICE_USER}
|
||||
gid = ${SERVICE_GROUP}
|
||||
|
||||
# set (python) default encoding UTF-8
|
||||
env = LANG=C.UTF-8
|
||||
env = LANGUAGE=C.UTF-8
|
||||
env = LC_ALL=C.UTF-8
|
||||
|
||||
# chdir to specified directory before apps loading
|
||||
chdir = ${SEARXNG_SRC}/searx
|
||||
|
||||
# SearXNG configuration (settings.yml)
|
||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||
|
||||
# disable logging for privacy
|
||||
logger = systemd
|
||||
disable-logging = true
|
||||
|
||||
# The right granted on the created socket
|
||||
chmod-socket = 666
|
||||
|
||||
# Plugin to use and interpreter config
|
||||
single-interpreter = true
|
||||
|
||||
# enable master process
|
||||
master = true
|
||||
|
||||
# load apps in each worker instead of the master
|
||||
lazy-apps = true
|
||||
|
||||
# load uWSGI plugins
|
||||
plugin = python
|
||||
|
||||
# By default the Python plugin does not initialize the GIL. This means your
|
||||
# app-generated threads will not run. If you need threads, remember to enable
|
||||
# them with enable-threads. Running uWSGI in multithreading mode (with the
|
||||
# threads options) will automatically enable threading support. This *strange*
|
||||
# default behaviour is for performance reasons.
|
||||
enable-threads = true
|
||||
|
||||
# Number of workers (usually CPU count)
|
||||
workers = ${UWSGI_WORKERS:-%k}
|
||||
threads = ${UWSGI_THREADS:-4}
|
||||
|
||||
# plugin: python
|
||||
# --------------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
|
||||
|
||||
# load a WSGI module
|
||||
module = searx.webapp
|
||||
|
||||
# set PYTHONHOME/virtualenv
|
||||
virtualenv = ${SEARXNG_PYENV}
|
||||
|
||||
# add directory (or glob) to pythonpath
|
||||
pythonpath = ${SEARXNG_SRC}
|
||||
|
||||
|
||||
# speak to upstream
|
||||
# -----------------
|
||||
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http
|
||||
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||
|
||||
http = ${SEARXNG_INTERNAL_HTTP}
|
||||
buffer-size = 8192
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
static-map = /static=${SEARXNG_STATIC}
|
||||
static-gzip-all = True
|
||||
offload-threads = %k
|
||||
82
utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
Normal file
82
utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
Normal file
@@ -0,0 +1,82 @@
|
||||
# -*- mode: conf; coding: utf-8 -*-
|
||||
[uwsgi]
|
||||
|
||||
# uWSGI core
|
||||
# ----------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
|
||||
|
||||
# Who will run the code
|
||||
uid = ${SERVICE_USER}
|
||||
gid = ${SERVICE_GROUP}
|
||||
|
||||
# set (python) default encoding UTF-8
|
||||
env = LANG=C.UTF-8
|
||||
env = LANGUAGE=C.UTF-8
|
||||
env = LC_ALL=C.UTF-8
|
||||
|
||||
# chdir to specified directory before apps loading
|
||||
chdir = ${SEARXNG_SRC}/searx
|
||||
|
||||
# SearXNG configuration (settings.yml)
|
||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||
|
||||
# disable logging for privacy
|
||||
logger = systemd
|
||||
disable-logging = true
|
||||
|
||||
# The right granted on the created socket
|
||||
chmod-socket = 666
|
||||
|
||||
# Plugin to use and interpreter config
|
||||
single-interpreter = true
|
||||
|
||||
# enable master process
|
||||
master = true
|
||||
|
||||
# load apps in each worker instead of the master
|
||||
lazy-apps = true
|
||||
|
||||
# load uWSGI plugins
|
||||
plugin = python
|
||||
|
||||
# By default the Python plugin does not initialize the GIL. This means your
|
||||
# app-generated threads will not run. If you need threads, remember to enable
|
||||
# them with enable-threads. Running uWSGI in multithreading mode (with the
|
||||
# threads options) will automatically enable threading support. This *strange*
|
||||
# default behaviour is for performance reasons.
|
||||
enable-threads = true
|
||||
|
||||
# Number of workers (usually CPU count)
|
||||
workers = ${UWSGI_WORKERS:-%k}
|
||||
threads = ${UWSGI_THREADS:-4}
|
||||
|
||||
# plugin: python
|
||||
# --------------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
|
||||
|
||||
# load a WSGI module
|
||||
module = searx.webapp
|
||||
|
||||
# set PYTHONHOME/virtualenv
|
||||
virtualenv = ${SEARXNG_PYENV}
|
||||
|
||||
# add directory (or glob) to pythonpath
|
||||
pythonpath = ${SEARXNG_SRC}
|
||||
|
||||
|
||||
# speak to upstream
|
||||
# -----------------
|
||||
|
||||
socket = ${SEARXNG_UWSGI_SOCKET}
|
||||
buffer-size = 8192
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
static-map = /static=${SEARXNG_STATIC}
|
||||
static-gzip-all = True
|
||||
offload-threads = %k
|
||||
88
utils/templates/etc/uwsgi/apps-available/searxng.ini
Normal file
88
utils/templates/etc/uwsgi/apps-available/searxng.ini
Normal file
@@ -0,0 +1,88 @@
|
||||
# -*- mode: conf; coding: utf-8 -*-
|
||||
[uwsgi]
|
||||
|
||||
# uWSGI core
|
||||
# ----------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
|
||||
|
||||
# Who will run the code / Hint: in emperor-tyrant mode uid & gid setting will be
|
||||
# ignored [1]. Mode emperor-tyrant is the default on fedora (/etc/uwsgi.ini).
|
||||
#
|
||||
# [1] https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#tyrant-mode-secure-multi-user-hosting
|
||||
#
|
||||
uid = ${SERVICE_USER}
|
||||
gid = ${SERVICE_GROUP}
|
||||
|
||||
# set (python) default encoding UTF-8
|
||||
env = LANG=C.UTF-8
|
||||
env = LANGUAGE=C.UTF-8
|
||||
env = LC_ALL=C.UTF-8
|
||||
|
||||
# chdir to specified directory before apps loading
|
||||
chdir = ${SEARXNG_SRC}/searx
|
||||
|
||||
# SearXNG configuration (settings.yml)
|
||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||
|
||||
# disable logging for privacy
|
||||
disable-logging = true
|
||||
|
||||
# The right granted on the created socket
|
||||
chmod-socket = 666
|
||||
|
||||
# Plugin to use and interpreter config
|
||||
single-interpreter = true
|
||||
|
||||
# enable master process
|
||||
master = true
|
||||
|
||||
# load apps in each worker instead of the master
|
||||
lazy-apps = true
|
||||
|
||||
# load uWSGI plugins
|
||||
plugin = python3,http
|
||||
|
||||
# By default the Python plugin does not initialize the GIL. This means your
|
||||
# app-generated threads will not run. If you need threads, remember to enable
|
||||
# them with enable-threads. Running uWSGI in multithreading mode (with the
|
||||
# threads options) will automatically enable threading support. This *strange*
|
||||
# default behaviour is for performance reasons.
|
||||
enable-threads = true
|
||||
|
||||
# Number of workers (usually CPU count)
|
||||
workers = ${UWSGI_WORKERS:-%k}
|
||||
threads = ${UWSGI_THREADS:-4}
|
||||
|
||||
# plugin: python
|
||||
# --------------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
|
||||
|
||||
# load a WSGI module
|
||||
module = searx.webapp
|
||||
|
||||
# set PYTHONHOME/virtualenv
|
||||
virtualenv = ${SEARXNG_PYENV}
|
||||
|
||||
# add directory (or glob) to pythonpath
|
||||
pythonpath = ${SEARXNG_SRC}
|
||||
|
||||
|
||||
# speak to upstream
|
||||
# -----------------
|
||||
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http
|
||||
# Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
|
||||
|
||||
http = ${SEARXNG_INTERNAL_HTTP}
|
||||
buffer-size = 8192
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
static-map = /static=${SEARXNG_STATIC}
|
||||
static-gzip-all = True
|
||||
offload-threads = %k
|
||||
85
utils/templates/etc/uwsgi/apps-available/searxng.ini:socket
Normal file
85
utils/templates/etc/uwsgi/apps-available/searxng.ini:socket
Normal file
@@ -0,0 +1,85 @@
|
||||
# -*- mode: conf; coding: utf-8 -*-
|
||||
[uwsgi]
|
||||
|
||||
# uWSGI core
|
||||
# ----------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
|
||||
|
||||
# Who will run the code / Hint: in emperor-tyrant mode uid & gid setting will be
|
||||
# ignored [1]. Mode emperor-tyrant is the default on fedora (/etc/uwsgi.ini).
|
||||
#
|
||||
# [1] https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html#tyrant-mode-secure-multi-user-hosting
|
||||
#
|
||||
uid = ${SERVICE_USER}
|
||||
gid = ${SERVICE_GROUP}
|
||||
|
||||
# set (python) default encoding UTF-8
|
||||
env = LANG=C.UTF-8
|
||||
env = LANGUAGE=C.UTF-8
|
||||
env = LC_ALL=C.UTF-8
|
||||
|
||||
# chdir to specified directory before apps loading
|
||||
chdir = ${SEARXNG_SRC}/searx
|
||||
|
||||
# SearXNG configuration (settings.yml)
|
||||
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
|
||||
|
||||
# disable logging for privacy
|
||||
disable-logging = true
|
||||
|
||||
# The right granted on the created socket
|
||||
chmod-socket = 666
|
||||
|
||||
# Plugin to use and interpreter config
|
||||
single-interpreter = true
|
||||
|
||||
# enable master process
|
||||
master = true
|
||||
|
||||
# load apps in each worker instead of the master
|
||||
lazy-apps = true
|
||||
|
||||
# load uWSGI plugins
|
||||
plugin = python3,http
|
||||
|
||||
# By default the Python plugin does not initialize the GIL. This means your
|
||||
# app-generated threads will not run. If you need threads, remember to enable
|
||||
# them with enable-threads. Running uWSGI in multithreading mode (with the
|
||||
# threads options) will automatically enable threading support. This *strange*
|
||||
# default behaviour is for performance reasons.
|
||||
enable-threads = true
|
||||
|
||||
# Number of workers (usually CPU count)
|
||||
workers = ${UWSGI_WORKERS:-%k}
|
||||
threads = ${UWSGI_THREADS:-4}
|
||||
|
||||
# plugin: python
|
||||
# --------------
|
||||
#
|
||||
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
|
||||
|
||||
# load a WSGI module
|
||||
module = searx.webapp
|
||||
|
||||
# set PYTHONHOME/virtualenv
|
||||
virtualenv = ${SEARXNG_PYENV}
|
||||
|
||||
# add directory (or glob) to pythonpath
|
||||
pythonpath = ${SEARXNG_SRC}
|
||||
|
||||
|
||||
# speak to upstream
|
||||
# -----------------
|
||||
|
||||
socket = ${SEARXNG_UWSGI_SOCKET}
|
||||
buffer-size = 8192
|
||||
|
||||
# uWSGI serves the static files and in settings.yml we use::
|
||||
#
|
||||
# ui:
|
||||
# static_use_hash: true
|
||||
#
|
||||
static-map = /static=${SEARXNG_STATIC}
|
||||
static-gzip-all = True
|
||||
offload-threads = %k
|
||||
Reference in New Issue
Block a user