add docker file, browser config and startapp

This commit is contained in:
aaron
2021-11-23 14:08:20 +01:00
commit e3b588bc80
5 changed files with 62 additions and 0 deletions

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
FROM jlesage/baseimage-gui:ubuntu-18.04
# Set environment variables
ENV TOR_VERSION=11.0.1
ENV APP_NAME="Tor Browser ${TOR_VERSION}" \
TOR_BINARY=https://www.torproject.org/dist/torbrowser/${TOR_VERSION}/tor-browser-linux64-${TOR_VERSION}_en-US.tar.xz \
TOR_SIGNATURE=https://www.torproject.org/dist/torbrowser/${TOR_VERSION}/tor-browser-linux64-${TOR_VERSION}_en-US.tar.xz.asc \
TOR_FINGERPRINT=0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290 \
DEBIAN_FRONTEND=noninteractive
# Add wget and Tor browser dependencies
RUN apt-get update && \
apt-get install -y wget curl gpg libdbus-glib-1-2 libgtk-3-0 && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Download binary and signature
RUN wget $TOR_BINARY && \
wget $TOR_SIGNATURE
# Verify GPG signature
RUN curl -s https://openpgpkey.torproject.org/.well-known/openpgpkey/torproject.org/hu/kounek7zrdx745qydx6p59t9mqjpuhdf | gpg --import - && \
gpg --output ./tor.keyring --export $TOR_FINGERPRINT && \
gpgv --keyring ./tor.keyring "${TOR_SIGNATURE##*/}" "${TOR_BINARY##*/}"
# Extract browser & cleanup
RUN tar --strip 1 -xvJf "${TOR_BINARY##*/}" && \
chown -R ${USER_ID}:${GROUP_ID} /app && \
rm "${TOR_BINARY##*/}" "${TOR_SIGNATURE##*/}"
# Copy browser cfg
COPY browser-cfg /browser-cfg
# Add start script
COPY startapp.sh /startapp.sh

1
browser-cfg/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
mozilla.cfg

View File

@@ -0,0 +1,3 @@
// Any comment. You must start the file with a single-line comment!
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);

View File

@@ -0,0 +1,3 @@
// Any comment. You must start the file with a comment!
lockPref("javascript.enabled", true);

18
startapp.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
echo "Configuring Tor browser"
cd /browser-cfg
if [ -f "mozilla.cfg" ]
then
echo "Copying browser config"
cp autoconfig.js /app/Browser/defaults/pref/autoconfig.js
cp mozilla.cfg /app/Browser/mozilla.cfg
fi
echo "Starting Tor browser"
cd /app
./Browser/start-tor-browser --detach https://waitingroom.interdiscount.ch/de/sbb-halbtax
echo "Tor browser exited"