-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tor version 0.4.8.8 & minor fixes (#7)
* fix: docker not liking parm, args, path for quick, hard coded path * add: env HOME * update: make consistent, better structure, gh actions, obfs4 is lyrebird, had to bump version, docs
- Loading branch information
Showing
7 changed files
with
79 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
ARG TARGETOS TARGETARCH | ||
|
||
# Clone the obfs4 repo | ||
FROM --platform=$BUILDPLATFORM golang:1.17-alpine as git | ||
# Build the obfs4 binary (cross-compiling) | ||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as obfs-builder | ||
ARG OBFS_VERSION="obfs4proxy-0.0.14-tor2" | ||
|
||
RUN apk add git | ||
RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4.git --depth 1 --branch $OBFS_VERSION /obfs | ||
RUN apk add --update --no-cache git && \ | ||
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git --depth 1 --branch "${OBFS_VERSION}" /obfs | ||
|
||
# Build the obfs4 binary | ||
FROM --platform=$BUILDPLATFORM golang:1.17-alpine as builder | ||
RUN echo 'nobody:x:65534:65534:Nobody:/:' > /tmp/passwd | ||
|
||
# Build | ||
# Build obfs | ||
RUN mkdir /out | ||
WORKDIR /obfs | ||
RUN --mount=target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
ARG TARGETOS TARGETARCH | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg \ | ||
--mount=type=bind,from=git,source=/obfs,target=/obfs \ | ||
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-s -w" -o /out/obfs4proxy ./obfs4proxy | ||
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/obfs4proxy ./obfs4proxy && \ | ||
echo 'user:x:1001:1001:user:/:' > /tmp/passwd | ||
|
||
FROM scratch | ||
USER nobody | ||
COPY --from=builder /tmp/passwd /etc/passwd | ||
COPY --from=builder /out/obfs4proxy / | ||
USER 1001 | ||
COPY --from=obfs-builder /tmp/passwd /etc/passwd | ||
COPY --from=obfs-builder /out/obfs4proxy / | ||
ENTRYPOINT ["/obfs4proxy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters