Likhith Sai Seemala commited on
Commit
eed2c85
·
1 Parent(s): 584a26b

Enable Tor and add public SearXNG URL

Browse files
Files changed (2) hide show
  1. Dockerfile +8 -2
  2. config.yaml +2 -0
Dockerfile CHANGED
@@ -12,8 +12,8 @@ RUN apt-get update && apt-get install -y \
12
  # Copy source code
13
  COPY . .
14
 
15
- # Build the application
16
- RUN cargo build --release
17
 
18
  # --- Runtime Stage ---
19
  FROM python:3.10-slim-bookworm
@@ -25,6 +25,7 @@ RUN apt-get update && apt-get install -y \
25
  curl \
26
  ca-certificates \
27
  libssl3 \
 
28
  && rm -rf /var/lib/apt/lists/*
29
 
30
  # Create a non-root user for Hugging Face Spaces
@@ -55,6 +56,11 @@ COPY config.yaml sources.yaml /home/user/app/
55
  # Create entrypoint script
56
  USER root
57
  RUN echo '#!/bin/bash\n\
 
 
 
 
 
58
  # Start Python Query Layer in background\n\
59
  cd /home/user/app/services/query_layer && python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 &\n\
60
  \n\
 
12
  # Copy source code
13
  COPY . .
14
 
15
+ # Build the application with Tor support
16
+ RUN cargo build --release --features tor
17
 
18
  # --- Runtime Stage ---
19
  FROM python:3.10-slim-bookworm
 
25
  curl \
26
  ca-certificates \
27
  libssl3 \
28
+ tor \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
  # Create a non-root user for Hugging Face Spaces
 
56
  # Create entrypoint script
57
  USER root
58
  RUN echo '#!/bin/bash\n\
59
+ # Start Tor daemon\n\
60
+ mkdir -p /tmp/tor-data\n\
61
+ tor -f /tmp/tor/torrc --allow-missing-torrc --SocksPort 9050 --DataDirectory /tmp/tor-data &\n\
62
+ sleep 5\n\
63
+ \n\
64
  # Start Python Query Layer in background\n\
65
  cd /home/user/app/services/query_layer && python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 &\n\
66
  \n\
config.yaml CHANGED
@@ -157,3 +157,5 @@ max_parallel_gaps = 3
157
  search_limit = 20
158
  # Cache TTL in seconds (Pixabay requires 24h minimum)
159
  cache_ttl_secs = 86400
 
 
 
157
  search_limit = 20
158
  # Cache TTL in seconds (Pixabay requires 24h minimum)
159
  cache_ttl_secs = 86400
160
+
161
+ searxng_url = "https://search.bus-hit.me"