Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
haobibo committed Jun 22, 2024
1 parent fa233bf commit e989da2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
15 changes: 13 additions & 2 deletions docker_app_clash/clash.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
FROM qpod/go-stack AS builder
# Distributed under the terms of the Modified BSD License.

ARG BASE_NAMESPACE
ARG BASE_IMG_BUILD="go-stack"
ARG BASE_IMG="atom"


# Stage 1: build code, both backend and frontend
FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG_BUILD} as builder

COPY work/clash /opt/utils/

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

FROM qpod/atom

# Stage 2: runtime image, copy files from builder image
FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG}

COPY --from=builder /opt/clash /opt/clash
WORKDIR /opt/clash
RUN set -eux \
Expand Down
11 changes: 6 additions & 5 deletions docker_app_clash/work/clash/config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# ref: https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml

mixed-port: 57890
external-controller: :59090
allow-lan: true
bind-address: '*'
log-level: debug
mode: Rule

external-controller: 0.0.0.0:59090
external-ui: /opt/clash/ui
external-ui-name: xd
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

allow-lan: true
bind-address: '*'
log-level: debug
mode: Rule

rules:
- DOMAIN-SUFFIX,local,DIRECT
- IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
Expand Down
3 changes: 2 additions & 1 deletion docker_app_clash/work/clash/script-setup-clash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ setup_verge() {
&& echo "Downloading clash-verge version ${VER_VERGE} from: ${URL_VERGE}" \
&& install_tar_gz $URL_VERGE \
&& mv /opt/clash-verge-* /tmp/verge && cd /tmp/verge \
&& npm i && npm run web:build && ls -alh \
&& jq '.homepage = "./ui"' package.json > tmp.$$.json && mv tmp.$$.json package.json \
&& npx pnpm i && npx pnpm run web:build && ls -alh \
&& mv /tmp/verge/dist /opt/clash/ui
}

0 comments on commit e989da2

Please sign in to comment.