mirror of
https://github.com/cmehay/docker-tor-hidden-service.git
synced 2025-04-22 14:59:12 +00:00
Parse multiple ports from environment
This commit is contained in:
parent
f5b25abd3c
commit
3843fe5bd3
5 changed files with 17 additions and 11 deletions
|
@ -2,11 +2,11 @@ FROM alpine
|
||||||
|
|
||||||
ENV HOME /var/lib/tor
|
ENV HOME /var/lib/tor
|
||||||
|
|
||||||
RUN apk add --no-cache git libevent-dev openssl-dev gcc make automake ca-certificates autoconf musl-dev && \
|
RUN apk add --no-cache git libevent-dev openssl-dev gcc make automake ca-certificates autoconf musl-dev coreutils && \
|
||||||
mkdir -p /usr/local/src/ && \
|
mkdir -p /usr/local/src/ && \
|
||||||
git clone https://git.torproject.org/tor.git /usr/local/src/tor && \
|
git clone https://git.torproject.org/tor.git /usr/local/src/tor && \
|
||||||
cd /usr/local/src/tor && \
|
cd /usr/local/src/tor && \
|
||||||
git checkout $(git tag | tail -1) && \
|
git checkout $(git branch -a | grep 'release' | sort -V | tail -1) && \
|
||||||
./autogen.sh && \
|
./autogen.sh && \
|
||||||
./configure \
|
./configure \
|
||||||
--disable-asciidoc \
|
--disable-asciidoc \
|
||||||
|
@ -19,7 +19,7 @@ RUN apk add --no-cache git libevent-dev openssl-dev gcc make automake ca-cer
|
||||||
python3 -m ensurepip && \
|
python3 -m ensurepip && \
|
||||||
rm -r /usr/lib/python*/ensurepip && \
|
rm -r /usr/lib/python*/ensurepip && \
|
||||||
pip3 install --upgrade pip setuptools pycrypto && \
|
pip3 install --upgrade pip setuptools pycrypto && \
|
||||||
apk del git libevent-dev openssl-dev make automake python3-dev gcc autoconf musl-dev && \
|
apk del git libevent-dev openssl-dev make automake python3-dev gcc autoconf musl-dev coreutils && \
|
||||||
apk add --no-cache libevent openssl
|
apk add --no-cache libevent openssl
|
||||||
|
|
||||||
ADD assets/entrypoint-config.yml /
|
ADD assets/entrypoint-config.yml /
|
||||||
|
|
|
@ -72,7 +72,8 @@ environment:
|
||||||
# Set mapping ports
|
# Set mapping ports
|
||||||
HELLO_PORTS: 80:80
|
HELLO_PORTS: 80:80
|
||||||
|
|
||||||
WORLD_PORTS: 8000:80
|
# Multiple ports can be coma separated
|
||||||
|
WORLD_PORTS: 8000:80,8888:80,22:22
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,6 @@ post_conf_commands:
|
||||||
|
|
||||||
reload:
|
reload:
|
||||||
files:
|
files:
|
||||||
- /etc/torrc
|
- /etc/tor/torrc
|
||||||
|
|
||||||
debug: false
|
debug: false
|
||||||
|
|
|
@ -45,7 +45,8 @@ class Setup(object):
|
||||||
self._add_host(host)
|
self._add_host(host)
|
||||||
if 'ports' not in self.setup[host]:
|
if 'ports' not in self.setup[host]:
|
||||||
self.setup[host]['ports'] = []
|
self.setup[host]['ports'] = []
|
||||||
port = [int(p) for p in ports.split(':')]
|
ports_l = [[int(v) for v in sp.split(':')] for sp in ports.split(',')]
|
||||||
|
for port in ports_l:
|
||||||
assert len(port) == 2
|
assert len(port) == 2
|
||||||
if port not in self.setup[host]['ports']:
|
if port not in self.setup[host]['ports']:
|
||||||
self.setup[host]['ports'].append(port)
|
self.setup[host]['ports'].append(port)
|
||||||
|
|
|
@ -11,7 +11,7 @@ services:
|
||||||
- world
|
- world
|
||||||
environment:
|
environment:
|
||||||
# Set mapping ports
|
# Set mapping ports
|
||||||
HELLO_PORTS: 80:80
|
HELLO_PORTS: 80:80,800:80,8888:80
|
||||||
# Set private key
|
# Set private key
|
||||||
HELLO_KEY: |
|
HELLO_KEY: |
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
@ -34,7 +34,7 @@ services:
|
||||||
|
|
||||||
# Keep keys in volumes
|
# Keep keys in volumes
|
||||||
volumes:
|
volumes:
|
||||||
- ./keys:/var/lib/tor/hidden_service/
|
- tor-keys:/var/lib/tor/hidden_service/
|
||||||
|
|
||||||
hello:
|
hello:
|
||||||
image: tutum/hello-world
|
image: tutum/hello-world
|
||||||
|
@ -43,3 +43,7 @@ services:
|
||||||
world:
|
world:
|
||||||
image: tutum/hello-world
|
image: tutum/hello-world
|
||||||
hostname: world
|
hostname: world
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
tor-keys:
|
||||||
|
driver: local
|
||||||
|
|
Loading…
Add table
Reference in a new issue