diff --git a/Dockerfile b/Dockerfile index 244b382..46c21e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ ADD assets/torrc /var/local/tor/torrc.tpl RUN mkdir -p /etc/tor/ -RUN pip install pyentrypoint==0.3.8 +RUN pip install pyentrypoint==0.5.0 RUN cd /usr/local/src/onions && python3 setup.py install diff --git a/README.md b/README.md index a7dd744..67fe499 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,6 @@ Options are set using the following pattern: `LINKNAME_KEY` ### Setup port -__DEPECATED:__ -By default, ports are the same as linked containers, but a default port can be mapped using `PORT_MAP` environment variable. __Caution__: Using `PORT_MAP` with multiple ports on single service will cause `tor` to fail. @@ -78,6 +76,9 @@ environment: ``` +__DEPECATED:__ +By default, ports are the same as linked containers, but a default port can be mapped using `PORT_MAP` environment variable. + ### Compose v2 support Links setting are required when using docker-compose v2. See `docker-compose.v2.yml` for example. @@ -97,6 +98,12 @@ $ docker exec -ti torhiddenproxy_tor_1 onions --json {"hello": ["b2sflntvdne63amj.onion:80"], "world": ["vegm3d7q64gutl75.onion:80"]} ``` +### Auto reload + +Changing `/etc/torrc` file trigger a `SIGHUP` signal to `tor` to reload configuration. + +To disable this behavior, add `ENTRYPOINT_DISABLE_RELOAD` in environment. + ### pyentrypoint diff --git a/assets/entrypoint-config.yml b/assets/entrypoint-config.yml index b6c1884..688b040 100644 --- a/assets/entrypoint-config.yml +++ b/assets/entrypoint-config.yml @@ -15,4 +15,8 @@ post_conf_commands: - onions - chown -R tor:tor $HOME +reload: + files: + - /etc/torrc + debug: false diff --git a/assets/onions/onions/Onions.py b/assets/onions/onions/Onions.py index fa3c1d2..4f0c4f8 100644 --- a/assets/onions/onions/Onions.py +++ b/assets/onions/onions/Onions.py @@ -98,7 +98,6 @@ class Setup(object): with open(os.path.join(serv_dir, 'hostname'), 'w') as f: f.write(self.onion_url_gen(conf['key'])) - def _set_conf(self): env = Environment(loader=FileSystemLoader('/')) temp = env.get_template(self.torrc_template)