-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new jobs: ubuntu_lts_repo and ubuntu_rolling_sources
- Loading branch information
Showing
7 changed files
with
240 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build and push images | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
# every 1st day of every month | ||
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | ||
- cron: '0 0 1 * *' | ||
|
||
|
||
env: | ||
DOCKER_REGISTRY: magicxor | ||
DOCKER_IMAGE: tor-simple | ||
|
||
jobs: | ||
ubuntu_lts_repo: | ||
name: Ubuntu LTS repo tor version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- id: get_build_info | ||
run: | | ||
docker build . --file=ubuntu_lts_repo/VersionInfo.Dockerfile --progress=plain --no-cache -t tor-version-info | ||
package_versions=$(docker run --rm tor-version-info) | ||
echo "PACKAGE_VERSIONS=$package_versions" >> $GITHUB_OUTPUT | ||
echo "BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT | ||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# https://github.com/docker/build-push-action | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: ubuntu_lts_repo/. | ||
no-cache: true | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:latest | ||
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ steps.get_build_info.outputs.PACKAGE_VERSIONS }} | ||
platforms: | | ||
linux/amd64 | ||
linux/arm/v7 | ||
linux/arm64/v8 | ||
build-args: | | ||
VERSION=${{ steps.get_build_info.outputs.PACKAGE_VERSIONS }} | ||
VCS_REF=${{ github.sha }} | ||
BUILD_DATE=${{ steps.get_build_info.outputs.BUILD_DATE }} | ||
BUILD_PLATFORM=${{ runner.os }}/${{ runner.arch }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ubuntu:latest | ||
|
||
ARG BUILD_PLATFORM | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VERSION | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl tor tor-geoipdb obfs4proxy && \ | ||
tor_version=$(apt-cache madison tor | awk '{print $3; exit}') && \ | ||
obfs4proxy_version=$(apt-cache madison obfs4proxy | awk '{print $3; exit}') && \ | ||
ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ | ||
actualVersion="ubuntu_lts_${ubuntu_version}_tor_${tor_version}_obfs4proxy_${obfs4proxy_version}" && \ | ||
if [ "$actualVersion" != "$VERSION" ]; then echo "Version mismatch: expected $VERSION, got $actualVersion" && exit 1; fi | ||
|
||
EXPOSE 9050 | ||
|
||
HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ | ||
CMD curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations | ||
|
||
VOLUME ["/var/lib/tor"] | ||
CMD ["tor"] |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
FROM ubuntu:rolling | ||
|
||
ARG BUILD_PLATFORM | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VERSION | ||
|
||
# see https://git.torproject.org/ | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y golang git build-essential automake libevent-dev libssl-dev zlib1g-dev && \ | ||
echo go version && \ | ||
mkdir -p ~/git && \ | ||
# build tor | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/core/tor.git && \ | ||
cd ~/git/tor && \ | ||
git fetch --tags && \ | ||
torLatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ | ||
git checkout $torLatestTag && \ | ||
./autogen.sh && \ | ||
./configure --disable-asciidoc && \ | ||
make && \ | ||
make install && \ | ||
# build webtunnel | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/webtunnel.git && \ | ||
cd ~/git/webtunnel/main/client && \ | ||
webtunnelCommitHash=$(git rev-parse --short HEAD) && \ | ||
go get && \ | ||
go build && \ | ||
cp client /usr/bin/webtunnel && \ | ||
chmod +x /usr/bin/webtunnel && \ | ||
# build snowflake | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git && \ | ||
cd ~/git/snowflake/client && \ | ||
snowflakeCommitHash=$(git rev-parse --short HEAD) && \ | ||
go get && \ | ||
go build && \ | ||
cp client /usr/bin/snowflake && \ | ||
chmod +x /usr/bin/snowflake && \ | ||
# build obfs4proxy | ||
cd ~/git && \ | ||
git clone https://gitlab.com/yawning/obfs4.git && \ | ||
cd ~/git/obfs4 && \ | ||
git fetch --tags && \ | ||
obfs4LatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ | ||
git checkout $obfs4LatestTag && \ | ||
cd ~/git/obfs4/obfs4proxy && \ | ||
go get && \ | ||
go build && \ | ||
cp obfs4proxy /usr/bin/obfs4proxy && \ | ||
chmod +x /usr/bin/obfs4proxy && \ | ||
# cleanup | ||
apt-get remove -y golang git build-essential automake libevent-dev libssl-dev zlib1g-dev && \ | ||
apt-get autoremove -y && \ | ||
apt-get install -y libc6 libcap2 libevent-dev liblzma5 libseccomp2 libssl3 libsystemd0 libzstd1 zlib1g adduser lsb-base && \ | ||
rm -rf ~/git && \ | ||
# check versions | ||
ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ | ||
torLatestTag=$(echo $torLatestTag | sed 's/.*-//') && \ | ||
obfs4LatestTag=$(echo $obfs4LatestTag | sed 's/.*-//') && \ | ||
actualVersion="ubuntu_rolling_${ubuntu_version}_tor_${torLatestTag}_obfs4proxy_${obfs4LatestTag}_webtunnel_${webtunnelCommitHash}_snowflake_${snowflakeCommitHash}" && \ | ||
if [ "$actualVersion" != "$VERSION" ]; then echo "Version mismatch: expected $VERSION, got $actualVersion" && exit 1; fi | ||
|
||
EXPOSE 9050 | ||
|
||
HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ | ||
CMD curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations | ||
|
||
VOLUME ["/var/lib/tor"] | ||
CMD ["tor"] |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:rolling | ||
|
||
# see https://git.torproject.org/ | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y git && \ | ||
mkdir -p ~/git && \ | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/core/tor.git && \ | ||
cd ~/git/tor && \ | ||
git fetch --tags && \ | ||
torLatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/webtunnel.git && \ | ||
cd ~/git/webtunnel/main/client && \ | ||
webtunnelCommitHash=$(git rev-parse --short HEAD) && \ | ||
cd ~/git && \ | ||
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git && \ | ||
cd ~/git/snowflake/ && \ | ||
snowflakeCommitHash=$(git rev-parse --short HEAD) && \ | ||
cd ~/git && \ | ||
git clone https://gitlab.com/yawning/obfs4.git && \ | ||
cd ~/git/obfs4 && \ | ||
git fetch --tags && \ | ||
obfs4LatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ | ||
ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ | ||
torLatestTag=$(echo $torLatestTag | sed 's/.*-//') && \ | ||
obfs4LatestTag=$(echo $obfs4LatestTag | sed 's/.*-//') && \ | ||
echo "ubuntu_rolling_${ubuntu_version}_tor_${torLatestTag}_obfs4proxy_${obfs4LatestTag}_webtunnel_${webtunnelCommitHash}_snowflake_${snowflakeCommitHash}" > /version.txt | ||
|
||
CMD cat /version.txt |