diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fc2194a5..d2c2629a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v2.1.0 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 + uses: docker/setup-buildx-action@v2 - name: Log in to GitHub Container Registry - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} @@ -27,15 +27,15 @@ jobs: - name: Docker meta id: meta - uses: docker/metadata-action@v4.4.0 + uses: docker/metadata-action@v4 with: images: ghcr.io/${{ github.repository }} - name: Build and push Docker image - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@v4 with: context: . push: ${{ github.event_name != 'pull_request' }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64, linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 676ea92c..be21bd15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ # Use the official Golang image as the base image -FROM golang:1.20 as builder - -ARG TARGETARCH -ARG TARGETOS - +FROM --platform=$BUILDPLATFORM golang:1.20 as builder +ARG TARGETOS TARGETARCH # Set up the working directory WORKDIR /app @@ -14,19 +11,24 @@ RUN go mod download # Copy the source code COPY . . + +RUN if [ "$TARGETARCH" = "arm64" ]; then apt update && apt install gcc-aarch64-linux-gnu -y; fi + # Build the X-ui binary -RUN CGO_ENABLED=1 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o xui-release-${TARGETARCH} -v main.go +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -o xui-release -v main.go; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o xui-release -v main.go; \ + fi # Start a new stage using the base image FROM ubuntu:20.04 -ARG TARGETARCH - # Set up the working directory WORKDIR /app # Copy the X-ui binary and required files from the builder stage -COPY --from=builder /app/xui-release-${TARGETARCH} /app/x-ui/xui-release +COPY --from=builder /app/xui-release /app/x-ui/xui-release COPY x-ui.service /app/x-ui/x-ui.service COPY x-ui.sh /app/x-ui/x-ui.sh @@ -34,21 +36,34 @@ COPY x-ui.sh /app/x-ui/x-ui.sh RUN apt-get update && apt-get install -y \ wget \ unzip \ + tzdata \ + ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app/x-ui/bin # Download and set up the required files -RUN wget https://github.com/mhsanaei/Xray-core/releases/latest/download/Xray-linux-64.zip \ - && unzip Xray-linux-64.zip \ - && rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat \ - && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat \ - && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \ - && wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat \ - && mv xray xray-linux-\${TARGETARCH} +RUN arch=$(uname -m) && \ + if [ "$arch" = "aarch64" ]; then \ + wget https://github.com/mhsanaei/xray-core/releases/latest/download/Xray-linux-arm64-v8a.zip \ + && unzip Xray-linux-arm64-v8a.zip \ + && rm -f Xray-linux-arm64-v8a.zip geoip.dat geosite.dat iran.dat \ + && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat \ + && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \ + && wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat \ + && mv xray xray-linux-arm64; \ + elif [ "$arch" = "x86_64" ]; then \ + wget https://github.com/mhsanaei/Xray-core/releases/latest/download/Xray-linux-64.zip \ + && unzip Xray-linux-64.zip \ + && rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat \ + && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat \ + && wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \ + && wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat \ + && mv xray xray-linux-amd64; \ + fi -WORKDIR /app +WORKDIR /app/x-ui RUN chmod +x /app/x-ui/x-ui.sh # Set the entrypoint -ENTRYPOINT ["/app/x-ui/x-ui.sh"] +ENTRYPOINT ["/app/x-ui/xui-release"] diff --git a/web/assets/ant-design-vue@1.7.2/antd.min.css b/web/assets/ant-design-vue@1.7.2/antd.min.css index 5f731c06..213bcf69 100644 --- a/web/assets/ant-design-vue@1.7.2/antd.min.css +++ b/web/assets/ant-design-vue@1.7.2/antd.min.css @@ -3532,9 +3532,6 @@ to{max-height:0;padding:0;opacity:0} .ant-modal-close{position:absolute;top:0;right:0;z-index:10;padding:0;color:rgba(0,0,0,.45);font-weight:700;line-height:1;text-decoration:none;background:0 0;border:0;outline:0;cursor:pointer;transition:color .3s} .ant-modal-close-x{display:block;width:56px;height:56px;font-size:16px;font-style:normal;line-height:56px;text-align:center;text-transform:none;text-rendering:auto} .ant-modal-close:focus,.ant-modal-close:hover{color:rgba(0,0,0,.75);text-decoration:none} -.ant-modal-header{padding:16px 24px;color:rgba(0,0,0,.65);background:#fff;border-bottom:1px solid rgba(100, 100, 100, 0.2);border-radius:4px 4px 0 0} -.ant-modal-body{padding:24px;font-size:14px;line-height:1.5;word-wrap:break-word} -.ant-modal-footer{padding:10px 16px;text-align:right;background:0 0;border-top:1px solid rgba(100, 100, 100, 0.2);border-radius:0 0 4px 4px} .ant-modal-footer button+button{margin-bottom:0;margin-left:8px} .ant-modal.zoom-appear,.ant-modal.zoom-enter{transform:none;opacity:0;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} .ant-modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;height:100%;background-color:rgba(0,0,0,.45);filter:alpha(opacity=50)} diff --git a/web/assets/css/custom.css b/web/assets/css/custom.css index 718e87f8..462cace1 100644 --- a/web/assets/css/custom.css +++ b/web/assets/css/custom.css @@ -269,15 +269,13 @@ .ant-dropdown-menu-dark, .ant-card-dark .ant-modal-content { - border:1px solid rgb(100 100 100 / 20%); - box-shadow: 0 2px 8px rgba(255,255,255,.15); } .ant-card-dark .ant-modal-content, .ant-card-dark .ant-modal-body, .ant-card-dark .ant-modal-header { color: hsla(0,0%,100%,.65); - background-color: #222a37; + background-color: #1a212a; } .ant-card-dark .ant-calendar-selected-day .ant-calendar-date {