ralphwetzel / theonionbox

Dashboard to monitor Tor node operations
MIT License
122 stars 17 forks source link

persistance_dir in config ignored #73

Closed jangrewe closed 4 years ago

jangrewe commented 4 years ago

I just updated and had a bit of an issue to get TOB running again (eventually i discovered that i need to put box at the end - i think?). My main problem now is that the persistance_dir option seems to be ignored, while it was working fine before. The changed port from the config is used!

Here's my short config:

[TheOnionBox]
port = 9048
message_level = WARNING
persistance_dir = /opt/theonionbox

On startup it says:

        00:50:13.192 The Onion Box: Dashboard to monitor Tor node operations.
        00:50:13.193 Version 20.1 (stamp 20200105|230447)
        00:50:13.193 Running on a Linux host.
        00:50:13.193 Running with permissions of user 'root'.
        00:50:13.193 This seems to be a Python VirtualEnv.
        00:50:13.193 Python version is 3.7.3 (/opt/theonionbox/.venv/bin/python3).
        00:50:13.195 Persistance data will be written to '/tmp/.theonionbox.root'.
        00:50:14.060 Ready to listen on http://0.0.0.0:9048/
        00:50:14.060 Press Ctrl-C to quit!

And indeed, it writes to /tmp/.theonionbox.debian-tor instead of /opt/theonionbox/.theonionbox.debian-tor, like it did before.

ralphwetzel commented 4 years ago

I have to confirm that this is a bug in the current implementation, affecting the following parameters if defined via the config file:

[TheOnionBox]
ntp_server = ...
geoip2_city = ...
persistance_dir = ...

[Tor]
auth_cookie = ...
password = ...

For the time being I propose to provide those parameters as command line options:

theonionbox -c [path to your configfile] box --persistance_dir /opt/theonionbox/

The command line interface provides a verbose help, a fact that didn't make it into the documentation so far:

theonionbox --help
theonionbox box --help
jangrewe commented 4 years ago

Thanks, i'll use that until it's fixed. :-)

ralphwetzel commented 4 years ago

v20.2 should fix this.

jangrewe commented 4 years ago

Seems to be working now, thanks!