From 8b7e1fa475875d4ec4cd76e0b46efff15b68abc5 Mon Sep 17 00:00:00 2001 From: Viyurz <128215328+Viyurz@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:55:29 +0000 Subject: [PATCH] Ajout SearXNG --- maj.sh | 2 +- nginx-rp/docker-compose.yaml | 1 + nginx-rp/nginx.conf | 19 +++++++++++++--- searxng/docker-compose.yaml | 44 ++++++++++++++++++++++++++++++++++++ searxng/limiter.toml | 3 +++ searxng/settings.yml | 37 ++++++++++++++++++++++++++++++ 6 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 searxng/docker-compose.yaml create mode 100644 searxng/limiter.toml create mode 100644 searxng/settings.yml diff --git a/maj.sh b/maj.sh index 74efb15..129fda9 100755 --- a/maj.sh +++ b/maj.sh @@ -1,7 +1,7 @@ #!/bin/bash -services=(nginx-rp nginx-www vw) +services=(nginx-rp nginx-www searxng vw) if [[ ! $(echo "${services[*]} all" | grep -P "\b$1\b" ) ]]; then diff --git a/nginx-rp/docker-compose.yaml b/nginx-rp/docker-compose.yaml index 4c524d9..d11e01c 100644 --- a/nginx-rp/docker-compose.yaml +++ b/nginx-rp/docker-compose.yaml @@ -6,4 +6,5 @@ services: network_mode: host volumes: - ./nginx.conf:/etc/nginx/nginx.conf + - /etc/letsencrypt/live/viyurz.fr:/etc/letsencrypt/live/viyurz.fr - /etc/letsencrypt/archive/viyurz.fr:/etc/letsencrypt/archive/viyurz.fr diff --git a/nginx-rp/nginx.conf b/nginx-rp/nginx.conf index cc0760c..fe73d82 100644 --- a/nginx-rp/nginx.conf +++ b/nginx-rp/nginx.conf @@ -29,9 +29,9 @@ http { keepalive_timeout 65; - ssl_certificate /etc/letsencrypt/archive/viyurz.fr/fullchain1.pem; - ssl_certificate_key /etc/letsencrypt/archive/viyurz.fr/privkey1.pem; - ssl_trusted_certificate /etc/letsencrypt/archive/viyurz.fr/chain1.pem; + ssl_certificate /etc/letsencrypt/live/viyurz.fr/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/viyurz.fr/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/viyurz.fr/chain.pem; # modern configuration ssl_protocols TLSv1.3; @@ -156,6 +156,19 @@ http { } } + server { + listen 443 ssl; + listen [::]:443 ssl; + + http2 on; + + server_name sx.viyurz.fr; + + location / { + proxy_pass http://127.0.0.1:8083; + } + } + server { listen 443 ssl; listen [::]:443 ssl; diff --git a/searxng/docker-compose.yaml b/searxng/docker-compose.yaml new file mode 100644 index 0000000..b83b88b --- /dev/null +++ b/searxng/docker-compose.yaml @@ -0,0 +1,44 @@ +services: + redis: + container_name: searxng_redis + image: redis:alpine + command: redis-server --save "" --appendonly "no" + networks: + - searxng + tmpfs: + - /var/lib/redis + cap_drop: + - ALL + cap_add: + - SETGID + - SETUID + - DAC_OVERRIDE + + searxng: + container_name: searxng + image: searxng/searxng:latest + networks: + - searxng + ports: + - 127.0.0.1:8083:8080 + volumes: + - ./settings.yml:/etc/searxng/settings.yml + - ./limiter.toml:/etc/searxng/limiter.toml + environment: + - SEARXNG_BASE_URL=https://sx.viyurz.fr/ + cap_drop: + - ALL + cap_add: + - CHOWN + - SETGID + - SETUID + logging: + driver: "json-file" + options: + max-size: "1m" + max-file: "1" + +networks: + searxng: + ipam: + driver: default diff --git a/searxng/limiter.toml b/searxng/limiter.toml new file mode 100644 index 0000000..1b4be3b --- /dev/null +++ b/searxng/limiter.toml @@ -0,0 +1,3 @@ +[botdetection.ip_limit] +# activate link_token method in the ip_limit method +link_token = true diff --git a/searxng/settings.yml b/searxng/settings.yml new file mode 100644 index 0000000..acb4d93 --- /dev/null +++ b/searxng/settings.yml @@ -0,0 +1,37 @@ +use_default_settings: true + +general: + instance_name: "SearXNG - Viyurz.fr" + +search: + # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "yandex", "mwmbl", + # "seznam", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off + # by default. + autocomplete: "google" + +server: + secret_key: "1d744894f2ff45be0990e0bf240456083cfe292a57857c0cdca88915531c2bb7" + limiter: false + image_proxy: true + +ui: + static_use_hash: true + +redis: + url: redis://searxng_redis:6379/0 + +engines: + - name: bing + disabled: false + + - name: duckduckgo + disabled: true + + - name: flickr + disabled: true + + - name: qwant + disabled: true + + - name: wikidata + disabled: true