User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:searxng [2024/03/26 10:22] willyservices:searxng [2024/11/11 06:54] (current) – external edit 127.0.0.1
Line 5: Line 5:
 ===== Installation ===== ===== Installation =====
  
-There are multiple installation approaches possible. You can either go with containers or bare-metal. While i usually recoment bare-metal, this time going the podman way is actually recomended because the bare-metal approach requires running a root install script, which is **not** a good idea, or read it and decompose enough to run the single commands by hand, which would be annoying and not too much fun because the install script is complex and well written.+There are multiple installation approaches possible. You can either go with containers or bare-metal. While i usually recommend bare-metal, this time going the podman way is actually preferable because the bare-metal approach requires running a root install script, which is **not** a good idea, or read it and decompose enough to run the single commands by hand, which would be annoying and not too much fun since the install script is complex and not well written.
  
-So, as usual create the user and clone the repo and copy the compose yaml +So, as usual create the user, then clone the repository and copy the **docker-compose.yaml**:
 <code bash> <code bash>
-useradd -d /deposito/daemons/searxng -m searxng+useradd -d /data/daemons/searxng -m searxng
 su - searxng su - searxng
 git clone https://github.com/searxng/searxng-docker.git git clone https://github.com/searxng/searxng-docker.git
Line 15: Line 15:
 </code> </code>
  
-Now you don't want Caddy because you already have NGINX as reverse proxy, so :+Now you don't want Caddy because you already have NGINX as reverse proxy, so edit the docker compose file like the following example:
 <file - docker-compose.yml> <file - docker-compose.yml>
 version: "3.7" version: "3.7"
Line 23: Line 23:
     image: docker.io/searxng/searxng:latest     image: docker.io/searxng/searxng:latest
     networks:     networks:
-      - searxng+      - searxng-net
     ports:     ports:
       - "127.0.0.1:8083:8080"       - "127.0.0.1:8083:8080"
Line 43: Line 43:
  
 networks: networks:
-  searxng:+  searxng-net:
     ipam:     ipam:
       driver: default       driver: default
Line 55: Line 55:
 Remember to set an available port (8083)! Remember to set an available port (8083)!
  
-Now pull and start it:+Now pull it:
 <code bash> <code bash>
 podman compose pull podman compose pull
 </code> </code>
  
-To start it, and set it up on boot, as usual add the following lines to your **/etc/local.d/80-containers.start**: 
-<code> 
-podmnan network create searxng 
-su - searxng -c "podman compose up -d" 
-</code> 
  
-and to the **/etc/local.d/80-containers.stop**: +===== Reverse Proxy =====
-<code> +
-su - searxng -c "podman composedown" +
-</code>+
  
-You can start it now by running the above command in the start file.+You can run SearXNG both as a subdomain or a subpath. I prefer the first one because it make it easier to integrate as Firefox default search engine.
  
-===== Reverse Proxy =====+I assume the SearXNG will be reachable as **https://search.mydomain.com**.
  
-Following [[https://docs.searxng.org/admin/installation-nginx.html#installation-nginx|this page]] create a NGINX config file called **searxng.conf** like this: +Following [[https://docs.searxng.org/admin/installation-nginx.html#installation-nginx|this page]] create a NGINX config file called **/etc/nginx/com.mydomain/search/search.conf** like this: 
-<file - searxng.conf> +<file - search.conf> 
-location /searxng/ {+server { 
 +        server_name search.mydomain.com; 
 +        listen 443 ssl;  
 +        listen 8443 ssl;  
 +        http2 on;
  
-    proxy_pass http://127.0.0.1:8083/;+        access_log /var/log/nginx/search.mydomain.com_access_log main; 
 +        error_log /var/log/nginx/search.mydomain.com_error_log info;
  
-    proxy_set_header   Host             $host; +        location / {
-    proxy_set_header   Connection       $http_connection;+
  
-    # see flaskfix.py +            proxy_pass http://127.0.0.1:8083/;
-    proxy_set_header   X-Scheme         $scheme; +
-    proxy_set_header   X-Script-Name    /searxng/;+
  
-    # see limiter.py +            proxy_set_header   Host             $host
-    proxy_set_header   X-Real-IP        $remote_addr+            proxy_set_header   Connection       $http_connection;
-    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;+
  
-    proxy_buffering  off; +            see flaskfix.py 
-    # proxy_request_buffering off+            proxy_set_header   X-Scheme         $scheme
-    # proxy_buffer_size 8k;+            proxy_set_header   X-Script-Name    /searxng/;
  
-    access_log /dev/null+            # see limiter.py 
-    error_log  /dev/null;+            proxy_set_header   X-Real-IP        $remote_addr
 +            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
  
 +            access_log /dev/null;
 +            error_log  /dev/null;
 +        }
 } }
 </file> </file>
Line 104: Line 101:
 and add it to your NGINX configuration. See [[selfhost:nginx|The Reverse Proxy concept]] for more details. and add it to your NGINX configuration. See [[selfhost:nginx|The Reverse Proxy concept]] for more details.
  
 +SSO can be added using the **basic** endpoint in Authelia or NGINX PAM Auth.
 +
 +===== Add to firefox =====
 +
 +Navigate your firefox to **https://search.mydomain.com**, then right-click on address bar and select the last icon: add SearXNG as search engine. If the option is missing, you have a different version of Firefox, check online how to do such a thing. 
 +
 +===== Autostart =====
 +
 +To start it, and set it up on boot, as usual follow my indications [[gentoo:containers|Using Containers on Gentoo]], so link the **user-containers** init script:
 +<code>
 +ln -s /etc/init.d/user-containers /etc/init.d/user-containers.searxng
 +</code>
 +
 +and create the following config file:
 +<file - /etc/conf.d/user-containers.searxng>
 +USER=searxng
 +DESCRIPTION="The search engine"
 +</file>
 +
 +Add the service to the default runlevel and start it now:
 +<code bash>
 +rc-update add user-containers.searxng default
 +rc-service user-containers.searxng start
 +</code>
  
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information