OPNsense Forum

English Forums => Documentation and Translation => Topic started by: ChrisC on January 01, 2022, 02:05:36 AM

Title: How do I get the tor Control Port Password?
Post by: ChrisC on January 01, 2022, 02:05:36 AM
At https://docs.opnsense.org/manual/how-tos/tor.html (https://docs.opnsense.org/manual/how-tos/tor.html), it says "... This Port requires a password, which will not be disclosed to the GUI but can be queried via the API." with no further explanation.
How do I find this out?
I can't set one myself as the file /usr/local/etc/tor/torrc gets overwritten every time it restarts :(
Title: Re: How do I get the tor Control Port Password?
Post by: fabian on January 01, 2022, 11:38:08 AM
The UI loads the API so you can see it in the traffic. It is alsy in the config.xml
Title: Re: How do I get the tor Control Port Password?
Post by: ChrisC on January 01, 2022, 06:25:03 PM
Thank you.
I found it at "<control_port_password>" in the config.xml you mentioned.
Is there a way of adding other commands into torrc?
I want to use nyx (https://nyx.torproject.org), and to get the connection information, and for that to work, I need to add
DisableDebuggerAttachment 0 to the torrc file. How can I do this without it being overwritten each time tor starts?

Thanks,
Title: Re: How do I get the tor Control Port Password?
Post by: fabian on January 01, 2022, 06:59:15 PM
No, you cannot add custom options via the GUI
Title: Re: How do I get the tor Control Port Password?
Post by: mrpsycho on April 28, 2022, 09:31:07 PM
@chrisC as a VERY DIRTY solution you can add strrings to /usr/local/opnsense/service/templates/OPNsense/Tor/torrc

this one is template, which is used to generate config on each restart.

and it will allow to live a bit longer without editing exact torrc file till next time tor will be upgraded.

as a reminder, you can also add trigger to monit, that will send you message, where your line is absent.
Title: Re: How do I get the tor Control Port Password?
Post by: trustno1foxm on November 29, 2024, 10:48:03 AM
Quote from: mrpsycho on April 28, 2022, 09:31:07 PM
as a reminder, you can also add trigger to monit, that will send you message, where your line is absent.

how would that work? would you be so kind and give an example?
thx!

so long