Skip to content

Commit 3690746

Browse files
authored
Update searx and proxy configs (#28)
* add clash to searxng compose * reset secret_key * debug clash auto start
1 parent 1549eb0 commit 3690746

File tree

11 files changed

+132
-19
lines changed

11 files changed

+132
-19
lines changed

docker_app_clash/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
## Usage
88

99
```shell
10-
docker run -d --name=app-clash -p 7890:7890 -p 9090:9090 qpod/app-clash
10+
docker run -d \
11+
--name=app-clash \
12+
-p 7890:7890 -p 9090:9090 \
13+
-e PROXY_PROVIDER="https://subs.zeabur.app/clash" \
14+
qpod/app-clash
1115
```
16+
17+
After the container starts, visit this page to manage proxy: http://localhost:9090/ui/ui-xd/

docker_app_clash/clash.Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ COPY work/clash /opt/utils/
1212

1313
RUN set -eux && source /opt/utils/script-setup-clash.sh \
1414
&& setup_clash && setup_clash_metacubexd && setup_clash_verge \
15-
&& mv /opt/utils/config.yaml /opt/clash/config
15+
&& mv /opt/utils/config.yaml /opt/clash/config \
16+
&& mv /opt/utils/start-clash.sh /opt/clash/
1617

1718

1819
# Stage 2: runtime image, copy files from builder image
@@ -21,7 +22,9 @@ FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG}
2122
COPY --from=builder /opt/clash /opt/clash
2223
WORKDIR /opt/clash
2324
RUN set -eux \
25+
&& chmod +x /opt/clash/*.sh \
2426
&& echo 'export PATH=${PATH}:/opt/clash' >> /etc/profile.d/path-clash.sh \
2527
&& ln -sf /opt/clash/clash /usr/local/bin/
2628

27-
CMD ["/opt/clash/clash", "-d", "config"]
29+
ENV PROXY_PROVIDER="https://subs.zeabur.app/clash"
30+
CMD ["/opt/clash/start-clash.sh"]
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
services:
22
svc-clash:
3-
image: qpod/app-clash
4-
container_name: app-clash
3+
image: docker.io/qpod/app-clash
4+
container_name: svc-clash
5+
hostname: svc-clash
56
restart: unless-stopped
67
pid: host
78
ipc: host
8-
volumes:
9-
- ../work/clash/config.yaml:/opt/clash/config/config.yaml:ro
9+
# When your system is Linux, you can use `network_mode: "host"` directly.
10+
# network_mode: "host"
1011
ports:
1112
- "7890:7890"
1213
- "9090:9090"
13-
# When your system is Linux, you can use `network_mode: "host"` directly.
14-
# network_mode: "host"
14+
# volumes:
15+
# - ../work/clash/config.yaml:/opt/clash/config/config.yaml
16+
environment:
17+
- PROXY_PROVIDER="https://subs.zeabur.app/clash"

docker_app_clash/work/clash/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use: &use
3232
proxy-providers:
3333
proxy-provider-1:
3434
<<: *p
35-
url: https://your.subscription.com/should-be-filled-here
35+
url: "PROXY_PROVIDER" # e.g.: https://your.subscription.com/should-be-filled-here
3636

3737

3838
# ------------------------- rule provider config -------------------------
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /usr/bin/env bash
2+
set -eux
3+
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
6+
echo "Setting PROXY_PROVIDER to: ${PROXY_PROVIDER}!"
7+
sed -i -e "s|PROXY_PROVIDER|${PROXY_PROVIDER}|g" "${CLASH_CONFIG_PATH:-"/opt/clash/config/config.yaml"}"
8+
9+
exec /opt/clash/clash -d config $@

docker_casdoor/demo/docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
db-postgres-casdoor:
33
# su postgres && psql -d casdoor -U pg-casdoor-username
4-
image: qpod/postgres-16:latest
4+
image: docker.io/qpod/postgres-16:latest
55
container_name: db-postgres
66
environment:
77
POSTGRES_DB: casdoor

docker_casdoor/demo/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
services:
22
db-postgres-casdoor:
33
# su postgres && psql -d casdoor -U pg-casdoor-username
4-
image: qpod/postgres-16:latest
4+
image: docker.io/qpod/postgres-16:latest
55
container_name: db-postgres
66
environment:
77
POSTGRES_DB: casdoor
88
POSTGRES_USER: postgres
99
POSTGRES_PASSWORD: postgres
1010

1111
svc-casdoor:
12-
image: qpod/casdoor
12+
image: docker.io/qpod/casdoor
1313
container_name: svc-casdoor
1414
# command: ["/bin/bash", "--login", "/opt/casdoor/server", "--createDatabase=true"]
1515
command: |

docker_keycloak/demo/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
services:
22
db-postgres:
33
# su postgres && psql -d keycloak -U pg-keycloak-username
4-
image: postgres:15
4+
image: docker.io/library/postgres:16
55
container_name: db-postgres
66
environment:
77
POSTGRES_DB: keycloak
88
POSTGRES_USER: pg-keycloak-username
99
POSTGRES_PASSWORD: pg-keycloak-password
1010

1111
svc-keycloak:
12-
image: qpod/keycloak
12+
image: docker.io/qpod/keycloak
1313
# build:
1414
# context: ../
1515
# dockerfile: Dockerfile

docker_searxng/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
## Start standalone version with docker-compose
44

5-
**Notice**: remember to check the `SEARXNG_BASE_URL` and `SEARXNG_HOSTNAME` environment variable in the config file.
5+
**Notice**:
66

7-
Make sure the `SEARXNG_BASE_URL` variables points to a URL prefix that users use to open webpage in browser.
7+
- remember to check the `SEARXNG_BASE_URL` and `SEARXNG_HOSTNAME` environment variable in the config file.
8+
- make sure the `SEARXNG_BASE_URL` variables points to a URL prefix that users use to open webpage in browser.
9+
- update `proxy-providers` urls in `config.yaml` if you are using proxy.
810

911
```bash
1012
cd demo
1113

12-
# export SEARXNG_HOSTNAME="http://localhost:81"
13-
docker-compose -f ./docker-compose.searxng-standalone.yml up -d
14+
# export SEARXNG_HOSTNAME="http://localhost:8000"
15+
# docker-compose -f ./docker-compose.searxng-standalone.yml up -d
16+
docker-compose -f ./docker-compose.searxng-with-proxy.yml up -d
1417
```
1518

1619
## Debug with Docker
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
networks:
2+
net-searxng:
3+
4+
services:
5+
svc-searxng:
6+
container_name: svc-searxng
7+
hostname: svc-searxng
8+
image: docker.io/qpod/searxng:latest
9+
restart: unless-stopped
10+
networks: ["net-searxng"]
11+
ports:
12+
- "8000:8000"
13+
volumes:
14+
- ./searxng/settings.yml:/etc/searxng/settings.yml:rw
15+
# - ./searxng/limiter.toml:/etc/searxng/limiter.toml:rw
16+
# - ./searxng/Caddyfile:/etc/searxng/Caddyfile:rw
17+
# - ./searxng/supervisord.conf:/etc/searxng/supervisord.conf:rw
18+
environment:
19+
- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost:8000}/
20+
- SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME:-http://localhost:8000}
21+
- SEARXNG_TLS=${LETSENCRYPT_EMAIL:-internal}
22+
- UWSGI_WORKERS=${SEARXNG_UWSGI_WORKERS:-4}
23+
- UWSGI_THREADS=${SEARXNG_UWSGI_THREADS:-4}
24+
# user: root
25+
# command: ["/opt/searxng/start-supervisord.sh"]
26+
# command: ["tail", "-f", "/dev/null"]
27+
# cap_drop: ["ALL"]
28+
# cap_add: ["AUDIT_WRITE", "CHOWN", "SETGID", "SETUID", "NET_BIND_SERVICE"]
29+
logging:
30+
driver: "json-file"
31+
options:
32+
max-size: "1m"
33+
max-file: "1"
34+
35+
svc-clash:
36+
image: docker.io/qpod/app-clash
37+
container_name: svc-clash
38+
hostname: svc-clash
39+
restart: unless-stopped
40+
pid: host
41+
ipc: host
42+
# When your system is Linux, you can use `network_mode: "host"` directly.
43+
# network_mode: "host"
44+
networks: ["net-searxng"]
45+
ports:
46+
- "7890:7890"
47+
- "9090:9090"
48+
# volumes:
49+
# - ./clash/config.yaml:/opt/clash/config/config.yaml
50+
environment:
51+
- PROXY_PROVIDER="https://subs.zeabur.app/clash"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings
2+
use_default_settings: true
3+
server:
4+
# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
5+
secret_key: "ultrasecretkey" # change this!
6+
limiter: false # can be disabled for a private instance, requires redis when enabled
7+
image_proxy: true
8+
ui:
9+
static_use_hash: true
10+
# redis:
11+
# url: redis://redis:6379/0
12+
search:
13+
formats:
14+
- html
15+
- json
16+
engines:
17+
- name: bing
18+
engine: bing
19+
shortcut: bi
20+
disabled: false
21+
number_of_results: 1
22+
- name: google
23+
engine: google
24+
shortcut: go
25+
number_of_results: 1
26+
- name: wikipedia
27+
engine: wikipedia
28+
shortcut: wp
29+
number_of_results: 1
30+
# add "list" to the array to get results in the results list
31+
display_type: ["infobox"]
32+
base_url: 'https://{language}.wikipedia.org/'
33+
categories: [general]
34+
outgoing:
35+
proxies:
36+
all://:
37+
# need to make sure the containers of app-clash and searxng can communicate with each other
38+
- http://app-clash:7890

0 commit comments

Comments
 (0)