Commit 68a8581f authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Create probetest docker image

parent 4d9003c8
SITENAME=local
docker/bridge_lines.txt
stun-test/stun-test
# First, you need to create a configuration file, ".env", in the same directory
# as this file, "docker-compose.yml". Add the following environment variables
# to this configuration file.
#
#SITENAME=unique id
#
version: "3.9"
services:
probetest:
network_mode: host
image: thetorproject/probetest:latest
container_name: probe
environment:
# Exit with an error message if OR_PORT is unset or empty.
- SITENAME=${SITENAME:?Env var SITENAME is not set.}
restart: unless-stopped
volumes:
- .:/bridgetest/log
entrypoint: ["cron", "-f"]
FROM debian:buster-slim
#install python
RUN apt-get update && apt-get install -y git wget tcpdump \
python3 python3-stem tor obfs4proxy
#install Go
RUN wget https://golang.org/dl/go1.15.14.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.15.14.linux-amd64.tar.gz && \
rm go1.15.14.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
#install snowflake
RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git \
&& cd snowflake/client && go get -d && go build && cp client /usr/bin/snowflake
RUN git clone https://github.com/cohosh/bridgetest.git && \
cd bridgetest/stun-test && go get -d && go build
COPY bridge_lines.txt /bridgetest/
RUN crontab /bridgetest/docker/probe-crontab
IMAGE=thetorproject/probetest
.PHONY: tag
tag:
@[ "${VERSION}" ] || ( echo "Env var VERSION is not set."; exit 1 )
docker tag $(IMAGE) $(IMAGE):$(VERSION)
docker tag $(IMAGE) $(IMAGE):latest
.PHONY: release
release:
@[ "${VERSION}" ] || ( echo "Env var VERSION is not set."; exit 1 )
docker push $(IMAGE):$(VERSION)
docker push $(IMAGE):latest
.PHONY: build
build:
docker build -t $(IMAGE) . --no-cache
.PHONY: deploy
deploy:
docker-compose up -d snowflake-proxy
# Probetest docker image
This repository contains the docker files for our probe test
## Releasing a new image
First, build the image:
```
make build
```
Note: make sure that there is a file called `bridge_lines.txt` in the `docker/` directory. This will bake obfs4 bridge lines into the probe test image.
Next, release a new version by adding a tag:
make tag VERSION=X.Y
Finally, release the image:
make release VERSION=X.Y
Once we released a new image version, we tag the respective git commit:
git tag -a -s "vVERSION" -m "Docker image version VERSION."
git push --tags origin main
0 */6 * * * cd /bridgetest && ./probetest.sh snowflake $SITENAME
0 2-23/6 * * * cd /bridgetest && ./probetest.sh obfs4 $SITENAME
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment