ソースを参照

single onion service $VIRTUAL_PORT -> $TARGET

Fabian Peter Hammerle 5 年 前
コミット
33cde65440
2 ファイル変更25 行追加0 行削除
  1. 16 0
      Dockerfile
  2. 9 0
      torrc.template

+ 16 - 0
Dockerfile

@@ -0,0 +1,16 @@
+FROM alpine:3.8
+
+RUN apk add --no-cache tor
+
+RUN adduser -S onion
+RUN mkdir -m u=rwx,g=,o= /onion-service && chown onion /onion-service
+VOLUME /onion-service
+
+COPY --chown=onion:nobody torrc.template /
+
+USER onion
+
+ENV VIRTUAL_PORT 80
+ENV TARGET 127.0.0.1:8080
+CMD sed -e "s#{virtual_port}#$VIRTUAL_PORT#" -e "s#{target}#$TARGET#" /torrc.template >/tmp/torrc \
+    && tor -f /tmp/torrc

+ 9 - 0
torrc.template

@@ -0,0 +1,9 @@
+Log notice stdout
+
+# disable socks proxy
+SOCKSPort 0
+
+# https://www.torproject.org/docs/tor-onion-service
+HiddenServiceDir /onion-service
+# consider HiddenServiceVersion 3
+HiddenServicePort {virtual_port} {target}