Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update searx and proxy configs #28

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docker_app_clash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
## Usage

```shell
docker run -d --name=app-clash -p 7890:7890 -p 9090:9090 qpod/app-clash
docker run -d \
--name=app-clash \
-p 7890:7890 -p 9090:9090 \
-e PROXY_PROVIDER="https://subs.zeabur.app/clash" \
qpod/app-clash
```

After the container starts, visit this page to manage proxy: http://localhost:9090/ui/ui-xd/
7 changes: 5 additions & 2 deletions docker_app_clash/clash.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ COPY work/clash /opt/utils/

RUN set -eux && source /opt/utils/script-setup-clash.sh \
&& setup_clash && setup_clash_metacubexd && setup_clash_verge \
&& mv /opt/utils/config.yaml /opt/clash/config
&& mv /opt/utils/config.yaml /opt/clash/config \
&& mv /opt/utils/start-clash.sh /opt/clash/


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

CMD ["/opt/clash/clash", "-d", "config"]
ENV PROXY_PROVIDER="https://subs.zeabur.app/clash"
CMD ["/opt/clash/start-clash.sh"]
15 changes: 9 additions & 6 deletions docker_app_clash/demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
services:
svc-clash:
image: qpod/app-clash
container_name: app-clash
image: docker.io/qpod/app-clash
container_name: svc-clash
hostname: svc-clash
restart: unless-stopped
pid: host
ipc: host
volumes:
- ../work/clash/config.yaml:/opt/clash/config/config.yaml:ro
# When your system is Linux, you can use `network_mode: "host"` directly.
# network_mode: "host"
ports:
- "7890:7890"
- "9090:9090"
# When your system is Linux, you can use `network_mode: "host"` directly.
# network_mode: "host"
# volumes:
# - ../work/clash/config.yaml:/opt/clash/config/config.yaml
environment:
- PROXY_PROVIDER="https://subs.zeabur.app/clash"
2 changes: 1 addition & 1 deletion docker_app_clash/work/clash/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use: &use
proxy-providers:
proxy-provider-1:
<<: *p
url: https://your.subscription.com/should-be-filled-here
url: "PROXY_PROVIDER" # e.g.: https://your.subscription.com/should-be-filled-here


# ------------------------- rule provider config -------------------------
Expand Down
9 changes: 9 additions & 0 deletions docker_app_clash/work/clash/start-clash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /usr/bin/env bash
set -eux

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

echo "Setting PROXY_PROVIDER to: ${PROXY_PROVIDER}!"
sed -i -e "s|PROXY_PROVIDER|${PROXY_PROVIDER}|g" "${CLASH_CONFIG_PATH:-"/opt/clash/config/config.yaml"}"

exec /opt/clash/clash -d config $@
2 changes: 1 addition & 1 deletion docker_casdoor/demo/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
db-postgres-casdoor:
# su postgres && psql -d casdoor -U pg-casdoor-username
image: qpod/postgres-16:latest
image: docker.io/qpod/postgres-16:latest
container_name: db-postgres
environment:
POSTGRES_DB: casdoor
Expand Down
4 changes: 2 additions & 2 deletions docker_casdoor/demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
services:
db-postgres-casdoor:
# su postgres && psql -d casdoor -U pg-casdoor-username
image: qpod/postgres-16:latest
image: docker.io/qpod/postgres-16:latest
container_name: db-postgres
environment:
POSTGRES_DB: casdoor
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

svc-casdoor:
image: qpod/casdoor
image: docker.io/qpod/casdoor
container_name: svc-casdoor
# command: ["/bin/bash", "--login", "/opt/casdoor/server", "--createDatabase=true"]
command: |
Expand Down
4 changes: 2 additions & 2 deletions docker_keycloak/demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
services:
db-postgres:
# su postgres && psql -d keycloak -U pg-keycloak-username
image: postgres:15
image: docker.io/library/postgres:16
container_name: db-postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: pg-keycloak-username
POSTGRES_PASSWORD: pg-keycloak-password

svc-keycloak:
image: qpod/keycloak
image: docker.io/qpod/keycloak
# build:
# context: ../
# dockerfile: Dockerfile
Expand Down
11 changes: 7 additions & 4 deletions docker_searxng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

## Start standalone version with docker-compose

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

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

```bash
cd demo

# export SEARXNG_HOSTNAME="http://localhost:81"
docker-compose -f ./docker-compose.searxng-standalone.yml up -d
# export SEARXNG_HOSTNAME="http://localhost:8000"
# docker-compose -f ./docker-compose.searxng-standalone.yml up -d
docker-compose -f ./docker-compose.searxng-with-proxy.yml up -d
```

## Debug with Docker
Expand Down
51 changes: 51 additions & 0 deletions docker_searxng/demo/docker-compose.searxng-with-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
networks:
net-searxng:

services:
svc-searxng:
container_name: svc-searxng
hostname: svc-searxng
image: docker.io/qpod/searxng:latest
restart: unless-stopped
networks: ["net-searxng"]
ports:
- "8000:8000"
volumes:
- ./searxng/settings.yml:/etc/searxng/settings.yml:rw
# - ./searxng/limiter.toml:/etc/searxng/limiter.toml:rw
# - ./searxng/Caddyfile:/etc/searxng/Caddyfile:rw
# - ./searxng/supervisord.conf:/etc/searxng/supervisord.conf:rw
environment:
- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost:8000}/
- SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME:-http://localhost:8000}
- SEARXNG_TLS=${LETSENCRYPT_EMAIL:-internal}
- UWSGI_WORKERS=${SEARXNG_UWSGI_WORKERS:-4}
- UWSGI_THREADS=${SEARXNG_UWSGI_THREADS:-4}
# user: root
# command: ["/opt/searxng/start-supervisord.sh"]
# command: ["tail", "-f", "/dev/null"]
# cap_drop: ["ALL"]
# cap_add: ["AUDIT_WRITE", "CHOWN", "SETGID", "SETUID", "NET_BIND_SERVICE"]
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "1"

svc-clash:
image: docker.io/qpod/app-clash
container_name: svc-clash
hostname: svc-clash
restart: unless-stopped
pid: host
ipc: host
# When your system is Linux, you can use `network_mode: "host"` directly.
# network_mode: "host"
networks: ["net-searxng"]
ports:
- "7890:7890"
- "9090:9090"
# volumes:
# - ./clash/config.yaml:/opt/clash/config/config.yaml
environment:
- PROXY_PROVIDER="https://subs.zeabur.app/clash"
38 changes: 38 additions & 0 deletions docker_searxng/demo/searxng/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings
use_default_settings: true
server:
# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
secret_key: "ultrasecretkey" # change this!
limiter: false # can be disabled for a private instance, requires redis when enabled
image_proxy: true
ui:
static_use_hash: true
# redis:
# url: redis://redis:6379/0
search:
formats:
- html
- json
engines:
- name: bing
engine: bing
shortcut: bi
disabled: false
number_of_results: 1
- name: google
engine: google
shortcut: go
number_of_results: 1
- name: wikipedia
engine: wikipedia
shortcut: wp
number_of_results: 1
# add "list" to the array to get results in the results list
display_type: ["infobox"]
base_url: 'https://{language}.wikipedia.org/'
categories: [general]
outgoing:
proxies:
all://:
# need to make sure the containers of app-clash and searxng can communicate with each other
- http://app-clash:7890
Loading