Tag Archives: docker

Playing with my private search engine

Searx is a free and open-source metasearch engine, available under the GNU Affero General Public License version 3, with the aim of protecting the privacy of its users. To this end, Searx does not share users’ IP addresses or search history with the search engines from which it gathers results.

It’s easy to install using docker, but i wanted to add my own mysql server data. ( pipetune search engine data in below example )
There are many search plugins and quite hackable.
But there was a missing python module in a docker image.

ModuleNotFoundError: No module named ‘mysql’

So i build a new docker image based on the original

# Install docker and docker-compose

cd /usr/local
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
Edit the .env file to set the hostname 
Generate the secret key sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
Edit the searxng/settings.yml file according to your need
Check everything is working: docker-compose up
Run SearXNG in the background: docker-compose up -d

I’ve changed the docker-compose.yaml

<     image: searxng/searxng:latest

>     build: .

changed the listen address
<      - ""
>      - "8080:8080"

Created a Dockerfile

FROM searxng/searxng:latest
RUN pip install mysql-connector-python

Changed searxng/settings.yml

  - name: tunesdb
    engine: mysql_server
    host: 10.12.0.xx
    database: pipetunesearch
    username: xxxxxxx
    password: xxxxxxx
    limit: 50
    query_str: 'SELECT * from tunes WHERE tunename=%(query)s'

I could not use a like statement in de sql query .. have to look into that

    query_str: 'SELECT * from tunes WHERE tunename like %(query)%' .. doesn´t work

Example showing own data

To complete this post the reverse proxy info ..

<VirtualHost *:443>
   SSLEngine on
   SSLProxyEngine On

   SSLProtocol all -SSLv2 -SSLv3 +TLSv1

   SSLCertificateFile wildcard.cer
   SSLCertificateKeyFile my.key
   SSLCertificateChainFile GlobalSignRootCA.cer
   SSLCertificateChainFile AlphaSSLCA-SHA256-G2.cer

   CustomLog /var/log/httpd/search_ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

    ServerAdmin webmaster@henriaanstoot.nl
    ServerName search.henriaanstoot.nl

ProxyRequests Off
ProxyPreserveHost On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off

<Location />
ProxyPass  http://dockerhostip:8080/
ProxyPassReverse  http://dockerhostip:8080/

    ErrorLog /var/log/httpd/search.henriaanstoot.nl-error.log
    CustomLog /var/log/httpd/search.henriaanstoot.nl-access.log combined

Add packages to a pre-existing docker image

A little test building a custom docker image, for a friend.

Q: I have a Node-red docker, but without ffmpeg binary

Using below code, i’ve added a overlay with ffmpeg.
Podman command’s should be working for docker command also.
(Note: When adding multiple packages OR other commands, try to use a single commandline, Every RUN command adds a overlay.

mkdir noderedbuild
cd  noderedbuild
vi Dockerfile
FROM nodered/node-red
LABEL description="Custom Nodered Build"
MAINTAINER haanstoot <fash@fash.nu>
USER root
RUN apk add  --no-cache ffmpeg

Below builds a local image named nodered:v1
NOTE: docker run command may be incomplete for Node-Red, this was just a example to add packages

podman build -t nodered:v1 .    
podman images
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered localhost/nodered:v1 -d

Tested with

[root@podman ~]# podman exec -it mynodered /bin/bash
bash-5.0# ffmpeg
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers



RTSP Frame save in Node-Red