fix: use BACKEND_PORT env var in uvicorn and honor base_url arg in searxSearch
- api.py: uvicorn.run was hardcoding port=7777 instead of using the port variable populated from BACKEND_PORT env var, making BACKEND_PORT ineffective when running python api.py directly - searxSearch: add missing 'import sys' (caused NameError when run as standalone script) and use constructor base_url arg with env var fallback so searxSearch(base_url=...) actually takes effect
This commit is contained in:
@@ -299,4 +299,4 @@ if __name__ == "__main__":
|
||||
port = int(envport)
|
||||
else:
|
||||
port = 7777
|
||||
uvicorn.run(api, host="0.0.0.0", port=7777)
|
||||
uvicorn.run(api, host="0.0.0.0", port=port)
|
||||
@@ -1,5 +1,6 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import sys
|
||||
import os
|
||||
|
||||
if __name__ == "__main__": # if running as a script for individual testing
|
||||
@@ -16,7 +17,7 @@ class searxSearch(Tools):
|
||||
self.tag = "web_search"
|
||||
self.name = "searxSearch"
|
||||
self.description = "A tool for searching a SearxNG for web search"
|
||||
self.base_url = os.getenv("SEARXNG_BASE_URL") # Requires a SearxNG base URL
|
||||
self.base_url = base_url or os.getenv("SEARXNG_BASE_URL") # Requires a SearxNG base URL
|
||||
self.user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
|
||||
self.paywall_keywords = [
|
||||
"Member-only", "access denied", "restricted content", "404", "this page is not working"
|
||||
|
||||
Reference in New Issue
Block a user