79 lines
2.5 KiB
Docker
79 lines
2.5 KiB
Docker
FROM ubuntu:24.04
|
|
|
|
# Default directory
|
|
WORKDIR /home/user
|
|
COPY setup_files/* /home/user/build/
|
|
RUN sed -i 's@HOMEDIR@/home/user@g' /home/user/build/config.toml
|
|
|
|
RUN apt update -y
|
|
RUN apt install -y git cargo golang make openssl libssl-dev
|
|
|
|
RUN mkdir -p /home/user/build /home/user/rdsys /home/user/lox-distributor /home/user/troll-patrol /home/user/simulation
|
|
|
|
# Clone all our projects
|
|
|
|
# rdsys
|
|
WORKDIR /home/user/build
|
|
RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/rdsys.git
|
|
WORKDIR /home/user/build/rdsys
|
|
RUN git checkout 79332a3ee69dc6022a2a29fd8b79e9d2e4f5c9ab
|
|
RUN sed -i 's/NUM_BRIDGES = 1000/NUM_BRIDGES = 3600/' scripts/mkdescriptors/main.go
|
|
# configure rdsys to give Lox all the bridges
|
|
RUN cp /home/user/build/config.json conf/
|
|
|
|
# Lox distributor
|
|
WORKDIR /home/user/build
|
|
RUN git clone https://gitlab.torproject.org/vecna/lox.git
|
|
WORKDIR /home/user/build/lox
|
|
RUN git checkout 7b524e771ec444e07fff5b679c8c9e9b557829a0
|
|
RUN mkdir -p .cargo
|
|
RUN cp /home/user/build/config.toml .cargo/
|
|
|
|
# lox_cli
|
|
WORKDIR /home/user/build
|
|
RUN git clone https://git-crysp.uwaterloo.ca/vvecna/lox_cli.git
|
|
WORKDIR /home/user/build/lox_cli
|
|
RUN git checkout d7beaad5601ad309fd5936c19e60a7ea98a05fde
|
|
RUN mkdir -p .cargo
|
|
RUN cp /home/user/build/config.toml .cargo/
|
|
|
|
# Troll Patrol
|
|
WORKDIR /home/user/build
|
|
RUN git clone https://git-crysp.uwaterloo.ca/vvecna/troll-patrol.git
|
|
WORKDIR /home/user/build/troll-patrol
|
|
RUN git checkout dc7531689c2a5ec5b4c757f95a87f576c4d4020c
|
|
RUN mkdir -p .cargo
|
|
RUN cp /home/user/build/config.toml .cargo/
|
|
|
|
# Lox Simulation
|
|
WORKDIR /home/user/build/lox-simulation
|
|
COPY Cargo.toml /home/user/build/lox-simulation/
|
|
RUN mkdir src
|
|
COPY src/* /home/user/build/lox-simulation/src/
|
|
RUN mkdir -p .cargo
|
|
RUN cp /home/user/build/config.toml .cargo/
|
|
|
|
# Build all the software
|
|
|
|
# Build rdsys and bridge lines
|
|
WORKDIR /home/user/build/rdsys
|
|
RUN make build && make descriptors
|
|
RUN cp -r backend conf descriptors /home/user/rdsys/
|
|
|
|
# Build Lox distributor
|
|
WORKDIR /home/user/build/lox/crates/lox-distributor
|
|
RUN cargo update && cargo build --release
|
|
RUN cp config.json /home/user/build/lox/target/release/lox-distributor /home/user/lox-distributor/
|
|
|
|
# Build Troll Patrol
|
|
WORKDIR /home/user/build/troll-patrol
|
|
RUN cargo update && cargo build --release --features simulation
|
|
RUN cp target/release/troll-patrol /home/user/troll-patrol/
|
|
|
|
# Build simulation
|
|
WORKDIR /home/user/build/lox-simulation
|
|
RUN cargo update && cargo build --release
|
|
RUN cp target/release/lox-simulation /home/user/simulation/simulation
|
|
|
|
WORKDIR /home/user
|