aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-05-24 12:23:58 -0500
committerJesús <heckyel@hyperbola.info>2021-05-24 12:23:58 -0500
commit0d0db95b4645c53484bb63e1b901a5199470a5ad (patch)
tree31d1b379f5435ef6f0c1dddbc022f5f0e6b3c736 /core
parent8ba96c69db4af15169f81c14772e310ab6fcf887 (diff)
downloadyt-local-docker-0d0db95b4645c53484bb63e1b901a5199470a5ad.tar.lz
yt-local-docker-0d0db95b4645c53484bb63e1b901a5199470a5ad.tar.xz
yt-local-docker-0d0db95b4645c53484bb63e1b901a5199470a5ad.zip
Add support Tor
Diffstat (limited to 'core')
-rw-r--r--core/Dockerfile2
-rw-r--r--core/entrypoint.sh8
2 files changed, 9 insertions, 1 deletions
diff --git a/core/Dockerfile b/core/Dockerfile
index 9bbd2e6..71184c1 100644
--- a/core/Dockerfile
+++ b/core/Dockerfile
@@ -4,7 +4,7 @@ LABEL MAINTAINER="heckyel@riseup.net"
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
-RUN apk add musl-dev build-base gcc libffi-dev python3-dev patch git py3-pip
+RUN apk add musl-dev build-base gcc libffi-dev python3-dev patch git py3-pip tor
ARG APP_DIR="/srv/app"
ARG YT_REPO="https://git.sr.ht/~heckyel/yt-local"
diff --git a/core/entrypoint.sh b/core/entrypoint.sh
index ba37c18..ae762e8 100644
--- a/core/entrypoint.sh
+++ b/core/entrypoint.sh
@@ -77,4 +77,12 @@ settings_version = 3
EOF
fi
+if [ "$ROUTE_TOR" = 1 ] || [ "$ROUTE_TOR" = 2 ]; then
+ cat > /etc/torrc <<- EOF
+Log notice stdout
+SocksPort 0.0.0.0:9050
+EOF
+ tor -f /etc/torrc --runasdaemon 1
+fi
+
exec /usr/bin/python3 /srv/app/server.py