Initial qrencode support

This commit is contained in:
Samuel Huang
2024-04-02 22:38:25 +11:00
parent f654cbc5c2
commit 84b2cc1ed0
2 changed files with 15 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
FROM golang:1.22-alpine3.19 as builder FROM golang:1.22-alpine3.19 as builder
ARG XRAYVER='v1.8.9' ARG XRAY_VER='v1.8.9'
ARG QREC_VER='4.1.1'
RUN apk add --no-cache bash git build-base wget RUN apk add --no-cache bash git build-base wget
@@ -12,13 +13,20 @@ RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsm
RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf
RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf
RUN cd /tmp; wget -c -t3 -T30 https://fukuchi.org/works/qrencode/qrencode-${QREC_VER}.tar.gz && \
tar xvf qrencode-${QREC_VER}.tar.gz && \
cd qrencode-${QREC_VER} && \
./configure --without-png && \
make && \
cp -a qrencode /tmp/
WORKDIR /go/src/XTLS/Xray-core WORKDIR /go/src/XTLS/Xray-core
RUN git clone https://github.com/XTLS/Xray-core.git . && \ RUN git clone https://github.com/XTLS/Xray-core.git . && \
git checkout ${XRAYVER} && \ git checkout ${XRAY_VER} && \
go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
FROM alpine:3.16 FROM alpine:3.19
COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/ COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/
COPY --from=builder /tmp/geosite.dat /usr/local/bin/ COPY --from=builder /tmp/geosite.dat /usr/local/bin/
@@ -31,9 +39,10 @@ COPY --from=builder /tmp/google.china.conf /etc/dnsmasq.disable/
COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq.disable/ COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq.disable/
COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq.disable/ COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq.disable/
COPY --from=builder /tmp/qrencode /usr/local/bin/
RUN apk --no-cache add bash openssl curl jq moreutils \ RUN apk --no-cache add bash openssl curl jq moreutils \
whois dnsmasq ca-certificates proxychains-ng npm whois dnsmasq ca-certificates proxychains-ng
RUN npm install -g qrcode-terminal --verbose
RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf

View File

@@ -71,7 +71,7 @@ esac
echo "VPS-Server: ${XHOST}" echo "VPS-Server: ${XHOST}"
echo "Xray-URL: ${XURL}" echo "Xray-URL: ${XURL}"
qrcode-terminal "${XURL}" qrencode -m 2 -t ANSIUTF8 "${XURL}"
exit 0 exit 0