Skip to content

Commit

Permalink
cl fix snowflake transport AND webtunnel transport support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgr0g committed Mar 12, 2024
1 parent 6bf96cb commit b2a4028
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ WORKDIR /builder/snowflake/client
RUN go mod download
RUN CGO_ENABLED=0 go build -o client -ldflags '-extldflags "-static" -w -s' .

# # # # # # # # # # # # # # # # # # # # # # # # # # # #
FROM golang:${golang_ver} as build-env-webtunnel
WORKDIR /builder
RUN git config --global advice.detachedHead false && \
git clone --depth=1 https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/webtunnel.git
WORKDIR /builder/webtunnel/main/client
RUN go mod download
RUN CGO_ENABLED=0 go build -o client -ldflags '-extldflags "-static" -w -s' .

# # # # # # # # # # # # # # # # # # # # # # # # # # # #
ARG UPGRADE=false

FROM alpine:${alpine_ver}
Expand Down Expand Up @@ -48,6 +58,7 @@ ARG RECONFIGURED=false
COPY setup /opt/

COPY --from=build-env-snowflake /builder/snowflake/client/client /opt/tor/snowflake
COPY --from=build-env-webtunnel /builder/webtunnel/main/client/client /opt/tor/webtunnel

EXPOSE 8888 9050 9051

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# VERSIONS ---------------------------------------------------------------------
IMG_VER=0.1.5
IMG_VER=0.2.0
IMG_NAME=mcgr0g/talpa-altaica
BUILD_DATE:=$(shell date '+%Y-%m-%d')

Expand Down Expand Up @@ -72,6 +72,7 @@ example:
run:
docker run --rm --name torproxy \
-e EXCLUDE_NODE={RU},{UA},{AM},{KG},{BY} \
-e BRIDGE="webtunnel 1.2.3.4:443 url=https://kek.lol/ololo ver=0.0.1" \
-p 127.0.0.1:8888:8888 \
-p 127.0.0.1:9050:9050 \
$(IMG_NAME):$(IMG_VER)
Expand Down
9 changes: 3 additions & 6 deletions setup/tor/run
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ then
sed -i 's/# \(StrictNodes\)/\1/' $TORRC
fi

# USE OWN SNOWFLAKE BRIDGE --------------------------------------------------------------------------------------------
update_line="Bridge snowflake 192.0.2.4:80 8838024498816A039FCBBAB14E6F40A0843051FA fingerprint=8838024498816A039FCBBAB14E6F40A0843051FA"
# # USE OWN WEBTUNEL BRIDGE --------------------------------------------------------------------------------------------
update_line="Bridge webtunnel 192.0.2.3:1 url=https://akbwadp9lc5fyyz0cj4d76z643pxgbfh6oyc-167-71-71-157.sslip.io/5m9yq0j4ghkz0fz7qmuw58cvbjon0ebnrsp0"

if [ -n "${BRIDGE}" ]
then
sed -i "s^$special_line^Bridge $BRIDGE^g" "$TORRC"
echo "Updated $TORRC with bridge value: $BRIDGE"
else
echo "No bridge value provided. Skipping update."
sed -i "s^$update_line^Bridge $BRIDGE^" $TORRC
fi

# NODE ROTATION -------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions setup/tor/torrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ExitRelay 0
# Change 'syslog' to 'stdout' to see more logging in the terminal.
Log notice stdout

# snowflake tansport
UseBridges 1

# see https://forum.torproject.org/t/fix-problems-with-snowflake-since-2024-03-01-broker-failure-unexpected-error-no-answer/11755

ClientTransportPlugin snowflake exec ./snowflake
Bridge snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.azureedge.net/ fronts=ajax.aspnetcdn.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
Bridge snowflake 192.0.2.4:80 8838024498816A039FCBBAB14E6F40A0843051FA fingerprint=8838024498816A039FCBBAB14E6F40A0843051FA url=https://snowflake-broker.azureedge.net/ fronts=ajax.aspnetcdn.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.net:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn

ClientTransportPlugin snowflake exec ./snowflake
ClientTransportPlugin webtunnel exec ./webtunnel
Bridge webtunnel 192.0.2.3:1 url=https://akbwadp9lc5fyyz0cj4d76z643pxgbfh6oyc-167-71-71-157.sslip.io/5m9yq0j4ghkz0fz7qmuw58cvbjon0ebnrsp0

# Are the exit nodes restricted to specific location?
# ExitNodes {US}
Expand Down

0 comments on commit b2a4028

Please sign in to comment.