Skip to content

Commit c607952

Browse files
mikkotorcrypt0rr
andauthored
* Make SearXNG use valkey since it is installed (#263)
* Rename redis -> valkey, since Redis is not used here Co-authored-by: Bart <57799908+crypt0rr@users.noreply.github.com>
1 parent 7d7f248 commit c607952

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

services/searxng/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ TAILNET_NAME=
2121
# PUID=1000
2222

2323
SEARXNG_SECRET= # Generate a random secret for searxng, e.g. using `openssl rand -hex 32`
24+
SEARXNG_VALKEY_URL=valkey://valkey-searxng:6379/0 # URL for valkey, format: valkey://<hostname>:<port>/<db>

services/searxng/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This Docker Compose configuration sets up [searXNG](https://github.com/searxng/s
1111
In this setup, the `tailscale-searxng` service runs Tailscale, which manages secure networking for the searXNG service. The `searxng` service utilizes the Tailscale network stack via Docker’s `network_mode: service:` configuration. This setup ensures that searXNG is only accessible through your Tailscale network (or locally, if preferred). With this configuration, you can enjoy a private, secure, and customizable search engine experience, free from user tracking or external access.
1212

1313
We use `/searxng/settings.yml` copied from <https://github.com/searxng/searxng/blob/master/searx/settings.yml> as the default settings file. This dir is mounted as a volume, on docker and required for the first run.
14+
The default `settings.yml` does not use valkey ([valkey](https://github.com/searxng/searxng/blob/master/searx/settings.yml#L121) URL is set to `false`). We enable this by setting the `SEARXNG_VALKEY_URL` in `.env` file and using that in the `compose.yaml` file.
1415

1516
## References
1617

services/searxng/compose.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ configs:
88
"AllowFunnel":{"$${TS_CERT_DOMAIN}:443":false}}
99
1010
services:
11-
# Make sure you have updated/checked the .env file with the correct variables.
11+
# Make sure you have updated/checked the .env file with the correct variables.
1212
# All the ${ xx } need to be defined there.
1313
# Tailscale Sidecar Configuration
1414
tailscale:
@@ -37,7 +37,7 @@ services:
3737
#ports:
3838
# - 0.0.0.0:${SERVICEPORT}:${SERVICEPORT} # Binding port ${SERVICE}PORT to the local network - may be removed if only exposure to your Tailnet is required
3939
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
40-
# dns:
40+
# dns:
4141
# - ${DNS_SERVER}
4242
healthcheck:
4343
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
@@ -55,8 +55,9 @@ services:
5555
environment:
5656
- PUID=1000
5757
- PGID=1000
58+
- SEARXNG_BASE_URL=https://${SERVICE}.${TAILNET_NAME}.ts.net/
59+
- SEARXNG_VALKEY_URL=${SEARXNG_VALKEY_URL}
5860
- TZ=${TZ}
59-
- SEARXNG_BASE_URL=https://searxng.${TAILNET_NAME}.ts.net/
6061
volumes:
6162
- ./searxng:/etc/searxng:rw
6263
cap_drop:
@@ -74,11 +75,11 @@ services:
7475
depends_on:
7576
tailscale:
7677
condition: service_healthy
77-
redis:
78+
valkey:
7879
condition: service_started
7980

80-
redis:
81-
container_name: redis-searxng
81+
valkey:
82+
container_name: valkey-searxng
8283
image: docker.io/valkey/valkey:8-alpine
8384
command: valkey-server --save 30 1 --loglevel warning
8485
restart: unless-stopped

0 commit comments

Comments
 (0)