mirror of
https://github.com/cmehay/docker-tor-hidden-service.git
synced 2025-05-31 20:02:15 +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
|
@ -17,6 +17,6 @@ post_conf_commands:
|
|||
|
||||
reload:
|
||||
files:
|
||||
- /etc/torrc
|
||||
- /etc/tor/torrc
|
||||
|
||||
debug: false
|
||||
|
|
|
@ -45,10 +45,11 @@ class Setup(object):
|
|||
self._add_host(host)
|
||||
if 'ports' not in self.setup[host]:
|
||||
self.setup[host]['ports'] = []
|
||||
port = [int(p) for p in ports.split(':')]
|
||||
assert len(port) == 2
|
||||
if port not in self.setup[host]['ports']:
|
||||
self.setup[host]['ports'].append(port)
|
||||
ports_l = [[int(v) for v in sp.split(':')] for sp in ports.split(',')]
|
||||
for port in ports_l:
|
||||
assert len(port) == 2
|
||||
if port not in self.setup[host]['ports']:
|
||||
self.setup[host]['ports'].append(port)
|
||||
|
||||
def _get_ip(self):
|
||||
for host in self.setup:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue