Add reload on config change

pull/9/head
Christophe Mehay 7 years ago
parent d05d649be4
commit 2bd4787a45

@ -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

@ -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

@ -15,4 +15,8 @@ post_conf_commands:
- onions
- chown -R tor:tor $HOME
reload:
files:
- /etc/torrc
debug: false

@ -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)

Loading…
Cancel
Save