Skip to content

Commit

Permalink
Initial qrencode support
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelhbne committed Apr 2, 2024
1 parent f654cbc commit 84b2cc1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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

Expand All @@ -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/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
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


FROM alpine:3.16
FROM alpine:3.19

COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/
COPY --from=builder /tmp/geosite.dat /usr/local/bin/
Expand All @@ -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/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 \
whois dnsmasq ca-certificates proxychains-ng npm
RUN npm install -g qrcode-terminal --verbose
whois dnsmasq ca-certificates proxychains-ng

RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf

Expand Down
2 changes: 1 addition & 1 deletion status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ esac

echo "VPS-Server: ${XHOST}"
echo "Xray-URL: ${XURL}"
qrcode-terminal "${XURL}"
qrencode -m 2 -t ANSIUTF8 "${XURL}"
exit 0


Expand Down

0 comments on commit 84b2cc1

Please sign in to comment.