From 906dc18060c56384684fbb16f371a0fe78d6dc22 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Wed, 16 Apr 2025 08:43:32 +0200 Subject: [PATCH] fix : start_service.sh & compose --- docker-compose.yml | 3 +-- searxng/entrypoint.sh | 9 --------- searxng/settings.yml | 2 +- searxng/settings.yml.new | 2 +- sources/tmp.py | 7 ------- sources/tools/flightSearch.py | 1 + sources/tools/tools.py | 1 - 7 files changed, 4 insertions(+), 21 deletions(-) delete mode 100755 searxng/entrypoint.sh delete mode 100644 sources/tmp.py diff --git a/docker-compose.yml b/docker-compose.yml index b416157..8a4753a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,10 +30,9 @@ services: - "8080:8080" volumes: - ./searxng:/etc/searxng:rw - - ./searxng/entrypoint.sh:/usr/local/bin/searxng-entrypoint.sh:ro - entrypoint: /usr/local/bin/searxng-entrypoint.sh environment: - SEARXNG_BASE_URL=http://localhost:8080/ + - SEARXNG_SECRET_KEY=$(openssl rand -hex 32) - UWSGI_WORKERS=4 - UWSGI_THREADS=4 cap_add: diff --git a/searxng/entrypoint.sh b/searxng/entrypoint.sh deleted file mode 100755 index dfb61d1..0000000 --- a/searxng/entrypoint.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# entrypoint for docker searxng service - -SECRET_KEY=$(openssl rand -hex 32) - -sed -i "s/ultrasecretkey/$SECRET_KEY/g" /etc/searxng/settings.yml - -exec /usr/local/searxng/dockerfiles/docker-entrypoint.sh "$@" \ No newline at end of file diff --git a/searxng/settings.yml b/searxng/settings.yml index bc94f8f..2e2d640 100644 --- a/searxng/settings.yml +++ b/searxng/settings.yml @@ -95,7 +95,7 @@ server: # If your instance owns a /etc/searxng/settings.yml file, then set the following # values there. - secret_key: "ultrasecretkey" # Is overwritten by ${SEARXNG_SECRET} + secret_key: "supersecret" # Is overwritten by ${SEARXNG_SECRET},W # Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY} image_proxy: false # 1.0 and 1.1 are supported diff --git a/searxng/settings.yml.new b/searxng/settings.yml.new index 95793a1..36a97b5 100644 --- a/searxng/settings.yml.new +++ b/searxng/settings.yml.new @@ -95,7 +95,7 @@ server: # If your instance owns a /etc/searxng/settings.yml file, then set the following # values there. - secret_key: "7e1e975e77322d8a27f0cc403e6dbd4cd8f75336358bf5c88c0ddd83d7be78dc" # Is overwritten by ${SEARXNG_SECRET} + secret_key: "a0f32049a2301f36ef012b9b7ef62733b4af1379a1d28d5c33d92cea37288182" # Is overwritten by ${SEARXNG_SECRET} # Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY} image_proxy: false # 1.0 and 1.1 are supported diff --git a/sources/tmp.py b/sources/tmp.py deleted file mode 100644 index 24d29f5..0000000 --- a/sources/tmp.py +++ /dev/null @@ -1,7 +0,0 @@ - -def print_hello(): - hello = "Hello World" - print(hello) - -if __name__ == "__main__": - print_hello() diff --git a/sources/tools/flightSearch.py b/sources/tools/flightSearch.py index 7550ab8..43246f1 100644 --- a/sources/tools/flightSearch.py +++ b/sources/tools/flightSearch.py @@ -16,6 +16,7 @@ class FlightSearch(Tools): """ super().__init__() self.tag = "flight_search" + self.api_key = None self.api_key = api_key or os.getenv("AVIATIONSTACK_API_KEY") def execute(self, blocks: str, safety: bool = True) -> str: diff --git a/sources/tools/tools.py b/sources/tools/tools.py index 090ae7d..26489af 100644 --- a/sources/tools/tools.py +++ b/sources/tools/tools.py @@ -31,7 +31,6 @@ class Tools(): """ def __init__(self): self.tag = "undefined" - self.api_key = None self.client = None self.messages = [] self.logger = Logger("tools.log")