first commit

This commit is contained in:
ArcticLampyrid 2023-05-02 02:41:34 +08:00
commit 3777cb3fe6
No known key found for this signature in database
GPG key ID: DC72A2519E77D6CF
4 changed files with 50 additions and 0 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
* text=auto
* eol=lf

27
Dockerfile Normal file
View file

@ -0,0 +1,27 @@
FROM rust:latest AS builder
RUN apt update && apt install -y git
RUN update-ca-certificates
WORKDIR /tcp-relay-rust
RUN git clone https://github.com/cedric05/tcp-relay-rust . --no-checkout && git checkout 6de9bd191fa97aa73e8696ebefd5a50286eb2b25
RUN cargo build --release
FROM debian:bullseye-slim
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=builder /tcp-relay-rust/target/release/tcp-relay-rust /tcp-relay-rust
RUN apt update \
&& apt install -y curl gnupg \
&& curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ bullseye main" | tee /etc/apt/sources.list.d/cloudflare-client.list \
&& apt update \
&& apt install -y cloudflare-warp \
&& apt remove -y curl \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
ADD entrypoint.sh /entrypoint.sh
EXPOSE 40000/tcp
ENTRYPOINT ["/bin/bash"]
CMD ["/entrypoint.sh"]

6
README.md Normal file
View file

@ -0,0 +1,6 @@
# docker-warp-socks5
![Docker Pulls](https://img.shields.io/docker/pulls/qiqiworld/warp-socks5)
```bash
docker run -d -p 40000:40000 qiqiworld/warp-socks5
```

15
entrypoint.sh Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
(
while ! warp-cli --accept-tos register; do
sleep 1
>&2 echo "Awaiting warp-svc become online..."
done
warp-cli --accept-tos set-mode proxy
warp-cli --accept-tos set-proxy-port 40001
warp-cli --accept-tos connect
warp-cli --accept-tos enable-always-on
/tcp-relay-rust 127.0.0.1:40001 0.0.0.0:40000
) &
exec warp-svc